mirror of
https://github.com/kennethreitz/tablib.git
synced 2026-06-05 23:10:17 +00:00
xlwrt cleanups
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from struct import pack
|
||||
from .UnicodeUtils import upack1, upack2
|
||||
import sys
|
||||
|
||||
@@ -505,12 +505,12 @@ class XlsDoc:
|
||||
we_own_it = not hasattr(f, 'write')
|
||||
if we_own_it:
|
||||
f = open(file_name_or_filelike_obj, 'wb')
|
||||
f.write(self.header)
|
||||
f.write(self.packed_MSAT_1st)
|
||||
f.write(stream)
|
||||
f.write(padding)
|
||||
f.write(self.packed_MSAT_2nd)
|
||||
f.write(self.packed_SAT)
|
||||
f.write(self.dir_stream)
|
||||
f.write((self.header))
|
||||
f.write((self.packed_MSAT_1st))
|
||||
f.write((stream))
|
||||
f.write((padding))
|
||||
f.write((self.packed_MSAT_2nd))
|
||||
f.write((self.packed_SAT))
|
||||
f.write((self.dir_stream))
|
||||
if we_own_it:
|
||||
f.close()
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
'''
|
||||
From BIFF8 on, strings are always stored using UTF-16LE text encoding. The
|
||||
character array is a sequence of 16-bit values4. Additionally it is
|
||||
|
||||
@@ -1943,9 +1943,10 @@ class Parser(object):
|
||||
col = x.getLine()
|
||||
text = x.getText()
|
||||
fmt = fmt + 'unexpected symbol at line %s (column %s) : "%s"'
|
||||
print(fmt % (line,col,text), file=sys.stderr)
|
||||
# print(fmt % (line,col,text), file=sys.stderr)
|
||||
else:
|
||||
print(fmt,str(x), file=sys.stderr)
|
||||
# print(fmt,str(x), file=sys.stderr)
|
||||
pass
|
||||
|
||||
def reportWarning(self,s):
|
||||
f = self.getFilename()
|
||||
@@ -2143,10 +2144,10 @@ class TreeParser(object):
|
||||
raise MismatchedTokenException(getTokenNames(), t, ttype, True)
|
||||
|
||||
def reportError(self,ex):
|
||||
print("error:",ex, file=sys.stderr)
|
||||
print("error:".format(ex, file=sys.stderr))
|
||||
|
||||
def reportWarning(self, s):
|
||||
print("warning:",s)
|
||||
print("warning:".format(s))
|
||||
|
||||
def setASTFactory(self,f):
|
||||
self.astFactory = f
|
||||
@@ -2718,7 +2719,7 @@ class ASTFactory(object):
|
||||
|
||||
def error(self, e):
|
||||
import sys
|
||||
print(e, file=sys.stderr)
|
||||
print(e.format(file=sys.stderr))
|
||||
|
||||
def setTokenTypeASTNodeType(self, tokenType, className):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user