rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
text = join(tx.lines[i][1]) | text = join(tx.XtraState.lines[i][1]) | def _do_under_lines(i, t_off, tx): y = tx.XtraState.cur_y - i*tx.XtraState.style.leading - tx.XtraState.f.fontSize/8.0 # 8.0 factor copied from para.py text = join(tx.lines[i][1]) textlen = tx._canvas.stringWidth(text, tx._fontname, tx._fontsize) tx._canvas.line(t_off, y, t_off+textlen, y) | 954611a81d92392eb15b1af9c221a3b5677dd43c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/954611a81d92392eb15b1af9c221a3b5677dd43c/paragraph.py |
def cvs_checkout(d,u): | def cvs_checkout(d): | def cvs_checkout(d,u): recursive_rmdir(d) cvs = find_exe('cvs') if cvs is None: print "Can't find cvs anywhere on the path" os.exit(1) have_tmp = os.path.isdir(_tmp) os.makedirs(d) os.environ['HOME']=d os.environ['CVSROOT']=':pserver:anonymous@cvs.reportlab.sourceforge.net:/cvsroot/reportlab' os.chdir(d) f = open(os.... | b744cd9be1006604510774c7aeb1668b0a0b1450 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b744cd9be1006604510774c7aeb1668b0a0b1450/cvs_check.py |
rawInterval = rawRange / min(self.maximumTicks-1,(float(self._length)/self.minimumTickSpacing )) | rawInterval = rawRange / min(float(self.maximumTicks-1),(float(self._length)/self.minimumTickSpacing )) | def _calcValueStep(self): '''Calculate _valueStep for the axis or get from valueStep.''' | f40e48650942cf4c7743227305c41f4da17220a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f40e48650942cf4c7743227305c41f4da17220a5/axes.py |
if self.inObject not in ["form", None]: raise ValueError, "can't go in form already in object %s" % self.inObject | def inForm(self): """specify that we are in a form xobject (disable page features, etc)""" if self.inObject not in ["form", None]: raise ValueError, "can't go in form already in object %s" % self.inObject self.inObject = "form" # don't need to do anything else, I think... | 4a20794337be4cd8e84d177a168cff8439da958b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/4a20794337be4cd8e84d177a168cff8439da958b/pdfdoc.py | |
fonts.addMapping(ttname, 1, 0, face.name) fonts.addMapping(ttname, 0, 1, face.name) fonts.addMapping(ttname, 1, 1, face.name) | fonts.addMapping(ttname, 1, 0, face.name) fonts.addMapping(ttname, 0, 1, face.name) fonts.addMapping(ttname, 1, 1, face.name) | def registerTypeFace(face): assert isinstance(face, TypeFace), 'Not a TypeFace: %s' % face _typefaces[face.name] = face # HACK - bold/italic do not apply for type 1, so egister # all combinations of mappings. from reportlab.lib import fonts ttname = string.lower(face.name) if not face.name in standardFonts: fonts.addMa... | bc91a5c8c88d3323dd5375a051d55a371309f5d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bc91a5c8c88d3323dd5375a051d55a371309f5d1/pdfmetrics.py |
self.initial = initial | self._initial = initial | def __init__(self,validate=None,desc=None,initial=None, **kw): self.validate = validate or isAnything self.desc = desc self.initial = initial for k,v in kw.items(): setattr(self,k,v) | 0b36a262a6c8b32d9a6e6b835e994e7bd79470c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0b36a262a6c8b32d9a6e6b835e994e7bd79470c4/attrmap.py |
self._cellvalues = data | def __init__(self, data, colWidths=None, rowHeights=None, style=None, repeatRows=0, repeatCols=0, splitByRow=1, emptyTableAction=None): self.hAlign = 'CENTER' self.vAlign = 'MIDDLE' if type(data) not in _SeqTypes: raise ValueError, "%s invalid data type" % self.identity() self._nrows = nrows = len(data) self._cellvalue... | 87bd1bc0c56aa5397961a09c2ad0f95c43ea8969 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/87bd1bc0c56aa5397961a09c2ad0f95c43ea8969/tables.py | |
cv = self._cellvalues | cv = getattr(self,'_cellvalues',None) | def identity(self, maxLen=30): '''Identify our selves as well as possible''' vx = None nr = getattr(self,'_nrows','unknown') nc = getattr(self,'_ncols','unknown') cv = self._cellvalues if cv and 'unknown' not in (nr,nc): b = 0 for i in xrange(nr): for j in xrange(nc): v = cv[i][j] t = type(v) if t in _SeqTypes or isins... | 87bd1bc0c56aa5397961a09c2ad0f95c43ea8969 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/87bd1bc0c56aa5397961a09c2ad0f95c43ea8969/tables.py |
def getModuleObjects(folder, rootName, typ): "Get a list of all function objects defined *somewhere* in a package." folders = [folder] + subFoldersOfFolder(folder) objects = [] for f in folders: sys.path.insert(0, f) os.chdir(f) pattern = os.path.join('*.py') prefix = f[string.find(f, rootName):] prefix = string.repl... | 0803fd85bba80deedc3429d50d83b40fe9ea6cba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0803fd85bba80deedc3429d50d83b40fe9ea6cba/test_docstrings.py | ||
def getModuleObjects(folder, rootName, typ): "Get a list of all function objects defined *somewhere* in a package." folders = [folder] + subFoldersOfFolder(folder) objects = [] for f in folders: sys.path.insert(0, f) os.chdir(f) pattern = os.path.join('*.py') prefix = f[string.find(f, rootName):] prefix = string.repl... | 0803fd85bba80deedc3429d50d83b40fe9ea6cba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0803fd85bba80deedc3429d50d83b40fe9ea6cba/test_docstrings.py | ||
del sys.path[0] | os.chdir(cwd) sys.path = opath | def getModuleObjects(folder, rootName, typ): "Get a list of all function objects defined *somewhere* in a package." folders = [folder] + subFoldersOfFolder(folder) objects = [] for f in folders: sys.path.insert(0, f) os.chdir(f) pattern = os.path.join('*.py') prefix = f[string.find(f, rootName):] prefix = string.repl... | 0803fd85bba80deedc3429d50d83b40fe9ea6cba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0803fd85bba80deedc3429d50d83b40fe9ea6cba/test_docstrings.py |
def getModuleObjects(folder, rootName, typ): "Get a list of all function objects defined *somewhere* in a package." folders = [folder] + subFoldersOfFolder(folder) objects = [] for f in folders: sys.path.insert(0, f) os.chdir(f) pattern = os.path.join('*.py') prefix = f[string.find(f, rootName):] prefix = string.repl... | 0803fd85bba80deedc3429d50d83b40fe9ea6cba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0803fd85bba80deedc3429d50d83b40fe9ea6cba/test_docstrings.py | ||
def getModuleObjects(folder, rootName, typ): "Get a list of all function objects defined *somewhere* in a package." folders = [folder] + subFoldersOfFolder(folder) objects = [] for f in folders: sys.path.insert(0, f) os.chdir(f) pattern = os.path.join('*.py') prefix = f[string.find(f, rootName):] prefix = string.repl... | 0803fd85bba80deedc3429d50d83b40fe9ea6cba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0803fd85bba80deedc3429d50d83b40fe9ea6cba/test_docstrings.py | ||
def _writeLogFile(self, objType): "Write log file for different kind of documentable objects." cwd = os.getcwd() | 0803fd85bba80deedc3429d50d83b40fe9ea6cba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0803fd85bba80deedc3429d50d83b40fe9ea6cba/test_docstrings.py | ||
def _writeLogFile(self, objType): "Write log file for different kind of documentable objects." cwd = os.getcwd() | 0803fd85bba80deedc3429d50d83b40fe9ea6cba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0803fd85bba80deedc3429d50d83b40fe9ea6cba/test_docstrings.py | ||
def makeSuite(): suite = unittest.TestSuite() suite.addTest(DocstringTestCase('test1')) suite.addTest(DocstringTestCase('test2')) suite.addTest(DocstringTestCase('test3')) suite.addTest(DocstringTestCase('test4')) return suite | 0803fd85bba80deedc3429d50d83b40fe9ea6cba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0803fd85bba80deedc3429d50d83b40fe9ea6cba/test_docstrings.py | ||
def makeSuite(): suite = unittest.TestSuite() suite.addTest(DocstringTestCase('test1')) suite.addTest(DocstringTestCase('test2')) suite.addTest(DocstringTestCase('test3')) suite.addTest(DocstringTestCase('test4')) return suite | 0803fd85bba80deedc3429d50d83b40fe9ea6cba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0803fd85bba80deedc3429d50d83b40fe9ea6cba/test_docstrings.py | ||
if Klass in _ItemWrapper.keys(): | if _ItemWrapper.has_key(Klass): | def __getitem__(self, index): try: return self._children[index] except KeyError: Klass = self._prototype if Klass in _ItemWrapper.keys(): WKlass = _ItemWrapper[Klass] else: class WKlass(Klass): def __getattr__(self,name): try: return Klass.__getattr__(self,name) except: return getattr(self._parent,name) _ItemWrapper[Kl... | 788a8c96bd22dff11691769d93c9f8b1445d36f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/788a8c96bd22dff11691769d93c9f8b1445d36f8/widgetbase.py |
return Klass.__getattr__(self,name) | return self.__class__.__bases__[0].__getattr__(self,name) | def __getattr__(self,name): try: return Klass.__getattr__(self,name) except: return getattr(self._parent,name) | 788a8c96bd22dff11691769d93c9f8b1445d36f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/788a8c96bd22dff11691769d93c9f8b1445d36f8/widgetbase.py |
tx.moveCursor(offset + 0.5 * extraspace, 0) | tx.moveCursor(0.5 * extraspace, 0) | def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite.""" | 6c7a36b77afaaaa14540fc0490cb88e40425768d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6c7a36b77afaaaa14540fc0490cb88e40425768d/layout.py |
tx.moveCursor(-offset + 0.5 * extraspace, 0) | tx.moveCursor(0.5 * extraspace, 0) | def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite.""" | 6c7a36b77afaaaa14540fc0490cb88e40425768d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6c7a36b77afaaaa14540fc0490cb88e40425768d/layout.py |
tx.moveCursor(offset + extraspace, 0) | tx.moveCursor(extraspace, 0) | def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite.""" | 6c7a36b77afaaaa14540fc0490cb88e40425768d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6c7a36b77afaaaa14540fc0490cb88e40425768d/layout.py |
tx.moveCursor(-offset + extraspace, 0) | tx.moveCursor(extraspace, 0) | def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite.""" | 6c7a36b77afaaaa14540fc0490cb88e40425768d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6c7a36b77afaaaa14540fc0490cb88e40425768d/layout.py |
data = open('odyssey.txt','r').readlines() | for fn in ('Odyssey.full.txt','Odyssey.txt'): if os.path.isfile(fn): break data = open(fn,'r').readlines() | def run(): started = time.time() canv = canvas.Canvas('odyssey.pdf') canv.setPageCompression(0) drawPageFrame(canv) #do some title page stuff canv.setFont("Times-Bold", 36) canv.drawCentredString(0.5 * A4[0], 7 * inch, "Homer's Odyssey") canv.setFont("Times-Bold", 18) canv.drawCentredString(0.5 * A4[0], 5 * inch, "Tr... | 5176bf9ee32ea8c701d9622b886dfdb25ed13176 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/5176bf9ee32ea8c701d9622b886dfdb25ed13176/odyssey.py |
pages = canv.getPageNumber() | pages = canv.getPageNumber()-1 | def run(): started = time.time() canv = canvas.Canvas('odyssey.pdf') canv.setPageCompression(0) drawPageFrame(canv) #do some title page stuff canv.setFont("Times-Bold", 36) canv.drawCentredString(0.5 * A4[0], 7 * inch, "Homer's Odyssey") canv.setFont("Times-Bold", 18) canv.drawCentredString(0.5 * A4[0], 5 * inch, "Tr... | 5176bf9ee32ea8c701d9622b886dfdb25ed13176 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/5176bf9ee32ea8c701d9622b886dfdb25ed13176/odyssey.py |
self.canv.setPageRotation(getattr(self.pageTemplate,'rotation',0) | self.canv.setPageRotation(getattr(self.pageTemplate,'rotation',0)) | def handle_pageEnd(self): ''' show the current page check the next page template hang a page begin ''' #detect infinite loops... if self._curPageFlowableCount == 0: self._emptyPages = self._emptyPages + 1 else: self._emptyPages = 0 if self._emptyPages >= self._emptyPagesAllowed: if 1: ident = "More than %d pages genera... | 34b9f676284e1c0b30cc787c7ee768eb0d7ddf64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/34b9f676284e1c0b30cc787c7ee768eb0d7ddf64/doctemplate.py |
extra = basicWidth - length wordspace = extra*1.0/nwords | def draw(self): from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY style = self.style lines = self.lines rightIndent = style.rightIndent leftIndent = style.leftIndent leading = style.leading font = style.fontName size = style.fontSize alignment = style.alignment firstindent = style.firstLineIndent... | d3569d526e746a6f3fb0ee8d65e99b1190c72297 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d3569d526e746a6f3fb0ee8d65e99b1190c72297/para.py | |
textobject.setWordSpace((extra*1.0/(nwords - 1))) | textobject.setWordSpace((basicWidth-length)/(nwords-1.0)) | def draw(self): from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY style = self.style lines = self.lines rightIndent = style.rightIndent leftIndent = style.leftIndent leading = style.leading font = style.fontName size = style.fontSize alignment = style.alignment firstindent = style.firstLineIndent... | d3569d526e746a6f3fb0ee8d65e99b1190c72297 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d3569d526e746a6f3fb0ee8d65e99b1190c72297/para.py |
test() | test() | def test(): from pprint import pprint #print test_program; return from reportlab.pdfgen import canvas from reportlab.lib.units import inch fn = "paratest0.pdf" c = canvas.Canvas(fn) test2(c) c.showPage() if 1: remainder = test_program + test_program + test_program laststate = {} while remainder: print "NEW PAGE" c.tran... | d3569d526e746a6f3fb0ee8d65e99b1190c72297 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d3569d526e746a6f3fb0ee8d65e99b1190c72297/para.py |
self.fontdict = MakeFontDictionary(fontstartpos, len(self.fonts)) | fontdicttext = MakeFontDictionary(fontstartpos, len(self.fonts)) fontdictob = PDFLiteral(fontdicttext) self.add("FontDictionary", fontdictob) self.fontdict = self.objectReference("FontDictionary") | def __init__(self): self.objects = [] self.objectPositions = {} self.fonts = MakeType1Fonts() | ea47db2c40665f54063731916816f8ca3efd7566 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ea47db2c40665f54063731916816f8ca3efd7566/pdfdoc.py |
self.objectPositions[key] = len(self.objects) | self.objectPositions[key] = len(self.objects)+1 | def add(self, key, obj): self.objectPositions[key] = len(self.objects) # its position self.objects.append(obj) #obj.doc = self return len(self.objects) - 1 # give its position | ea47db2c40665f54063731916816f8ca3efd7566 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ea47db2c40665f54063731916816f8ca3efd7566/pdfdoc.py |
return len(self.objects) - 1 | return self.getPosition(key) | def add(self, key, obj): self.objectPositions[key] = len(self.objects) # its position self.objects.append(obj) #obj.doc = self return len(self.objects) - 1 # give its position | ea47db2c40665f54063731916816f8ca3efd7566 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ea47db2c40665f54063731916816f8ca3efd7566/pdfdoc.py |
page.ParentPos = 3 | page.ParentPos = self.getPosition("PagesTreeRoot") | def addPage(self, page): """adds page and stream at end. Maintains pages list""" #page.buildstream() pos = len(self.objects) # work out where added page.ParentPos = 3 #pages collection page.info = { 'parentpos':3, 'fontdict':self.fontdict, 'contentspos':pos + 2, } self.PageCol.PageList.append(pos+1) self.add('Page... | ea47db2c40665f54063731916816f8ca3efd7566 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ea47db2c40665f54063731916816f8ca3efd7566/pdfdoc.py |
S = split(text,' ') | S = split(text) | def _getFragWords(frags): ''' given a Parafrag list return a list of fragwords [[size, (f00,w00), ..., (f0n,w0n)],....,[size, (fm0,wm0), ..., (f0n,wmn)]] each pair f,w represents a style and some string each sublist represents a word ''' R = [] W = [] n = 0 for f in frags: text = f.text #del f.text # we can't do this u... | e1c823dc115a67670281d6b96de3035f53bf7b2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/e1c823dc115a67670281d6b96de3035f53bf7b2a/paragraph.py |
if W!=[] and text[0] in [' ','\t']: | if W!=[] and text[0] in whitespace: | def _getFragWords(frags): ''' given a Parafrag list return a list of fragwords [[size, (f00,w00), ..., (f0n,w0n)],....,[size, (fm0,wm0), ..., (f0n,wmn)]] each pair f,w represents a style and some string each sublist represents a word ''' R = [] W = [] n = 0 for f in frags: text = f.text #del f.text # we can't do this u... | e1c823dc115a67670281d6b96de3035f53bf7b2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/e1c823dc115a67670281d6b96de3035f53bf7b2a/paragraph.py |
if text[-1] in [' ','\t']: | if text[-1] in whitespace: | def _getFragWords(frags): ''' given a Parafrag list return a list of fragwords [[size, (f00,w00), ..., (f0n,w0n)],....,[size, (fm0,wm0), ..., (f0n,wmn)]] each pair f,w represents a style and some string each sublist represents a word ''' R = [] W = [] n = 0 for f in frags: text = f.text #del f.text # we can't do this u... | e1c823dc115a67670281d6b96de3035f53bf7b2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/e1c823dc115a67670281d6b96de3035f53bf7b2a/paragraph.py |
if W!=[]: W.insert(0,n) R.append(W) W = [] n = 0 R.append([0,(f,'')]) | W.append((f,'')) | def _getFragWords(frags): ''' given a Parafrag list return a list of fragwords [[size, (f00,w00), ..., (f0n,w0n)],....,[size, (fm0,wm0), ..., (f0n,wmn)]] each pair f,w represents a style and some string each sublist represents a word ''' R = [] W = [] n = 0 for f in frags: text = f.text #del f.text # we can't do this u... | e1c823dc115a67670281d6b96de3035f53bf7b2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/e1c823dc115a67670281d6b96de3035f53bf7b2a/paragraph.py |
if nText!='' and nText[0]!=' ': | if (nText!='' and nText[0]!=' ') or hasattr(f,'cbDefn'): | def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word li... | e1c823dc115a67670281d6b96de3035f53bf7b2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/e1c823dc115a67670281d6b96de3035f53bf7b2a/paragraph.py |
raise LayoutError("More than %d pages generated without content - halting layout. Likely that a flowable is too large for any frame." % self._emptyPagesAllowed) | ident = "More than %d pages generated without content - halting layout. Likely that a flowable is too large for any frame." % self._emptyPagesAllowed raise LayoutError(ident) | def handle_pageEnd(self): ''' show the current page check the next page template hang a page begin ''' #detect infinite loops... if self._curPageFlowableCount == 0: self._emptyPages = self._emptyPages + 1 else: self._emptyPages = 0 if self._emptyPages >= self._emptyPagesAllowed: if 1: raise LayoutError("More than %d pa... | 019ee3bde12b7e3b2adc4e7ec74bba3eb5877041 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/019ee3bde12b7e3b2adc4e7ec74bba3eb5877041/doctemplate.py |
raise LayoutError("Splitting error(n==%d) on page %d in\n%s" % (n,self.page,f.identity(30))) | ident = "Splitting error(n==%d) on page %d in\n%s" % (n,self.page,f.identity(30)) raise LayoutError(ident) | def handle_flowable(self,flowables): '''try to handle one flowable from the front of list flowables.''' | 019ee3bde12b7e3b2adc4e7ec74bba3eb5877041 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/019ee3bde12b7e3b2adc4e7ec74bba3eb5877041/doctemplate.py |
raise LayoutError("Flowable %s too large on page %d" % (f.identity(30), self.page)) | ident = "Flowable %s too large on page %d" % (f.identity(30), self.page) raise LayoutError(ident) | def handle_flowable(self,flowables): '''try to handle one flowable from the front of list flowables.''' | 019ee3bde12b7e3b2adc4e7ec74bba3eb5877041 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/019ee3bde12b7e3b2adc4e7ec74bba3eb5877041/doctemplate.py |
self.restartAccumulators() self.annotationCount = 0 | self._restartAccumulators() self._annotationCount = 0 | def __init__(self,filename,pagesize=(595.27,841.89), bottomup = 1, pageCompression=0 ): """Most of the attributes are private - we will use set/get methods as the preferred interface. Default page size is A4.""" self._filename = filename self._doc = pdfdoc.PDFDocument() self._pagesize = pagesize #self._currentPageHasI... | 2424475e071e1c37b73f3c67658b0731bda9a15e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2424475e071e1c37b73f3c67658b0731bda9a15e/canvas.py |
self.setXObjects(page) self.setAnnotations(page) | self._setXObjects(page) self._setAnnotations(page) | def showPage(self): """This is where the fun happens""" page = pdfdoc.PDFPage() page.pagewidth = self._pagesize[0] page.pageheight = self._pagesize[1] page.hasImages = self._currentPageHasImages page.pageTransitionString = self._pageTransitionString page.setCompression(self._pageCompression) #print stream page.setStrea... | 2424475e071e1c37b73f3c67658b0731bda9a15e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2424475e071e1c37b73f3c67658b0731bda9a15e/canvas.py |
self.restartAccumulators() def setAnnotations(self,page): | self._restartAccumulators() def _setAnnotations(self,page): | def showPage(self): """This is where the fun happens""" page = pdfdoc.PDFPage() page.pagewidth = self._pagesize[0] page.pageheight = self._pagesize[1] page.hasImages = self._currentPageHasImages page.pageTransitionString = self._pageTransitionString page.setCompression(self._pageCompression) #print stream page.setStrea... | 2424475e071e1c37b73f3c67658b0731bda9a15e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2424475e071e1c37b73f3c67658b0731bda9a15e/canvas.py |
def setXObjects(self, thing): | def _setXObjects(self, thing): | def setXObjects(self, thing): """for pages and forms, define the XObject dictionary for resources, if needed""" forms = self._formsinuse if forms: xobjectsdict = self._doc.xobjDict(forms) thing.XObjects = xobjectsdict else: thing.XObjects = None | 2424475e071e1c37b73f3c67658b0731bda9a15e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2424475e071e1c37b73f3c67658b0731bda9a15e/canvas.py |
def bookmarkReference(self, name): | def _bookmarkReference(self, name): | def bookmarkReference(self, name): """get a reference to a (possibly undefined, possibly unbound) bookmark""" d = self._destinations try: return d[name] except: result = d[name] = pdfdoc.Destination(name) # newly defined, unbound return result | 2424475e071e1c37b73f3c67658b0731bda9a15e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2424475e071e1c37b73f3c67658b0731bda9a15e/canvas.py |
dest = self.bookmarkReference(name) | dest = self._bookmarkReference(name) | def bookmarkPage(self, name): """bind a bookmark (destination) to the current page""" # XXXX there are a lot of other ways a bookmark destination can be bound: should be implemented. # XXXX the other ways require tracking of the graphics state.... dest = self.bookmarkReference(name) pageref = self._doc.thisPageRef() de... | 2424475e071e1c37b73f3c67658b0731bda9a15e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2424475e071e1c37b73f3c67658b0731bda9a15e/canvas.py |
def bookmarkHorizontalInPageAbsolute(self, name, yhorizontal): | def bookmarkHorizontalAbsolute(self, name, yhorizontal): | def bookmarkHorizontalInPageAbsolute(self, name, yhorizontal): """bind a bookmark (destination to the current page at a horizontal position""" dest = self.bookmarkReference(name) pageref = self._doc.thisPageRef() dest.fith(yhorizontal) dest.setPageRef(pageref) return dest | 2424475e071e1c37b73f3c67658b0731bda9a15e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2424475e071e1c37b73f3c67658b0731bda9a15e/canvas.py |
dest = self.bookmarkReference(name) | dest = self._bookmarkReference(name) | def bookmarkHorizontalInPageAbsolute(self, name, yhorizontal): """bind a bookmark (destination to the current page at a horizontal position""" dest = self.bookmarkReference(name) pageref = self._doc.thisPageRef() dest.fith(yhorizontal) dest.setPageRef(pageref) return dest | 2424475e071e1c37b73f3c67658b0731bda9a15e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2424475e071e1c37b73f3c67658b0731bda9a15e/canvas.py |
def restartAccumulators(self): | def _restartAccumulators(self): | def restartAccumulators(self): self._code = [] # ready for more... self._currentPageHasImages = 1 # for safety... self._formsinuse = [] self._annotationrefs = [] | 2424475e071e1c37b73f3c67658b0731bda9a15e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2424475e071e1c37b73f3c67658b0731bda9a15e/canvas.py |
self.setXObjects(form) self.setAnnotations(form) | self._setXObjects(form) self._setAnnotations(form) | def makeForm(self, name, lowerx=0, lowery=0, upperx=None, uppery=None): """Like showpage, but make a form using accumulated operations instead""" (w,h) = self._pagesize if upperx is None: upperx=w if uppery is None: uppery=h form = pdfdoc.PDFFormXObject(lowerx=lowerx, lowery=lowery, upperx=upperx, uppery=uppery) form.c... | 2424475e071e1c37b73f3c67658b0731bda9a15e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2424475e071e1c37b73f3c67658b0731bda9a15e/canvas.py |
self.restartAccumulators() | self._restartAccumulators() | def makeForm(self, name, lowerx=0, lowery=0, upperx=None, uppery=None): """Like showpage, but make a form using accumulated operations instead""" (w,h) = self._pagesize if upperx is None: upperx=w if uppery is None: uppery=h form = pdfdoc.PDFFormXObject(lowerx=lowerx, lowery=lowery, upperx=upperx, uppery=uppery) form.c... | 2424475e071e1c37b73f3c67658b0731bda9a15e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2424475e071e1c37b73f3c67658b0731bda9a15e/canvas.py |
self.addAnnotation(annotation, name, addtopage) | self._addAnnotation(annotation, name, addtopage) | def textAnnotation(self, contents, Rect=None, addtopage=1, name=None, **kw): if not Rect: (w,h) = self._pagesize# default to whole page (?) Rect = (0,0,w,h) annotation = apply(pdfdoc.TextAnnotation, (Rect, contents), kw) self.addAnnotation(annotation, name, addtopage) | 2424475e071e1c37b73f3c67658b0731bda9a15e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2424475e071e1c37b73f3c67658b0731bda9a15e/canvas.py |
def linkAnnotationAbsolute(self, contents, destinationname, Rect=None, addtopage=1, name=None, **kw): | def linkAbsolute(self, contents, destinationname, Rect=None, addtopage=1, name=None, **kw): | def linkAnnotationAbsolute(self, contents, destinationname, Rect=None, addtopage=1, name=None, **kw): """link annotation positioned wrt the default user space""" destination = self.bookmarkReference(destinationname) # permitted to be undefined... must bind later... (w,h) = self._pagesize if not Rect: Rect = (0,0,w,h) k... | 2424475e071e1c37b73f3c67658b0731bda9a15e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2424475e071e1c37b73f3c67658b0731bda9a15e/canvas.py |
destination = self.bookmarkReference(destinationname) | destination = self._bookmarkReference(destinationname) | def linkAnnotationAbsolute(self, contents, destinationname, Rect=None, addtopage=1, name=None, **kw): """link annotation positioned wrt the default user space""" destination = self.bookmarkReference(destinationname) # permitted to be undefined... must bind later... (w,h) = self._pagesize if not Rect: Rect = (0,0,w,h) k... | 2424475e071e1c37b73f3c67658b0731bda9a15e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2424475e071e1c37b73f3c67658b0731bda9a15e/canvas.py |
self.addAnnotation(annotation, name, addtopage) | self._addAnnotation(annotation, name, addtopage) | def linkAnnotationAbsolute(self, contents, destinationname, Rect=None, addtopage=1, name=None, **kw): """link annotation positioned wrt the default user space""" destination = self.bookmarkReference(destinationname) # permitted to be undefined... must bind later... (w,h) = self._pagesize if not Rect: Rect = (0,0,w,h) k... | 2424475e071e1c37b73f3c67658b0731bda9a15e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2424475e071e1c37b73f3c67658b0731bda9a15e/canvas.py |
def addAnnotation(self, annotation, name=None, addtopage=1): count = self.annotationCount = self.annotationCount+1 | def _addAnnotation(self, annotation, name=None, addtopage=1): count = self._annotationCount = self._annotationCount+1 | def addAnnotation(self, annotation, name=None, addtopage=1): count = self.annotationCount = self.annotationCount+1 if not name: name="NUMBER"+repr(count) self._doc.addAnnotation(name, annotation) if addtopage: self.annotatePage(name) | 2424475e071e1c37b73f3c67658b0731bda9a15e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2424475e071e1c37b73f3c67658b0731bda9a15e/canvas.py |
self.annotatePage(name) | self._annotatePage(name) | def addAnnotation(self, annotation, name=None, addtopage=1): count = self.annotationCount = self.annotationCount+1 if not name: name="NUMBER"+repr(count) self._doc.addAnnotation(name, annotation) if addtopage: self.annotatePage(name) | 2424475e071e1c37b73f3c67658b0731bda9a15e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2424475e071e1c37b73f3c67658b0731bda9a15e/canvas.py |
def annotatePage(self, name): | def _annotatePage(self, name): | def annotatePage(self, name): ref = self._doc.refAnnotation(name) self._annotationrefs.append(ref) | 2424475e071e1c37b73f3c67658b0731bda9a15e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2424475e071e1c37b73f3c67658b0731bda9a15e/canvas.py |
failTest('</a>',"Error Error: End tag </a> outside of any element\n in unnamed entity at line 1 char 4 of [unknown]\nEnd tag </a> outside of any element\nParse Failed!\n") | failTest('</a>',"error Error: End tag </a> outside of any element\n in unnamed entity at line 1 char 4 of [unknown]\nEnd tag </a> outside of any element\nParse Failed!\n") | def _runTests(pyRXP): global _pyRXP _pyRXP = pyRXP print >>_logf, '############# Testing',pyRXP.__name__ try: for k,v in pyRXP.parser_flags.items(): eval('pyRXP.Parser(%s=%d)' % (k,v)) print >>_logf,'Parser keywords OK' _dot('.') except: traceback.print_exc() print >>_logf,'Parser keywords BAD' _dot('E') try: for k,v i... | 76881c0a01dfac1540afb6e8492d0dbb1960bba0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/76881c0a01dfac1540afb6e8492d0dbb1960bba0/testRXPbasic.py |
failTest('<?xml version="1.0" encoding="LATIN-1"?></a>',"Error Unknown declared encoding LATIN-1\nInternal error, ParserPush failed!\n") | failTest('<?xml version="1.0" encoding="LATIN-1"?></a>',"error Unknown declared encoding LATIN-1\nInternal error, ParserPush failed!\n") | def _runTests(pyRXP): global _pyRXP _pyRXP = pyRXP print >>_logf, '############# Testing',pyRXP.__name__ try: for k,v in pyRXP.parser_flags.items(): eval('pyRXP.Parser(%s=%d)' % (k,v)) print >>_logf,'Parser keywords OK' _dot('.') except: traceback.print_exc() print >>_logf,'Parser keywords BAD' _dot('E') try: for k,v i... | 76881c0a01dfac1540afb6e8492d0dbb1960bba0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/76881c0a01dfac1540afb6e8492d0dbb1960bba0/testRXPbasic.py |
failTest(bigDepth(257),"""Error Internal error, stack limit reached!\n""", inOnly=1) | failTest(bigDepth(257),"""error Internal error, stack limit reached!\n""", inOnly=1) | def _runTests(pyRXP): global _pyRXP _pyRXP = pyRXP print >>_logf, '############# Testing',pyRXP.__name__ try: for k,v in pyRXP.parser_flags.items(): eval('pyRXP.Parser(%s=%d)' % (k,v)) print >>_logf,'Parser keywords OK' _dot('.') except: traceback.print_exc() print >>_logf,'Parser keywords BAD' _dot('E') try: for k,v i... | 76881c0a01dfac1540afb6e8492d0dbb1960bba0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/76881c0a01dfac1540afb6e8492d0dbb1960bba0/testRXPbasic.py |
if glyph == otherEnc[i]: | if glyph==otherEnc[i]: | def getDifferences(self, otherEnc): """Return a compact list of the code points differing between two encodings | 9f7362ca380055644262d98b36f588785f545946 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9f7362ca380055644262d98b36f588785f545946/pdfmetrics.py |
else: | elif glyph: | def getDifferences(self, otherEnc): """Return a compact list of the code points differing between two encodings | 9f7362ca380055644262d98b36f588785f545946 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9f7362ca380055644262d98b36f588785f545946/pdfmetrics.py |
rawdata = open('../../rlextra/rml2pdf/doc/rml_user_guide.rml').read() | rawdata = open('../../rlextra/rml2pdf/doc/rml_user_guide.prep').read() | def testStringWidthAlgorithms(): rawdata = open('../../rlextra/rml2pdf/doc/rml_user_guide.rml').read() print 'rawdata length %d' % len(rawdata) print 'test one huge string...' test3widths([rawdata]) print words = string.split(rawdata) print 'test %d shorter strings (average length %0.2f chars)...' % (len(words), 1.0*le... | 9f7362ca380055644262d98b36f588785f545946 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9f7362ca380055644262d98b36f588785f545946/pdfmetrics.py |
_attrMap = AttrMap( x = AttrMapValue(isNumber, desc='X position of the chart.'), y = AttrMapValue(isNumber, desc='Y position of the chart.'), width = AttrMapValue(isNumber), height = AttrMapValue(isNumber), data = AttrMapValue(isListOfNumbers), labels = AttrMapValue(isListOfStringsOrNone), startAngle = AttrMapValue(isN... | _attrMap = AttrMap( x = AttrMapValue(isNumber, desc='X position of the chart.'), y = AttrMapValue(isNumber, desc='Y position of the chart.'), width = AttrMapValue(isNumber), height = AttrMapValue(isNumber), data = AttrMapValue(isListOfNumbers), labels = AttrMapValue(isListOfStringsOrNone), startAngle = AttrMapValue(isN... | def __init__(self): self.strokeWidth = 0 self.fillColor = None self.strokeColor = STATE_DEFAULTS["strokeColor"] self.strokeDashArray = STATE_DEFAULTS["strokeDashArray"] self.popout = 0 self.fontName = STATE_DEFAULTS["fontName"] self.fontSize = STATE_DEFAULTS["fontSize"] self.fontColor = STATE_DEFAULTS["fillColor"] self... | 48117ddebba026db69edc7ac4d606a5bb49fe623 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/48117ddebba026db69edc7ac4d606a5bb49fe623/piecharts.py |
"Make a degenerated pie chart with only one slice." d = Drawing(400, 200) pc = Pie() pc.x = 150 pc.y = 50 pc.data = [10] pc.labels = ['a'] pc.defaultStyles.strokeWidth=1 d.add(pc) return d | "Make a degenerated pie chart with only one slice." d = Drawing(400, 200) pc = Pie() pc.x = 150 pc.y = 50 pc.data = [10] pc.labels = ['a'] pc.defaultStyles.strokeWidth=1 d.add(pc) return d | def sample0a(): "Make a degenerated pie chart with only one slice." d = Drawing(400, 200) pc = Pie() pc.x = 150 pc.y = 50 pc.data = [10] pc.labels = ['a'] pc.defaultStyles.strokeWidth=1#0.5 d.add(pc) return d | 48117ddebba026db69edc7ac4d606a5bb49fe623 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/48117ddebba026db69edc7ac4d606a5bb49fe623/piecharts.py |
"Make a degenerated pie chart with only one slice." d = Drawing(400, 200) pc = Pie() pc.x = 150 pc.y = 50 pc.width = 120 pc.height = 100 pc.data = [10] pc.labels = ['a'] pc.defaultStyles.strokeWidth=1 d.add(pc) return d | "Make a degenerated pie chart with only one slice." d = Drawing(400, 200) pc = Pie() pc.x = 150 pc.y = 50 pc.width = 120 pc.height = 100 pc.data = [10] pc.labels = ['a'] pc.defaultStyles.strokeWidth=1 d.add(pc) return d | def sample0b(): "Make a degenerated pie chart with only one slice." d = Drawing(400, 200) pc = Pie() pc.x = 150 pc.y = 50 pc.width = 120 pc.height = 100 pc.data = [10] pc.labels = ['a'] pc.defaultStyles.strokeWidth=1#0.5 d.add(pc) return d | 48117ddebba026db69edc7ac4d606a5bb49fe623 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/48117ddebba026db69edc7ac4d606a5bb49fe623/piecharts.py |
"Make a typical pie chart with with one slice treated in a special way." d = Drawing(400, 200) pc = Pie() pc.x = 150 pc.y = 50 pc.data = [10, 20, 30, 40, 50, 60] pc.labels = ['a', 'b', 'c', 'd', 'e', 'f'] pc.defaultStyles.strokeWidth=1 pc.defaultStyles[3].popout = 20 pc.defaultStyles[3].strokeWidth = 2 pc.defaultSty... | "Make a typical pie chart with with one slice treated in a special way." d = Drawing(400, 200) pc = Pie() pc.x = 150 pc.y = 50 pc.data = [10, 20, 30, 40, 50, 60] pc.labels = ['a', 'b', 'c', 'd', 'e', 'f'] pc.defaultStyles.strokeWidth=1 pc.defaultStyles[3].popout = 20 pc.defaultStyles[3].strokeWidth = 2 pc.defaultSty... | def sample1(): "Make a typical pie chart with with one slice treated in a special way." d = Drawing(400, 200) pc = Pie() pc.x = 150 pc.y = 50 pc.data = [10, 20, 30, 40, 50, 60] pc.labels = ['a', 'b', 'c', 'd', 'e', 'f'] pc.defaultStyles.strokeWidth=1#0.5 pc.defaultStyles[3].popout = 20 pc.defaultStyles[3].strokeWidt... | 48117ddebba026db69edc7ac4d606a5bb49fe623 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/48117ddebba026db69edc7ac4d606a5bb49fe623/piecharts.py |
"Make a pie chart with nine slices." d = Drawing(400, 200) pc = Pie() pc.x = 125 pc.y = 25 pc.data = [0.31, 0.148, 0.108, 0.076, 0.033, 0.03, 0.019, 0.126, 0.15] pc.labels = ['1', '2', '3', '4', '5', '6', '7', '8', 'X'] pc.width = 150 pc.height = 150 pc.defaultStyles.strokeWidth=1 pc.defaultStyles[0].fillColor = co... | "Make a pie chart with nine slices." d = Drawing(400, 200) pc = Pie() pc.x = 125 pc.y = 25 pc.data = [0.31, 0.148, 0.108, 0.076, 0.033, 0.03, 0.019, 0.126, 0.15] pc.labels = ['1', '2', '3', '4', '5', '6', '7', '8', 'X'] pc.width = 150 pc.height = 150 pc.defaultStyles.strokeWidth=1 pc.defaultStyles[0].fillColor = co... | def sample2(): "Make a pie chart with nine slices." d = Drawing(400, 200) pc = Pie() pc.x = 125 pc.y = 25 pc.data = [0.31, 0.148, 0.108, 0.076, 0.033, 0.03, 0.019, 0.126, 0.15] pc.labels = ['1', '2', '3', '4', '5', '6', '7', '8', 'X'] pc.width = 150 pc.height = 150 pc.defaultStyles.strokeWidth=1#0.5 pc.defaultStyle... | 48117ddebba026db69edc7ac4d606a5bb49fe623 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/48117ddebba026db69edc7ac4d606a5bb49fe623/piecharts.py |
"Make a pie chart with a very slim slice." d = Drawing(400, 200) pc = Pie() pc.x = 125 pc.y = 25 pc.data = [74, 1, 25] pc.width = 150 pc.height = 150 pc.defaultStyles.strokeWidth=1 pc.defaultStyles[0].fillColor = colors.steelblue pc.defaultStyles[1].fillColor = colors.thistle pc.defaultStyles[2].fillColor = colors.... | "Make a pie chart with a very slim slice." d = Drawing(400, 200) pc = Pie() pc.x = 125 pc.y = 25 pc.data = [74, 1, 25] pc.width = 150 pc.height = 150 pc.defaultStyles.strokeWidth=1 pc.defaultStyles[0].fillColor = colors.steelblue pc.defaultStyles[1].fillColor = colors.thistle pc.defaultStyles[2].fillColor = colors.... | def sample3(): "Make a pie chart with a very slim slice." d = Drawing(400, 200) pc = Pie() pc.x = 125 pc.y = 25 pc.data = [74, 1, 25] pc.width = 150 pc.height = 150 pc.defaultStyles.strokeWidth=1#0.5 pc.defaultStyles[0].fillColor = colors.steelblue pc.defaultStyles[1].fillColor = colors.thistle pc.defaultStyles[2].... | 48117ddebba026db69edc7ac4d606a5bb49fe623 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/48117ddebba026db69edc7ac4d606a5bb49fe623/piecharts.py |
_ElementWrapper={} | _ItemWrapper={} | def provideNode(self): return self.draw() | 23149f8227eabceef6185933512f0972636d9dc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/23149f8227eabceef6185933512f0972636d9dc1/widgetbase.py |
if Klass in _ElementWrapper.keys(): WKlass = _ElementWrapper[Klass] | if Klass in _ItemWrapper.keys(): WKlass = _ItemWrapper[Klass] | def __getitem__(self, index): try: return self._children[index] except KeyError: Klass = self._prototype if Klass in _ElementWrapper.keys(): WKlass = _ElementWrapper[Klass] else: class WKlass(Klass): def __getattr__(self,name): try: return Klass.__getattr__(self,name) except: return getattr(self._parent,name) | 23149f8227eabceef6185933512f0972636d9dc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/23149f8227eabceef6185933512f0972636d9dc1/widgetbase.py |
import md5, time | import md5 | def __init__(self, encoding=rl_config.defaultEncoding, dummyoutline=0, compression=rl_config.pageCompression, invariant=rl_config.invariant): #self.defaultStreamFilters = [PDFBase85Encode, PDFZCompress] # for testing! #self.defaultStreamFilters = [PDFZCompress] # for testing! assert encoding in ['MacRomanEncoding', 'Wi... | 3913b4770c7ff833e239029bbedfa1afe83b973e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3913b4770c7ff833e239029bbedfa1afe83b973e/pdfdoc.py |
sig.update(repr(time.time())) | if not self.invariant: import time sig.update(repr(time.time())) | def __init__(self, encoding=rl_config.defaultEncoding, dummyoutline=0, compression=rl_config.pageCompression, invariant=rl_config.invariant): #self.defaultStreamFilters = [PDFBase85Encode, PDFZCompress] # for testing! #self.defaultStreamFilters = [PDFZCompress] # for testing! assert encoding in ['MacRomanEncoding', 'Wi... | 3913b4770c7ff833e239029bbedfa1afe83b973e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3913b4770c7ff833e239029bbedfa1afe83b973e/pdfdoc.py |
self.invariant = 1 | self.invariant = rl_config.invariant | def __init__(self): self.invariant = 1 self.title = "untitled" self.author = "anonymous" self.subject = "unspecified" #now = time.localtime(time.time()) #self.datestr = '%04d%02d%02d%02d%02d%02d' % tuple(now[0:6]) | 3913b4770c7ff833e239029bbedfa1afe83b973e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3913b4770c7ff833e239029bbedfa1afe83b973e/pdfdoc.py |
def __init__(self): self.invariant = 1 self.title = "untitled" self.author = "anonymous" self.subject = "unspecified" #now = time.localtime(time.time()) #self.datestr = '%04d%02d%02d%02d%02d%02d' % tuple(now[0:6]) | 3913b4770c7ff833e239029bbedfa1afe83b973e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3913b4770c7ff833e239029bbedfa1afe83b973e/pdfdoc.py | ||
if self.invariant: D["CreationDate"] = PDFString('19001231000000') else: D["CreationDate"] = PDFDate() | D["CreationDate"] = PDFDate(invariant=self.invariant) | def format(self, document): D = {} D["Title"] = PDFString(self.title) D["Author"] = PDFString(self.author) if self.invariant: D["CreationDate"] = PDFString('19001231000000') else: D["CreationDate"] = PDFDate() D["Producer"] = PDFString("ReportLab http://www.reportlab.com") D["Subject"] = PDFString(self.subject) PD = PD... | 3913b4770c7ff833e239029bbedfa1afe83b973e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3913b4770c7ff833e239029bbedfa1afe83b973e/pdfdoc.py |
DATEFMT = '%04d%02d%02d%02d%02d%02d' import time (nowyyyy, nowmm, nowdd, nowhh, nowm, nows) = tuple(time.localtime(time.time())[:6]) | _NOW=None | def format(self, document): A = PDFArray([self.llx, self.lly, self.ulx, self.ury]) return format(A, document) | 3913b4770c7ff833e239029bbedfa1afe83b973e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3913b4770c7ff833e239029bbedfa1afe83b973e/pdfdoc.py |
def __init__(self, yyyy=nowyyyy, mm=nowmm, dd=nowdd, hh=nowhh, m=nowm, s=nows): | def __init__(self, yyyy=None, mm=None, dd=None, hh=None, m=None, s=None, invariant=rl_config.invariant): if None in (yyyy, mm, dd, hh, m, s): if invariant: now = 1900,01,01,00,00,00,0 else: global _NOW if _NOW is None: import time _NOW = tuple(time.localtime(time.time())[:6]) now = _NOW if yyyy is None: yyyy=now[0] if ... | def __init__(self, yyyy=nowyyyy, mm=nowmm, dd=nowdd, hh=nowhh, m=nowm, s=nows): self.yyyy=yyyy; self.mm=mm; self.dd=dd; self.hh=hh; self.m=m; self.s=s | 3913b4770c7ff833e239029bbedfa1afe83b973e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3913b4770c7ff833e239029bbedfa1afe83b973e/pdfdoc.py |
S = PDFString(DATEFMT % (self.yyyy, self.mm, self.dd, self.hh, self.m, self.s)) | S = PDFString('%04d%02d%02d%02d%02d%02d' % (self.yyyy, self.mm, self.dd, self.hh, self.m, self.s)) | def format(self, doc): S = PDFString(DATEFMT % (self.yyyy, self.mm, self.dd, self.hh, self.m, self.s)) return format(S, doc) | 3913b4770c7ff833e239029bbedfa1afe83b973e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3913b4770c7ff833e239029bbedfa1afe83b973e/pdfdoc.py |
self.fileName = fileName | self.fileName = self._image.fileName | def __init__(self, fileName): if isinstance(fileName,ImageReader): self.__dict__ = fileName.__dict__ #borgize return if not haveImages: raise RuntimeError('Imaging Library not available, unable to import bitmaps') #start wih lots of null private fields, to be populated by #the relevant engine. self.fileName = fileNam... | b7399611e74bc35ace592f78da4988876af05ad4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b7399611e74bc35ace592f78da4988876af05ad4/utils.py |
def _calc(self): if hasattr(self,'_width'): return | def _calc_width(self): W = self._argW canv = getattr(self,'canv',None) saved = None if None in W: W = W[:] self._colWidths = W while None in W: j = W.index(None) f = lambda x,j=j: operator.getitem(x,j) V = map(f,self._cellvalues) S = map(f,self._cellStyles) w = 0 i = 0 for v, s in map(None, V, S): i = i + 1 t = type... | def _calc(self): if hasattr(self,'_width'): return | 9e630eea70f6e9bb731c2c5aa565eb66aaa332ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9e630eea70f6e9bb731c2c5aa565eb66aaa332ba/tables.py |
def _calc(self): if hasattr(self,'_width'): return | 9e630eea70f6e9bb731c2c5aa565eb66aaa332ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9e630eea70f6e9bb731c2c5aa565eb66aaa332ba/tables.py | ||
if None in W: W = W[:] self._colWidths = W while None in W: j = W.index(None) f = lambda x,j=j: operator.getitem(x,j) V = map(f,self._cellvalues) S = map(f,self._cellStyles) w = 0 i = 0 for v, s in map(None, V, S): i = i + 1 t = type(v) if t in _SeqTypes or isinstance(v,Flowable): raise ValueError, "Flowable %s in cell... | def _calc(self): if hasattr(self,'_width'): return | 9e630eea70f6e9bb731c2c5aa565eb66aaa332ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9e630eea70f6e9bb731c2c5aa565eb66aaa332ba/tables.py | |
width = 0 self._colpositions = [0] for w in W: width = width + w self._colpositions.append(width) self._width = width | def _calc(self): if hasattr(self,'_width'): return self._calc_height() if hasattr(self,'_width_calculated_once'): return self._width_calculated_once = 1 self._calc_width() | def _calc(self): if hasattr(self,'_width'): return | 9e630eea70f6e9bb731c2c5aa565eb66aaa332ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9e630eea70f6e9bb731c2c5aa565eb66aaa332ba/tables.py |
R0 = Table( data[:n], self._argW, self._argH[:n], | R0 = Table( data[:n], self._colWidths, self._argH[:n], | def _splitRows(self,availHeight): h = 0 n = 0 lim = len(self._rowHeights) while n<lim: hn = h + self._rowHeights[n] if hn>availHeight: break h = hn n = n + 1 | 9e630eea70f6e9bb731c2c5aa565eb66aaa332ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9e630eea70f6e9bb731c2c5aa565eb66aaa332ba/tables.py |
R1 = Table(data[:repeatRows]+data[n:], self._argW, self._argH[:repeatRows]+self._argH[n:], | R1 = Table(data[:repeatRows]+data[n:],self._colWidths, self._argH[:repeatRows]+self._argH[n:], | def _splitRows(self,availHeight): h = 0 n = 0 lim = len(self._rowHeights) while n<lim: hn = h + self._rowHeights[n] if hn>availHeight: break h = hn n = n + 1 | 9e630eea70f6e9bb731c2c5aa565eb66aaa332ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9e630eea70f6e9bb731c2c5aa565eb66aaa332ba/tables.py |
R1 = Table(data[n:], self._argW, self._argH[n:], | R1 = Table(data[n:], self._colWidths, self._argH[n:], | def _splitRows(self,availHeight): h = 0 n = 0 lim = len(self._rowHeights) while n<lim: hn = h + self._rowHeights[n] if hn>availHeight: break h = hn n = n + 1 | 9e630eea70f6e9bb731c2c5aa565eb66aaa332ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9e630eea70f6e9bb731c2c5aa565eb66aaa332ba/tables.py |
if type(filename) is type(''): | if type(fileName) is type(''): | def __init__(self, fileName): if not haveImages: warnOnce('Imaging Library not available, unable to import bitmaps') return #start wih lots of null private fields, to be populated by #the relevant engine. self.fileName = fileName self._image = None self._width = None self._height = None self._transparent = None self._d... | 91629de88381e101a088639f23e21e5b5e5b52de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/91629de88381e101a088639f23e21e5b5e5b52de/utils.py |
elif Flag._attrMap['kind'].validate(name): | elif name[-5:]=='_Flag' and Flag._attrMap['kind'].validate(name[:-5]): | def makeMarker(name): if Marker._attrMap['kind'].validate(name): m = Marker() m.kind = name elif Flag._attrMap['kind'].validate(name): m = Flag() m.kind = name m.size = 10 else: raise ValueError, "Invalid marker name %s" % name return m | a77c0498a33204c6e4648a002751383ee882429f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a77c0498a33204c6e4648a002751383ee882429f/markers.py |
m.kind = name | m.kind = name[:-5] | def makeMarker(name): if Marker._attrMap['kind'].validate(name): m = Marker() m.kind = name elif Flag._attrMap['kind'].validate(name): m = Flag() m.kind = name m.size = 10 else: raise ValueError, "Invalid marker name %s" % name return m | a77c0498a33204c6e4648a002751383ee882429f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a77c0498a33204c6e4648a002751383ee882429f/markers.py |
if type(abf) not in (TupleType,ListType): abf = abf, abf | def _setRange(self, dataSeries): """Set minimum and maximum axis values. | cb9c8bccd0f2cb02c44c49194ae23f96ecd5fc63 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/cb9c8bccd0f2cb02c44c49194ae23f96ecd5fc63/axes.py | |
canvas.drawString(100,700,'A Custom Shape') | canvas.drawString(600, 100, 'A Custom Shape') | def drawOn(self, canvas): canvas.saveState() canvas.setFont('Helvetica-Bold',24) canvas.drawString(100,700,'A Custom Shape') | 283888ccd106aff3de9023929e2c9f85a0621f9c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/283888ccd106aff3de9023929e2c9f85a0621f9c/customshapes.py |
"""returns boolean determining whether the next flowabel should stay with this one""" | """returns boolean determining whether the next flowable should stay with this one""" | def getKeepWithNext(self): """returns boolean determining whether the next flowabel should stay with this one""" if hasattr(self,'keepWithNext'): return self.keepWithNext elif hasattr(self,'style') and hasattr(self.style,'keepWithNext'): return self.style.keepWithNext else: return 0 | f6c3cd580aa6b6546710674150adc9c8f5c2d495 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f6c3cd580aa6b6546710674150adc9c8f5c2d495/flowables.py |
def __init__(self, maxWidth, maxHeight, content=[], mergeSpace=None, mode=0, id=None): | def __init__(self, maxWidth, maxHeight, content=[], mergeSpace=1, mode=0, name=None): | def __init__(self, maxWidth, maxHeight, content=[], mergeSpace=None, mode=0, id=None): '''mode describes the action to take when overflowing 0 raise an error in the normal way 1 ignore ie just draw it and report maxWidth, maxHeight 2 shrinkToFit ''' self.id = id self.maxWidth = maxWidth self.maxHeight = maxHeight... | 6cd4b58094e78c55f0ee1395d4f1aae6e963dd05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6cd4b58094e78c55f0ee1395d4f1aae6e963dd05/flowables.py |
self.id = id | self.name = name or str(id(self)) | def __init__(self, maxWidth, maxHeight, content=[], mergeSpace=None, mode=0, id=None): '''mode describes the action to take when overflowing 0 raise an error in the normal way 1 ignore ie just draw it and report maxWidth, maxHeight 2 shrinkToFit ''' self.id = id self.maxWidth = maxWidth self.maxHeight = maxHeight... | 6cd4b58094e78c55f0ee1395d4f1aae6e963dd05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6cd4b58094e78c55f0ee1395d4f1aae6e963dd05/flowables.py |
return "<%s at %d%s> size=%sx%s" % (self.__class__.__name__, id(self), self.id and ' id="%s"'%self.id, fp_str(self.maxWidth),fp_str(self.maxHeight)) | return "<%s at %d%s> size=%sx%s" % (self.__class__.__name__, id(self), self.name and ' name="%s"'%self.name, fp_str(self.maxWidth),fp_str(self.maxHeight)) | def identity(self, maxLen=None): return "<%s at %d%s> size=%sx%s" % (self.__class__.__name__, id(self), self.id and ' id="%s"'%self.id, fp_str(self.maxWidth),fp_str(self.maxHeight)) | 6cd4b58094e78c55f0ee1395d4f1aae6e963dd05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6cd4b58094e78c55f0ee1395d4f1aae6e963dd05/flowables.py |
maxWidth = float(self.maxWidth) | maxWidth = float(self.maxWidth or availWidth) | def wrap(self,availWidth,availHeight): mode = self.mode maxWidth = float(self.maxWidth) maxHeight = float(self.maxHeight) W, H = _listWrapOn(self._content,availWidth,self.canv) if mode==0 or (W<=maxWidth and H<=maxHeight): self.width = W #we take what we get self.height = H elif mode==1: #we lie self.width = min(max... | 6cd4b58094e78c55f0ee1395d4f1aae6e963dd05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6cd4b58094e78c55f0ee1395d4f1aae6e963dd05/flowables.py |
w.text = t[:i] cline.append(w) | cline.append(w.clone(text=t[:i])) | def _getFragLines(frags): lines = [] cline = [] W = frags[:] while W != []: w = W[0] t = w.text del W[0] i = string.find(t,'\n') if i>=0: tleft = t[i+1:] w.text = t[:i] cline.append(w) lines.append(cline) cline = [] if tleft!='': W.insert(0,w.clone(text=tleft)) else: cline.append(w) if cline!=[]: lines.append(cline) re... | a36e673fba04517a1c94d01a71ca1aa8aa7ba1f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a36e673fba04517a1c94d01a71ca1aa8aa7ba1f8/xpreformatted.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.