"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/reportlab/pdfbase/pdfdoc.py" between
reportlab-3.5.65.tar.gz and reportlab-3.5.66.tar.gz

About: ReportLab generates high-quality dynamic PDF documents/charts in real-time & high volumes from any data source (commercial version also available). f: office t: PDF report "data graphics" charts

pdfdoc.py  (reportlab-3.5.65):pdfdoc.py  (reportlab-3.5.66)
skipping to change at line 211 skipping to change at line 211
self._ID = (b'\n['+IDs+IDs+b']\n% ReportLab generated PDF document -- di gest (http://www.reportlab.com)\n') self._ID = (b'\n['+IDs+IDs+b']\n% ReportLab generated PDF document -- di gest (http://www.reportlab.com)\n')
return self._ID return self._ID
def SaveToFile(self, filename, canvas): def SaveToFile(self, filename, canvas):
if getattr(self,'_savedToFile',False): if getattr(self,'_savedToFile',False):
raise RuntimeError("class %s instances can only be saved once" % sel f.__class__.__name__) raise RuntimeError("class %s instances can only be saved once" % sel f.__class__.__name__)
self._savedToFile = True self._savedToFile = True
if hasattr(getattr(filename, "write",None),'__call__'): if hasattr(getattr(filename, "write",None),'__call__'):
myfile = 0 myfile = 0
f = filename f = filename
filename = getattr(f,'name','') filename = getattr(f,'name',None)
if isinstance(filename,int): filename = '<os fd:%d>'% filename if isinstance(filename,int):
filename = '<os fd:%d>'% filename
elif not isStr(filename): #try to fix bug reported by Robert Schroll
<rschroll at gmail.com>
filename = '<%s@0X%8.8X>' % (f.__class__.__name__,id(f))
filename = makeFileName(filename) filename = makeFileName(filename)
else : elif isStr(filename):
myfile = 1 myfile = 1
filename = makeFileName(filename) filename = makeFileName(filename)
f = open(filename, "wb") f = open(filename, "wb")
else:
raise TypeError('Cannot use %s as a filename or file' % repr(filenam
e))
data = self.GetPDFData(canvas) data = self.GetPDFData(canvas)
if isUnicode(data): if isUnicode(data):
data = data.encode('latin1') data = data.encode('latin1')
f.write(data) f.write(data)
if myfile: if myfile:
f.close() f.close()
import os import os
if os.name=='mac': if os.name=='mac':
from reportlab.lib.utils import markfilename from reportlab.lib.utils import markfilename
markfilename(filename) # do platform specific file junk markfilename(filename) # do platform specific file junk
 End of changes. 3 change blocks. 
3 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)