rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
elif ext == '.afm':
elif string.lower(ext) == '.afm':
def findT1File(self,ext='.pfb'): possible_exts = (string.lower(ext), string.upper(ext)) if hasattr(self,'pfbFileName'): r_basename = os.path.splitext(self.pfbFileName)[0] for e in possible_exts: if os.path.isfile(r_basename + e): return r_basename + e try: r = _fontdata.findT1File(self.name) except: afm = bruteForceSearchForAFM(self.name) if afm: if ext == '.pfb': for e in possible_exts: pfb = os.path.splitext(afm)[0] + e if os.path.isfile(pfb): r = pfb else: r = None elif ext == '.afm': r = afm else: r = None if r is None: warnOnce("Can't find %s for face '%s'" % (ext, self.name)) return r
922c14bfb04eba279f5c9a4499839c1aa941eb81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/922c14bfb04eba279f5c9a4499839c1aa941eb81/pdfmetrics.py
possibles = glob.glob(dirname + os.sep + '*.afm')
possibles = glob.glob(dirname + os.sep + '*.[aA][fF][mM]')
def bruteForceSearchForAFM(faceName): """Looks in all AFM files on path for face with given name. Returns AFM file name or None. Ouch!""" import glob from reportlab.rl_config import T1SearchPath for dirname in T1SearchPath: if not os.path.isdir(dirname): continue possibles = glob.glob(dirname + os.sep + '*.afm') for possible in possibles: (topDict, glyphDict) = parseAFMFile(possible) if topDict['FontName'] == faceName: return possible return None
922c14bfb04eba279f5c9a4499839c1aa941eb81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/922c14bfb04eba279f5c9a4499839c1aa941eb81/pdfmetrics.py
codes = map(ord, text)
codes = map(ord, uText)
def stringWidth(self, text, size, encoding='utf-8'): "Calculate text width" width = self.face.getCharWidth w = 0 if type(text) is UnicodeType: codes = map(ord, text) else: uText = unicode(text, encoding) codes = map(ord, text) for code in codes: w = w + width(code) return 0.001 * w * size
f498eb71a4c4a88dbb02b3ef0fa619c3bfb03496 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f498eb71a4c4a88dbb02b3ef0fa619c3bfb03496/ttfonts.py
fileSuffix = '-graph.pdf'
fileSuffix = '.pdf'
def getFunctionBody(f, linesInFile): """Pass in the function object and the lines in the file. Since we will typically grab several things out of the same file. it extracts a multiline text block. Works with methods too.""" if hasattr(f, 'im_func'): #it's a method, drill down and get its function f = f.im_func extracted = [] firstLineNo = f.func_code.co_firstlineno - 1 startingIndent = indentLevel(linesInFile[firstLineNo]) extracted.append(linesInFile[firstLineNo]) #brackets = 0 for line in linesInFile[firstLineNo+1:]: ind = indentLevel(line) if ind <= startingIndent: break else: extracted.append(line) # we are not indented return string.join(extracted, '\n') # ??? usefulLines = lines[firstLineNo:lineNo+1] return string.join(usefulLines, '\n')
55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py
if name == 'demo': PdfDocBuilder0.beginMethod(self, name, doc, sig)
pass
def beginMethod(self, name, doc, sig): if name == 'demo': PdfDocBuilder0.beginMethod(self, name, doc, sig)
55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py
if name == 'demo': PdfDocBuilder0.endMethod(self, name, doc, sig)
pass
def endMethod(self, name, doc, sig): if name == 'demo': PdfDocBuilder0.endMethod(self, name, doc, sig)
55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py
self._showWidgetDemoCode(widget)
def endClass(self, name, doc, bases): "Append a graphic demo of a widget at the end of a class." PdfDocBuilder0.endClass(self, name, doc, bases)
55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py
class UmlPdfDocBuilder0(PdfDocBuilder0): "Document the skeleton of a Python module with UML class diagrams." fileSuffix = '-uml.pdf' def begin(self): styleSheet = getSampleStyleSheet() self.h1 = styleSheet['Heading1'] self.h2 = styleSheet['Heading2'] self.h3 = styleSheet['Heading3'] self.code = styleSheet['Code'] self.bt = styleSheet['BodyText'] self.story = [] self.classCompartment = '' self.methodCompartment = [] def beginModule(self, name, doc, imported): story = self.story h1, h2, h3, bt = self.h1, self.h2, self.h3, self.bt styleSheet = getSampleStyleSheet() bt1 = styleSheet['BodyText'] story.append(Paragraph(name, h1)) story.append(XPreformatted(doc, bt1)) if imported: story.append(Paragraph('Imported modules', h2)) for m in imported: story.append(Paragraph(m, bt1)) def beginClasses(self, names): h1, h2, h3, bt = self.h1, self.h2, self.h3, self.bt if names: self.story.append(Paragraph('Classes', h2)) def beginClass(self, name, doc, bases): self.classCompartment = '' self.methodCompartment = [] if bases: bases = map(lambda b:b.__name__, bases) self.classCompartment = '%s(%s)' % (name, join(bases, ', ')) else: self.classCompartment = name def endClass(self, name, doc, bases): h1, h2, h3, bt, code = self.h1, self.h2, self.h3, self.bt, self.code styleSheet = getSampleStyleSheet() bt1 = styleSheet['BodyText'] story = self.story classDoc = _reduceDocStringLength(doc) tsa = tableStyleAttributes = [] p = Paragraph('<b>%s</b>' % self.classCompartment, bt) p.style.alignment = TA_CENTER rows = [(p,)] lenRows = len(rows) tsa.append(('BOX', (0,0), (-1,lenRows-1), 0.25, colors.black)) for name, doc, sig in self.methodCompartment: nameAndSig = Paragraph('<b>%s</b>%s' % (name, sig), bt1) rows.append((nameAndSig,)) tsa.append(('BOX', (0,lenRows), (-1,-1), 0.25, colors.black)) t = Table(rows, (12*cm,)) tableStyle = TableStyle(tableStyleAttributes) t.setStyle(tableStyle) self.story.append(t) self.story.append(Spacer(1*cm, 1*cm)) def beginMethod(self, name, doc, sig): self.methodCompartment.append((name, doc, sig)) def beginFunctions(self, names): h1, h2, h3, bt = self.h1, self.h2, self.h3, self.bt if names: self.story.append(Paragraph('Functions', h2)) self.classCompartment = chr(171) + ' Module-Level Functions ' + chr(187) self.methodCompartment = [] def beginFunction(self, name, doc, sig): self.methodCompartment.append((name, doc, sig)) def endFunctions(self, names): h1, h2, h3, bt, code = self.h1, self.h2, self.h3, self.bt, self.code styleSheet = getSampleStyleSheet() bt1 = styleSheet['BodyText'] story = self.story if not names: return tsa = tableStyleAttributes = [] p = Paragraph('<b>%s</b>' % self.classCompartment, bt) p.style.alignment = TA_CENTER rows = [(p,)] lenRows = len(rows) tsa.append(('BOX', (0,0), (-1,lenRows-1), 0.25, colors.black)) for name, doc, sig in self.methodCompartment: nameAndSig = Paragraph('<b>%s</b>%s' % (name, sig), bt1) rows.append((nameAndSig,)) tsa.append(('BOX', (0,lenRows), (-1,-1), 0.25, colors.black)) t = Table(rows, (12*cm,)) tableStyle = TableStyle(tableStyleAttributes) t.setStyle(tableStyle) self.story.append(t) self.story.append(Spacer(1*cm, 1*cm))
def beginFunction(self, name, doc, sig): bt = self.bt story = self.story story.append(Paragraph(name+sig, bt)) story.append(XPreformatted(doc, bt))
55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py
def documentModule0(path, builder=DocBuilder0()):
def documentModule0(path, builder=GraphPdfDocBuilder0()):
def documentModule0(path, builder=DocBuilder0()): """Generate documentation for one Python file in some format. This handles Python standard modules like string, custom modules on the Python search path like e.g. docpy as well as modules specified with their full path like C:/tmp/junk.py. The doc file will always be saved in the current directory with a basename equal to the module's name. """ cwd = os.getcwd() # Append directory to Python search path if we get one. dirName = os.path.dirname(path) if dirName: sys.path.append(dirName) # Remove .py extension from module name. if path[-3:] == '.py': modname = path[:-3] else: modname = path # Remove directory paths from module name. if dirName: modname = os.path.basename(modname) # Load the module. try: module = __import__(modname) except: print 'Failed to import %s.' % modname os.chdir(cwd) return # Do the real documentation work. s = ModuleSkeleton0() s.inspect(module) builder.write(s) # Remove appended directory from Python search path if we got one. if dirName: del sys.path[-1] os.chdir(cwd)
55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py
"""A callback function used when waking over a package tree."""
"A callback function used when waking over a package tree."
def _packageWalkCallback(builder, dirPath, files): """A callback function used when waking over a package tree.""" files = filter(lambda f:f != '__init__.py', files) files = filter(lambda f:f[-3:] == '.py', files) if files: for f in files: path = os.path.join(dirPath, f) print path builder.indentLevel = builder.indentLevel + 1 documentModule0(path, builder) builder.indentLevel = builder.indentLevel - 1
55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py
def documentPackage0(path, builder=DocBuilder0()):
def documentPackage0(pathOrName, builder=GraphPdfDocBuilder0()):
def documentPackage0(path, builder=DocBuilder0()): """Generate documentation for one Python package in some format. Rigiht now, 'path' must be a filesystem path, later it will also be a package name whose path will be resolved by importing the top-level module. The doc file will always be saved in the current directory. """ name = path if string.find(path, os.sep) > -1: name = os.path.splitext(os.path.basename(path))[0] else: package = __import__(name) name = path path = os.path.dirname(package.__file__) cwd = os.getcwd() builder.beginPackage(name) os.path.walk(path, _packageWalkCallback, builder) builder.endPackage(name) os.chdir(cwd)
55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py
name = path if string.find(path, os.sep) > -1: name = os.path.splitext(os.path.basename(path))[0]
if string.find(pathOrName, os.sep) > -1: name = os.path.splitext(os.path.basename(pathOrName))[0] path = pathOrName
def documentPackage0(path, builder=DocBuilder0()): """Generate documentation for one Python package in some format. Rigiht now, 'path' must be a filesystem path, later it will also be a package name whose path will be resolved by importing the top-level module. The doc file will always be saved in the current directory. """ name = path if string.find(path, os.sep) > -1: name = os.path.splitext(os.path.basename(path))[0] else: package = __import__(name) name = path path = os.path.dirname(package.__file__) cwd = os.getcwd() builder.beginPackage(name) os.path.walk(path, _packageWalkCallback, builder) builder.endPackage(name) os.chdir(cwd)
55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py
package = __import__(name) name = path
package = __import__(pathOrName) if '.' in pathOrName: subname = 'package' + pathOrName[string.find(pathOrName, '.'):] package = eval(subname) name = pathOrName
def documentPackage0(path, builder=DocBuilder0()): """Generate documentation for one Python package in some format. Rigiht now, 'path' must be a filesystem path, later it will also be a package name whose path will be resolved by importing the top-level module. The doc file will always be saved in the current directory. """ name = path if string.find(path, os.sep) > -1: name = os.path.splitext(os.path.basename(path))[0] else: package = __import__(name) name = path path = os.path.dirname(package.__file__) cwd = os.getcwd() builder.beginPackage(name) os.path.walk(path, _packageWalkCallback, builder) builder.endPackage(name) os.chdir(cwd)
55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py
def documentPackage0(path, builder=DocBuilder0()): """Generate documentation for one Python package in some format. Rigiht now, 'path' must be a filesystem path, later it will also be a package name whose path will be resolved by importing the top-level module. The doc file will always be saved in the current directory. """ name = path if string.find(path, os.sep) > -1: name = os.path.splitext(os.path.basename(path))[0] else: package = __import__(name) name = path path = os.path.dirname(package.__file__) cwd = os.getcwd() builder.beginPackage(name) os.path.walk(path, _packageWalkCallback, builder) builder.endPackage(name) os.chdir(cwd)
55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py
"""Handle command-line options and trigger corresponding action. """
"Handle command-line options and trigger corresponding action."
def main(): """Handle command-line options and trigger corresponding action. """ opts, args = getopt.getopt(sys.argv[1:], 'hf:m:p:') # On -h print usage and exit immediately. for o, a in opts: if o == '-h': print printUsage.__doc__ #printUsage() sys.exit(0) # On -f set the DocBuilder to use or a default one. builder = DocBuilder0() for o, a in opts: if o == '-f': builder = eval("%sDocBuilder0()" % a) break # Now call the real documentation functions. for o, a in opts: if o == '-m': builder.begin() documentModule0(a, builder) builder.end() sys.exit(0) elif o == '-p': builder.begin() documentPackage0(a, builder) builder.end() sys.exit(0)
55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py
def main(): """Handle command-line options and trigger corresponding action. """ opts, args = getopt.getopt(sys.argv[1:], 'hf:m:p:') # On -h print usage and exit immediately. for o, a in opts: if o == '-h': print printUsage.__doc__ #printUsage() sys.exit(0) # On -f set the DocBuilder to use or a default one. builder = DocBuilder0() for o, a in opts: if o == '-f': builder = eval("%sDocBuilder0()" % a) break # Now call the real documentation functions. for o, a in opts: if o == '-m': builder.begin() documentModule0(a, builder) builder.end() sys.exit(0) elif o == '-p': builder.begin() documentPackage0(a, builder) builder.end() sys.exit(0)
55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py
builder = DocBuilder0()
builder = GraphPdfDocBuilder0()
def main(): """Handle command-line options and trigger corresponding action. """ opts, args = getopt.getopt(sys.argv[1:], 'hf:m:p:') # On -h print usage and exit immediately. for o, a in opts: if o == '-h': print printUsage.__doc__ #printUsage() sys.exit(0) # On -f set the DocBuilder to use or a default one. builder = DocBuilder0() for o, a in opts: if o == '-f': builder = eval("%sDocBuilder0()" % a) break # Now call the real documentation functions. for o, a in opts: if o == '-m': builder.begin() documentModule0(a, builder) builder.end() sys.exit(0) elif o == '-p': builder.begin() documentPackage0(a, builder) builder.end() sys.exit(0)
55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py
'''This gets called by the template framework
"""This gets called by the template framework
def checkPageSize(self,canv,doc): '''This gets called by the template framework If canv size != template size then the canv size is set to the template size or if that's not available to the doc size. ''' #### NEVER EVER EVER COMPARE FLOATS FOR EQUALITY #RGB converting pagesizes to ints means we are accurate to one point #RGB I suggest we should be aiming a little better cp = None dp = None sp = None if canv._pagesize: cp = map(int, canv._pagesize) if self.pagesize: sp = map(int, self.pagesize) if doc.pagesize: dp = map(int, doc.pagesize) if cp!=sp: if sp: canv.setPageSize(self.pagesize) elif cp!=dp: canv.setPageSize(doc.pagesize)
0c157aa95971569a44e319bd4679ef9038dd94f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0c157aa95971569a44e319bd4679ef9038dd94f3/doctemplate.py
'''
"""
def checkPageSize(self,canv,doc): '''This gets called by the template framework If canv size != template size then the canv size is set to the template size or if that's not available to the doc size. ''' #### NEVER EVER EVER COMPARE FLOATS FOR EQUALITY #RGB converting pagesizes to ints means we are accurate to one point #RGB I suggest we should be aiming a little better cp = None dp = None sp = None if canv._pagesize: cp = map(int, canv._pagesize) if self.pagesize: sp = map(int, self.pagesize) if doc.pagesize: dp = map(int, doc.pagesize) if cp!=sp: if sp: canv.setPageSize(self.pagesize) elif cp!=dp: canv.setPageSize(doc.pagesize)
0c157aa95971569a44e319bd4679ef9038dd94f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0c157aa95971569a44e319bd4679ef9038dd94f3/doctemplate.py
'''Perform actions required at beginning of page. shouldn't normally be called directly'''
"""Perform actions required at beginning of page. shouldn't normally be called directly"""
def handle_pageBegin(self): '''Perform actions required at beginning of page. shouldn't normally be called directly''' self.page += 1 if self._debug: logger.debug("beginning page %d" % self.page) self.pageTemplate.beforeDrawPage(self.canv,self) self.pageTemplate.checkPageSize(self.canv,self) self.pageTemplate.onPage(self.canv,self) for f in self.pageTemplate.frames: f._reset() self.beforePage() #keep a count of flowables added to this page. zero indicates bad stuff self._curPageFlowableCount = 0 if hasattr(self,'_nextFrameIndex'): del self._nextFrameIndex self.frame = self.pageTemplate.frames[0] self.frame._debug = self._debug self.handle_frameBegin()
0c157aa95971569a44e319bd4679ef9038dd94f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0c157aa95971569a44e319bd4679ef9038dd94f3/doctemplate.py
""""Forward to any listeners"""
"""Forward to any listeners"""
def notify(self, kind, stuff): """"Forward to any listeners""" for l in self._indexingFlowables: l.notify(kind, stuff)
0c157aa95971569a44e319bd4679ef9038dd94f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0c157aa95971569a44e319bd4679ef9038dd94f3/doctemplate.py
fn = pjoin(dir,'_rl_accel') return getVersionFromCCode(fn),os.stat(fn)[stat.ST_MTIME]
fn = pjoin(dir,'_rl_accel.c') try: return getVersionFromCCode(fn),os.stat(fn)[stat.ST_MTIME] except: return None
def _rl_accel_dir_info(dir): import stat fn = pjoin(dir,'_rl_accel') return getVersionFromCCode(fn),os.stat(fn)[stat.ST_MTIME]
9579cfb78ea9f99f07b06674917bf59a39b28d5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9579cfb78ea9f99f07b06674917bf59a39b28d5b/setup.py
if len(_)>1: _.sort(_cmp_rl_accel_dirs) return abspath(_[0])
_ = filter(_rl_accel_dir_info,_) if len(_): _.sort(_cmp_rl_accel_dirs) return abspath(_[0])
def _find_rl_accel(): '''locate where the accelerator code lives''' _ = [] for x in [ './rl_addons/rl_accel', '../rl_addons/rl_accel', '../../rl_addons/rl_accel', './rl_accel', '../rl_accel', '../../rl_accel', './lib'] \ + glob.glob('./rl_accel-*/rl_accel')\ + glob.glob('../rl_accel-*/rl_accel') \ + glob.glob('../../rl_accel-*/rl_accel') \ : fn = pjoin(x,'_rl_accel.c') if isfile(pjoin(x,'_rl_accel.c')): _.append(x) if _: if len(_)>1: _.sort(_cmp_rl_accel_dirs) return abspath(_[0]) return None
9579cfb78ea9f99f07b06674917bf59a39b28d5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9579cfb78ea9f99f07b06674917bf59a39b28d5b/setup.py
RL_ACCEL = _find_rl_accel() LIBS = [] DATA_FILES = {} if not RL_ACCEL: EXT_MODULES = [] print '***************************************************' print '*No rl_accel code found, you can obtain it at *' print '*http://www.reportlab.org/downloads.html print '***************************************************'
_yesV=('yes','y','1','true') _yesnoV=_yesV+('no','n','0','false') tra=[_ for _ in sys.argv if _.lower().startswith('--rl_accel=')] if not tra: tra = True
def run(): RL_ACCEL = _find_rl_accel() LIBS = [] DATA_FILES = {} if not RL_ACCEL: EXT_MODULES = [] print '***************************************************' print '*No rl_accel code found, you can obtain it at *' print '*http://www.reportlab.org/downloads.html#_rl_accel*' print '***************************************************' else: fn = pjoin(RL_ACCEL,'lib','hyphen.mashed') if isfile(fn): DATA_FILES[pjoin(package_path, 'lib')] = [fn] EXT_MODULES = [ Extension( '_rl_accel', [pjoin(RL_ACCEL,'_rl_accel.c')], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'sgmlop', [pjoin(RL_ACCEL,'sgmlop.c')], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'pyHnj', [pjoin(RL_ACCEL,'pyHnjmodule.c'), pjoin(RL_ACCEL,'hyphen.c'), pjoin(RL_ACCEL,'hnjalloc.c')], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), ] for fn in _FILES: fn = os.sep.join(fn.split('/')) if isfile(fn): tn = dirname(fn) tn = tn and pjoin(package_path,tn) or package_path DATA_FILES.setdefault(tn,[]).append(fn) setup( name="Reportlab", version=get_version(), license="BSD license (see license.txt for details), Copyright (c) 2000-2003, ReportLab Inc.", description="The Reportlab Toolkit", long_description="""The ReportLab Toolkit.
9579cfb78ea9f99f07b06674917bf59a39b28d5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9579cfb78ea9f99f07b06674917bf59a39b28d5b/setup.py
fn = pjoin(RL_ACCEL,'lib','hyphen.mashed') if isfile(fn): DATA_FILES[pjoin(package_path, 'lib')] = [fn] EXT_MODULES = [ Extension( '_rl_accel', [pjoin(RL_ACCEL,'_rl_accel.c')],
map(sys.argv.remove,tra) tra=tra[-1].split('=',1)[1].lower() assert tra in _yesnoV, 'bad argument --rl_accel='+tra tra = tra in _yesV if tra: RL_ACCEL = _find_rl_accel() LIBS = [] DATA_FILES = {} if not RL_ACCEL: EXT_MODULES = [] print '***************************************************' print '*No rl_accel code found, you can obtain it at *' print '*http://www.reportlab.org/downloads.html print '***************************************************' else: print ' print ' print ' print ' fn = pjoin(RL_ACCEL,'lib','hyphen.mashed') if isfile(fn): DATA_FILES[pjoin(package_path, 'lib')] = [fn] EXT_MODULES = [ Extension( '_rl_accel', [pjoin(RL_ACCEL,'_rl_accel.c')], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, ), Extension( 'sgmlop', [pjoin(RL_ACCEL,'sgmlop.c')],
def run(): RL_ACCEL = _find_rl_accel() LIBS = [] DATA_FILES = {} if not RL_ACCEL: EXT_MODULES = [] print '***************************************************' print '*No rl_accel code found, you can obtain it at *' print '*http://www.reportlab.org/downloads.html#_rl_accel*' print '***************************************************' else: fn = pjoin(RL_ACCEL,'lib','hyphen.mashed') if isfile(fn): DATA_FILES[pjoin(package_path, 'lib')] = [fn] EXT_MODULES = [ Extension( '_rl_accel', [pjoin(RL_ACCEL,'_rl_accel.c')], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'sgmlop', [pjoin(RL_ACCEL,'sgmlop.c')], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'pyHnj', [pjoin(RL_ACCEL,'pyHnjmodule.c'), pjoin(RL_ACCEL,'hyphen.c'), pjoin(RL_ACCEL,'hnjalloc.c')], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), ] for fn in _FILES: fn = os.sep.join(fn.split('/')) if isfile(fn): tn = dirname(fn) tn = tn and pjoin(package_path,tn) or package_path DATA_FILES.setdefault(tn,[]).append(fn) setup( name="Reportlab", version=get_version(), license="BSD license (see license.txt for details), Copyright (c) 2000-2003, ReportLab Inc.", description="The Reportlab Toolkit", long_description="""The ReportLab Toolkit.
9579cfb78ea9f99f07b06674917bf59a39b28d5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9579cfb78ea9f99f07b06674917bf59a39b28d5b/setup.py
define_macros=[], library_dirs=[], libraries=LIBS, ), Extension( 'sgmlop', [pjoin(RL_ACCEL,'sgmlop.c')], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, ), Extension( 'pyHnj', [pjoin(RL_ACCEL,'pyHnjmodule.c'), pjoin(RL_ACCEL,'hyphen.c'), pjoin(RL_ACCEL,'hnjalloc.c')], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, ), ]
define_macros=[], library_dirs=[], libraries=LIBS, ), Extension( 'pyHnj', [pjoin(RL_ACCEL,'pyHnjmodule.c'), pjoin(RL_ACCEL,'hyphen.c'), pjoin(RL_ACCEL,'hnjalloc.c')], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, ), ]
def run(): RL_ACCEL = _find_rl_accel() LIBS = [] DATA_FILES = {} if not RL_ACCEL: EXT_MODULES = [] print '***************************************************' print '*No rl_accel code found, you can obtain it at *' print '*http://www.reportlab.org/downloads.html#_rl_accel*' print '***************************************************' else: fn = pjoin(RL_ACCEL,'lib','hyphen.mashed') if isfile(fn): DATA_FILES[pjoin(package_path, 'lib')] = [fn] EXT_MODULES = [ Extension( '_rl_accel', [pjoin(RL_ACCEL,'_rl_accel.c')], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'sgmlop', [pjoin(RL_ACCEL,'sgmlop.c')], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'pyHnj', [pjoin(RL_ACCEL,'pyHnjmodule.c'), pjoin(RL_ACCEL,'hyphen.c'), pjoin(RL_ACCEL,'hnjalloc.c')], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), ] for fn in _FILES: fn = os.sep.join(fn.split('/')) if isfile(fn): tn = dirname(fn) tn = tn and pjoin(package_path,tn) or package_path DATA_FILES.setdefault(tn,[]).append(fn) setup( name="Reportlab", version=get_version(), license="BSD license (see license.txt for details), Copyright (c) 2000-2003, ReportLab Inc.", description="The Reportlab Toolkit", long_description="""The ReportLab Toolkit.
9579cfb78ea9f99f07b06674917bf59a39b28d5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9579cfb78ea9f99f07b06674917bf59a39b28d5b/setup.py
if self._atTop: s = flowable.getSpaceBefore()
if not self._atTop: s = flowable.getSpaceBefore()
def _add(self, flowable, canv, trySplit=0): """ Draws the flowable at the current position. Returns 1 if successful, 0 if it would not fit. Raises a LayoutError if the object is too wide, or if it is too high for a totally empty frame, to avoid infinite loops""" y = self._y p = self._y1p s = 0 if self._atTop: s = flowable.getSpaceBefore() h = y - p - s if h>0: flowable.canv = canv #so they can use stringWidth etc w, h = flowable.wrap(self._aW, h) del flowable.canv else: return 0
2ed1c3bb46755c4ddda589067b71fe4e3f26ee06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2ed1c3bb46755c4ddda589067b71fe4e3f26ee06/frames.py
c.bookmarkHorizontalAbsolute0(nameTag, pos)
c.bookmarkHorizontalAbsolute(nameTag, pos)
def addIdent(self, t): "Add an identifier." o = self.options # Make base font bold. fam, b, i = fonts.ps2tt(o.fontName) ps = fonts.tt2ps(fam, 1, i) font = (ps, o.fontSize) self.setFillColorAndFont(o.identCol, font) self.putText(t) # Bookmark certain identifiers (class and function names). if not o.noOutline and not o.multiPage: item = self.itemFound if item: # Add line height to current vert. position. pos = self.text.getY() + o.fontSize nameTag = "p%sy%s" % (self.pageNum, pos) c = self.canvas i = self.startPositions.index(self.startPos) c.bookmarkHorizontalAbsolute0(nameTag, pos) c.addOutlineEntry0('%s %s' % (item, t), nameTag, i)
3af4ab144ce71602a6afba90cd8a295b9caad23b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3af4ab144ce71602a6afba90cd8a295b9caad23b/py2pdf.py
raise "LayoutError", "Flowable (%sx%s points) too wide for frame (%sx* points)." % (dW,t,w)
raise "LayoutError", "Flowable (%sx%s points) too wide for cell (%sx* points)." % (dW,t,w)
def _calc(self): if hasattr(self,'_width'): return
cf311d761493b28d21997385815cf4c3b1178a65 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/cf311d761493b28d21997385815cf4c3b1178a65/tables.py
self._canvas.ellipse(x1,y1,x2,y2,fill=1)
self._canvas.ellipse(x1,y1,x2,y2,fill=self._fill,stroke=self._stroke)
def drawEllipse(self, ellipse): #need to convert to pdfgen's bounding box representation x1 = ellipse.cx - ellipse.rx x2 = ellipse.cx + ellipse.rx y1 = ellipse.cy - ellipse.ry y2 = ellipse.cy + ellipse.ry self._canvas.ellipse(x1,y1,x2,y2,fill=1)
d1883bba63b6b6ed86e1fc66a30ac245bd7996a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d1883bba63b6b6ed86e1fc66a30ac245bd7996a2/renderPDF.py
def __init__(self, name): self.name = name self.graphics = []
c07fba1c56a17158d166b9143efa2d996a00f7fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c07fba1c56a17158d166b9143efa2d996a00f7fc/pythonpoint.py
def drawOn(self, canv): for graphic in self.graphics:
c07fba1c56a17158d166b9143efa2d996a00f7fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c07fba1c56a17158d166b9143efa2d996a00f7fc/pythonpoint.py
internalname = canv._doc.hasForm(name) canv.saveState()
if definedForms.has_key(name): internalname = 1 else: internalname = None definedForms[name] = 1
def drawOn(self, canv): for graphic in self.graphics:
c07fba1c56a17158d166b9143efa2d996a00f7fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c07fba1c56a17158d166b9143efa2d996a00f7fc/pythonpoint.py
canv.restoreState()
def drawOn(self, canv): for graphic in self.graphics:
c07fba1c56a17158d166b9143efa2d996a00f7fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c07fba1c56a17158d166b9143efa2d996a00f7fc/pythonpoint.py
if self._text == None: self._text = ''
_text = self._text self._text = _text or ''
def draw(self): if self._text == None: self._text = '' # hack, but it works for now... self.computeSize() g = Group() g.translate(self.x + self.dx, self.y + self.dy) g.rotate(self.angle)
5a50494ad1a723e2888ffb1317c78627ddb4d483 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/5a50494ad1a723e2888ffb1317c78627ddb4d483/textlabels.py
width x2,y2 +---------------------------------+ | l top padding r | h | e +-------------------------+ i | e | f | | g | i | t | | h | g | | | t | h | p | | | t | a | | p | | d | | a | | | | d | | +-------------------------+ | | bottom padding | +---------------------------------+ (x1,y1)
width x2,y2 +---------------------------------+ | l top padding r | h | e +-------------------------+ i | e | f | | g | i | t | | h | g | | | t | h | p | | | t | a | | p | | d | | a | | | | d | | +-------------------------+ | | bottom padding | +---------------------------------+ (x1,y1)
def draw(self): exec self.command in globals(), {'canvas':self.canv}
517f0efaa04d678987da40d393b36356a93f71d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/517f0efaa04d678987da40d393b36356a93f71d0/layout.py
def _add(self, flowable, canv, trySplit=0): """ Draws the flowable at the current position. Returns 1 if successful, 0 if it would not fit. Raises a LayoutError if the object is too wide, or if it is too high for a totally empty frame, to avoid infinite loops""" y = self.y p = self.y1 + self.bottomPadding w, h = flowable.wrap(self.width, y - p )
517f0efaa04d678987da40d393b36356a93f71d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/517f0efaa04d678987da40d393b36356a93f71d0/layout.py
def _add(self, flowable, canv, trySplit=0): """ Draws the flowable at the current position. Returns 1 if successful, 0 if it would not fit. Raises a LayoutError if the object is too wide, or if it is too high for a totally empty frame, to avoid infinite loops""" y = self.y p = self.y1 + self.bottomPadding w, h = flowable.wrap(self.width, y - p )
517f0efaa04d678987da40d393b36356a93f71d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/517f0efaa04d678987da40d393b36356a93f71d0/layout.py
def _doNothing(flowables, doc): "Dummy callback for onFirstPage and onNewPage"
def _doNothing(canvas, doc): "Dummy callback for onPage"
def _doNothing(flowables, doc): "Dummy callback for onFirstPage and onNewPage" pass
517f0efaa04d678987da40d393b36356a93f71d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/517f0efaa04d678987da40d393b36356a93f71d0/layout.py
def run(): objects_to_draw = [] from reportlab.lib.styles import ParagraphStyle from reportlab.platypus.paragraph import Paragraph #need a style normal = ParagraphStyle('normal') normal.firstLineIndent = 18 normal.spaceBefore = 6 import random for i in range(15): height = 0.5 + (2*random.random()) box = XBox(6 * inch, height * inch, 'Box Number %d' % i) objects_to_draw.append(box) para = Paragraph(randomText(), normal) objects_to_draw.append(para) doc = SimpleFlowDocument('platypus.pdf',DEFAULT_PAGE_SIZE) doc.onFirstPage = myFirstPage doc.onNewPage = myLaterPages doc.build(objects_to_draw)
517f0efaa04d678987da40d393b36356a93f71d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/517f0efaa04d678987da40d393b36356a93f71d0/layout.py
def run(): objects_to_draw = [] from reportlab.lib.styles import ParagraphStyle from reportlab.platypus.paragraph import Paragraph #need a style normal = ParagraphStyle('normal') normal.firstLineIndent = 18 normal.spaceBefore = 6 import random for i in range(15): height = 0.5 + (2*random.random()) box = XBox(6 * inch, height * inch, 'Box Number %d' % i) objects_to_draw.append(box) para = Paragraph(randomText(), normal) objects_to_draw.append(para) doc = SimpleFlowDocument('platypus.pdf',DEFAULT_PAGE_SIZE) doc.onFirstPage = myFirstPage doc.onNewPage = myLaterPages doc.build(objects_to_draw)
517f0efaa04d678987da40d393b36356a93f71d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/517f0efaa04d678987da40d393b36356a93f71d0/layout.py
self.canv.drawCentredString(
try: self.canv.drawCentredString(
def drawChars(self, charList): """Fills boxes in order. None means skip a box. Empty boxes at end get filled with gray""" extraNeeded = (self.rows * self.charsPerRow - len(charList)) for i in range(extraNeeded): charList.append(None) #charList.extend([None] * extraNeeded) row = 0 col = 0 self.canv.setFont(self.fontName, self.boxSize * 0.75) for ch in charList: # may be 2 bytes or 1 if ch is None: self.canv.setFillGray(0.9) self.canv.rect((1+col) * self.boxSize, (self.rows - row - 1) * self.boxSize, self.boxSize, self.boxSize, stroke=0, fill=1) self.canv.setFillGray(0.0) else: self.canv.drawCentredString( (col+1.5) * self.boxSize, (self.rows - row - 0.875) * self.boxSize, ch ) col = col + 1 if col == self.charsPerRow: row = row + 1 col = 0
bbc5f626c757f0a667deb3cef8cebff1eb50eefa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bbc5f626c757f0a667deb3cef8cebff1eb50eefa/codecharts.py
ch
ch,
def drawChars(self, charList): """Fills boxes in order. None means skip a box. Empty boxes at end get filled with gray""" extraNeeded = (self.rows * self.charsPerRow - len(charList)) for i in range(extraNeeded): charList.append(None) #charList.extend([None] * extraNeeded) row = 0 col = 0 self.canv.setFont(self.fontName, self.boxSize * 0.75) for ch in charList: # may be 2 bytes or 1 if ch is None: self.canv.setFillGray(0.9) self.canv.rect((1+col) * self.boxSize, (self.rows - row - 1) * self.boxSize, self.boxSize, self.boxSize, stroke=0, fill=1) self.canv.setFillGray(0.0) else: self.canv.drawCentredString( (col+1.5) * self.boxSize, (self.rows - row - 0.875) * self.boxSize, ch ) col = col + 1 if col == self.charsPerRow: row = row + 1 col = 0
bbc5f626c757f0a667deb3cef8cebff1eb50eefa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bbc5f626c757f0a667deb3cef8cebff1eb50eefa/codecharts.py
return makeSuiteForClasses(RlAccelTestCase) except ImportError: return None
Klass = RlAccelTestCase except: class Klass(unittest.TestCase): pass return makeSuiteForClasses(Klass)
def makeSuite(): # only run the tests if _rl_accel is present try: import _rl_accel return makeSuiteForClasses(RlAccelTestCase) except ImportError: return None
75397dff48c9354f932b9fa26f36d352dd447296 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/75397dff48c9354f932b9fa26f36d352dd447296/test_rl_accel.py
unittest.TextTestRunner().run(makeSuite())
unittest.TextTestRunner().run(makeSuite())
def makeSuite(): # only run the tests if _rl_accel is present try: import _rl_accel return makeSuiteForClasses(RlAccelTestCase) except ImportError: return None
75397dff48c9354f932b9fa26f36d352dd447296 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/75397dff48c9354f932b9fa26f36d352dd447296/test_rl_accel.py
def drawInlineImage(self, canvas): #, image, x,y, width=None,height=None): """Draw an Image into the specified rectangle. If width and height are omitted, they are calculated from the image size. Also allow file names as well as images. This allows a caching mechanism"""
5fb9251a48f66d5629241f88f93f958a3406d66c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/5fb9251a48f66d5629241f88f93f958a3406d66c/pdfimages.py
def drawInlineImage(self, canvas): #, image, x,y, width=None,height=None): """Draw an Image into the specified rectangle. If width and height are omitted, they are calculated from the image size. Also allow file names as well as images. This allows a caching mechanism"""
5fb9251a48f66d5629241f88f93f958a3406d66c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/5fb9251a48f66d5629241f88f93f958a3406d66c/pdfimages.py
radius = self._radius = self._cx-self.x self._radiusx = radiusx = radius self._radiusy = radiusy = (1.0 - self.perspective/100.0)*radius
radiusx = radiusy = self._cx-self.x if self.xradius: radiusx = self.xradius if self.yradius: radiusy = self.yradius self._radiusx = radiusx self._radiusy = (1.0 - self.perspective/100.0)*radiusy
def draw(self): slices = self.slices _3d_angle = self.angle_3d _3dva = self._3dva = _360(_3d_angle+90) a0 = _2rad(_3dva) self._xdepth_3d = cos(a0)*self.depth_3d self._ydepth_3d = sin(a0)*self.depth_3d self._cx = self.x+self.width/2.0 self._cy = self.y+(self.height - self._ydepth_3d)/2.0 radius = self._radius = self._cx-self.x self._radiusx = radiusx = radius self._radiusy = radiusy = (1.0 - self.perspective/100.0)*radius data = self.normalizeData() sum = self._sum
937d4a06deb5cce7c0c95e40de74ecdfdab0a6d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/937d4a06deb5cce7c0c95e40de74ecdfdab0a6d2/piecharts.py
print "Can't find cvs anywhere on the path"
def cvs_checkout(d): os.chdir(d) recursive_rmdir(cvsdir) cvs = find_exe('cvs') if cvs is None: print "Can't find cvs anywhere on the path" os.exit(1) if release: os.environ['CVSROOT']=':pserver:%s@cvs:/cvsroot/reportlab' % USER do_exec(cvs+(' co -r %s reportlab'%release), 'the download phase') else: os.environ['CVSROOT']=':pserver:%s@cvs:/cvsroot/reportlab' % USER do_exec(cvs+' co reportlab', 'the download phase')
9428867e35d04f48f018e2559da3c19fbeb25b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9428867e35d04f48f018e2559da3c19fbeb25b24/daily.py
os.environ['CVSROOT']=':pserver:%s@cvs:/cvsroot/reportlab' % USER do_exec(cvs+(' co -r %s reportlab'%release), 'the download phase')
do_exec(cvs+(' export -r %s reportlab'%release), 'the export phase')
def cvs_checkout(d): os.chdir(d) recursive_rmdir(cvsdir) cvs = find_exe('cvs') if cvs is None: print "Can't find cvs anywhere on the path" os.exit(1) if release: os.environ['CVSROOT']=':pserver:%s@cvs:/cvsroot/reportlab' % USER do_exec(cvs+(' co -r %s reportlab'%release), 'the download phase') else: os.environ['CVSROOT']=':pserver:%s@cvs:/cvsroot/reportlab' % USER do_exec(cvs+' co reportlab', 'the download phase')
9428867e35d04f48f018e2559da3c19fbeb25b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9428867e35d04f48f018e2559da3c19fbeb25b24/daily.py
os.environ['CVSROOT']=':pserver:%s@cvs:/cvsroot/reportlab' % USER do_exec(cvs+' co reportlab', 'the download phase')
do_exec(cvs+' co reportlab', 'the checkout phase')
def cvs_checkout(d): os.chdir(d) recursive_rmdir(cvsdir) cvs = find_exe('cvs') if cvs is None: print "Can't find cvs anywhere on the path" os.exit(1) if release: os.environ['CVSROOT']=':pserver:%s@cvs:/cvsroot/reportlab' % USER do_exec(cvs+(' co -r %s reportlab'%release), 'the download phase') else: os.environ['CVSROOT']=':pserver:%s@cvs:/cvsroot/reportlab' % USER do_exec(cvs+' co reportlab', 'the download phase')
9428867e35d04f48f018e2559da3c19fbeb25b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9428867e35d04f48f018e2559da3c19fbeb25b24/daily.py
def find_src_files(L,d,N): if string.upper(os.path.basename(d))=='CVS': return for n in N: fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn)
def find_src_files(L,d,N): if string.upper(os.path.basename(d))=='CVS': return #ignore all CVS for n in N: fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn)
9428867e35d04f48f018e2559da3c19fbeb25b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9428867e35d04f48f018e2559da3c19fbeb25b24/daily.py
src_files = [] os.path.walk(projdir,find_src_files,src_files)
def find_src_files(L,d,N): if string.upper(os.path.basename(d))=='CVS': return #ignore all CVS for n in N: fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn)
9428867e35d04f48f018e2559da3c19fbeb25b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9428867e35d04f48f018e2559da3c19fbeb25b24/daily.py
b = "%s" % release
b = release
def find_src_files(L,d,N): if string.upper(os.path.basename(d))=='CVS': return #ignore all CVS for n in N: fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn)
9428867e35d04f48f018e2559da3c19fbeb25b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9428867e35d04f48f018e2559da3c19fbeb25b24/daily.py
safe_remove(zipfile) safe_remove(tarfile) if src_files==[]: return src_files = string.join(src_files)
def find_src_files(L,d,N): if string.upper(os.path.basename(d))=='CVS': return #ignore all CVS for n in N: fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn)
9428867e35d04f48f018e2559da3c19fbeb25b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9428867e35d04f48f018e2559da3c19fbeb25b24/daily.py
do_exec('%s czvf %s %s' % (tar, tarfile, src_files), 'tar creation')
if tar is not None: safe_remove(tarfile) do_exec('%s czvf %s %s' % (tar, tarfile, projdir), 'tar creation')
def find_src_files(L,d,N): if string.upper(os.path.basename(d))=='CVS': return #ignore all CVS for n in N: fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn)
9428867e35d04f48f018e2559da3c19fbeb25b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9428867e35d04f48f018e2559da3c19fbeb25b24/daily.py
do_exec('%s -u %s %s' % (zip, zipfile, src_files), 'zip creation')
if zip is not None: safe_remove(zipfile) do_exec('%s -ur %s %s' % (zip, zipfile, projdir), 'zip creation')
def find_src_files(L,d,N): if string.upper(os.path.basename(d))=='CVS': return #ignore all CVS for n in N: fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn)
9428867e35d04f48f018e2559da3c19fbeb25b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9428867e35d04f48f018e2559da3c19fbeb25b24/daily.py
data = self.data m, M = None, None for row in data: for val in row: if val is None: val = 0 if val is None: val = 0 if val < m: m = val if val > M: M = val return m, M
data = map(lambda x: map(lambda x: x is not None and x or 0,x), self.data) return min(min(data)), max(max(data))
def _findMinMaxValues(self): "Find the minimum and maximum value of the data we have."
e29c3561dda6dff8e19c7869849618abce1bc863 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/e29c3561dda6dff8e19c7869849618abce1bc863/barcharts.py
scale = self.valueAxis.scale vm, vM = self.valueAxis.valueMin, self.valueAxis.valueMax if None in (vm, vM): y = scale(self._findMinMaxValues()[0]) elif vm <= 0 <= vM: y = scale(0) elif 0 < vm: y = scale(vm) elif vM < 0: y = scale(vM)
def calcBarPositions(self): """Works out where they go. default vertical.
e29c3561dda6dff8e19c7869849618abce1bc863 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/e29c3561dda6dff8e19c7869849618abce1bc863/barcharts.py
return string.join(map(lambda x : "%0x" % ord(x), md5.md5(s).digest()), '')
return string.join(map(lambda x : "%02x" % ord(x), md5.md5(s).digest()), '')
def _digester(s): return string.join(map(lambda x : "%0x" % ord(x), md5.md5(s).digest()), '')
33e5ec853fa7a38db78eff1f31319546b9516c37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/33e5ec853fa7a38db78eff1f31319546b9516c37/canvas.py
if d not in sys.path: sys.path.insert(0,d)
def find_test_files(L,d,N): n = os.path.basename(d) if n!='test' : return for n in filter(lambda n: n[-3:]=='.py',N): fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn)
d144de574b55b6230e50ff50376a0264613d6725 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d144de574b55b6230e50ff50376a0264613d6725/runtests.py
os.chdir(os.path.dirname(fn))
def find_test_files(L,d,N): n = os.path.basename(d) if n!='test' : return for n in filter(lambda n: n[-3:]=='.py',N): fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn)
d144de574b55b6230e50ff50376a0264613d6725 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d144de574b55b6230e50ff50376a0264613d6725/runtests.py
z.run(execfile,(fn,_globals.copy()))
z.run(execfile,(fn,g))
def find_test_files(L,d,N): n = os.path.basename(d) if n!='test' : return for n in filter(lambda n: n[-3:]=='.py',N): fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn)
d144de574b55b6230e50ff50376a0264613d6725 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d144de574b55b6230e50ff50376a0264613d6725/runtests.py
execfile(fn,_globals.copy())
execfile(fn,g)
def find_test_files(L,d,N): n = os.path.basename(d) if n!='test' : return for n in filter(lambda n: n[-3:]=='.py',N): fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn)
d144de574b55b6230e50ff50376a0264613d6725 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d144de574b55b6230e50ff50376a0264613d6725/runtests.py
self._strokeColorRGB = rgb
self._fillColorRGB = rgb
def setFillColor(self, aColor): """Takes a color object, allowing colors to be referred to by name""" if type(aColor) == ColorType: rgb = (aColor.red, aColor.green, aColor.blue) self._strokeColorRGB = rgb self._code.append('%0.2f %0.2f %0.2f rg' % rgb ) elif type(aColor) in _SeqTypes: l = len(aColor) if l==3: self._strokeColorRGB = aColor self._code.append('%0.2f %0.2f %0.2f rg' % aColor ) elif l==4: self.setFillColorCMYK(self, aColor[0], aColor[1], aColor[2], aColor[3]) else: raise 'Unknown color', str(aColor) else: raise 'Unknown color', str(aColor)
52621e679eaa5f8b99038efba297b834175fbeba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/52621e679eaa5f8b99038efba297b834175fbeba/canvas.py
self._strokeColorRGB = aColor
self._fillColorRGB = aColor
def setFillColor(self, aColor): """Takes a color object, allowing colors to be referred to by name""" if type(aColor) == ColorType: rgb = (aColor.red, aColor.green, aColor.blue) self._strokeColorRGB = rgb self._code.append('%0.2f %0.2f %0.2f rg' % rgb ) elif type(aColor) in _SeqTypes: l = len(aColor) if l==3: self._strokeColorRGB = aColor self._code.append('%0.2f %0.2f %0.2f rg' % aColor ) elif l==4: self.setFillColorCMYK(self, aColor[0], aColor[1], aColor[2], aColor[3]) else: raise 'Unknown color', str(aColor) else: raise 'Unknown color', str(aColor)
52621e679eaa5f8b99038efba297b834175fbeba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/52621e679eaa5f8b99038efba297b834175fbeba/canvas.py
R = String(upperleftx, upperlefty, text) R.textAnchor = anchor if self.color is not None: R.fillColor = self.color elif self.defaultColor is not None: R.fillColor = self.defaultColor if self.size is not None: R.fontSize = self.size if self.font is not None: R.fontName = self.font return [R]
textlist = string.split(text, "\n") result = [] for text1 in textlist: R = String(upperleftx, upperlefty, text1) upperlefty = upperlefty-self.size*1.1 R.textAnchor = anchor if self.color is not None: R.fillColor = self.color elif self.defaultColor is not None: R.fillColor = self.defaultColor if self.size is not None: R.fontSize = self.size if self.font is not None: R.fontName = self.font result.append(R) return result
def materialize(self, text, length, xyorigin=(0,0), lengthoffset=0, widthoffset=0): "generate a drawables based on this template, with help of 'derived' parameters" # for purposes of generality return a *sequence* of drawables (x,y) = xyorigin orientation = self.orientation # semantics is flipped compared to bar groups if orientation == "horizontal": lowerleftx = x+widthoffset lowerlefty = y+lengthoffset upperleftx = lowerleftx upperlefty = lowerlefty+length anchor = "middle" if length<0: upperlefty = upperlefty-self.extraOffset-self.size else: upperlefty = upperlefty+self.extraOffset elif orientation == "vertical": lowerleftx = x+lengthoffset lowerlefty = y+widthoffset upperleftx = lowerleftx+length upperlefty = lowerlefty if length<0: upperleftx = upperleftx-self.extraOffset anchor = "end" else: upperleftx = upperleftx+self.extraOffset anchor = "start" else: raise ValueError, "bad orientation %s" % orientation R = String(upperleftx, upperlefty, text) R.textAnchor = anchor if self.color is not None: R.fillColor = self.color elif self.defaultColor is not None: R.fillColor = self.defaultColor if self.size is not None: R.fontSize = self.size if self.font is not None: R.fontName = self.font return [R]
6d786e5e13d81898d3ab5797265018f2e864ef07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d786e5e13d81898d3ab5797265018f2e864ef07/barchart.py
print "factor is", factor
def draw(self): orientation = self.orientation # this could be done cleverly using the other widgets, but what the .... x,y = self.x, self.y fmt = self.labelFormat (delta, startpoint) = scaleParameters(self.minimum, self.maximum, self.nLabels) G = Group() # orientation independent data (direct values for vertical case, convert for horizontal case linedata = [] textdata = [] # the main axis linedata.append( (0, 0, 0, self.length) ) # the cross lines and labels lineposition = startpoint - self.minimum factor = self.factor() print "factor is", factor while lineposition+self.minimum<self.maximum: text = string.strip(fmt % (lineposition+self.minimum)) clineposition = factor * lineposition print "lineposition, clineposition", lineposition, clineposition linedata.append( (0, clineposition, self.width, clineposition) ) textdata.append( (0, clineposition, text) ) lineposition = lineposition + delta print "done with lines" if orientation=="vertical": for (x1, y1, x2, y2) in linedata: G.add(Line(x+x1, y+y1, x+x2, y+y2)) for (x1, y1, t) in textdata: S = String(x+x1-self.extraOffset, y+y1, t) S.textAnchor = "end" G.add(S) elif orientation=="horizontal": for (y1, x1, y2, x2) in linedata: G.add(Line(x+x1, y+y1, x+x2, y+y2)) for (y1, x1, t) in textdata: S = String(x+x1, y+y1-self.extraOffset, t) S.textAnchor = "middle" G.add(S) else: raise ValueError, "bad orientation " + repr(orientation) return G
6d786e5e13d81898d3ab5797265018f2e864ef07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d786e5e13d81898d3ab5797265018f2e864ef07/barchart.py
print "lineposition, clineposition", lineposition, clineposition
def draw(self): orientation = self.orientation # this could be done cleverly using the other widgets, but what the .... x,y = self.x, self.y fmt = self.labelFormat (delta, startpoint) = scaleParameters(self.minimum, self.maximum, self.nLabels) G = Group() # orientation independent data (direct values for vertical case, convert for horizontal case linedata = [] textdata = [] # the main axis linedata.append( (0, 0, 0, self.length) ) # the cross lines and labels lineposition = startpoint - self.minimum factor = self.factor() print "factor is", factor while lineposition+self.minimum<self.maximum: text = string.strip(fmt % (lineposition+self.minimum)) clineposition = factor * lineposition print "lineposition, clineposition", lineposition, clineposition linedata.append( (0, clineposition, self.width, clineposition) ) textdata.append( (0, clineposition, text) ) lineposition = lineposition + delta print "done with lines" if orientation=="vertical": for (x1, y1, x2, y2) in linedata: G.add(Line(x+x1, y+y1, x+x2, y+y2)) for (x1, y1, t) in textdata: S = String(x+x1-self.extraOffset, y+y1, t) S.textAnchor = "end" G.add(S) elif orientation=="horizontal": for (y1, x1, y2, x2) in linedata: G.add(Line(x+x1, y+y1, x+x2, y+y2)) for (y1, x1, t) in textdata: S = String(x+x1, y+y1-self.extraOffset, t) S.textAnchor = "middle" G.add(S) else: raise ValueError, "bad orientation " + repr(orientation) return G
6d786e5e13d81898d3ab5797265018f2e864ef07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d786e5e13d81898d3ab5797265018f2e864ef07/barchart.py
print "done with lines"
def draw(self): orientation = self.orientation # this could be done cleverly using the other widgets, but what the .... x,y = self.x, self.y fmt = self.labelFormat (delta, startpoint) = scaleParameters(self.minimum, self.maximum, self.nLabels) G = Group() # orientation independent data (direct values for vertical case, convert for horizontal case linedata = [] textdata = [] # the main axis linedata.append( (0, 0, 0, self.length) ) # the cross lines and labels lineposition = startpoint - self.minimum factor = self.factor() print "factor is", factor while lineposition+self.minimum<self.maximum: text = string.strip(fmt % (lineposition+self.minimum)) clineposition = factor * lineposition print "lineposition, clineposition", lineposition, clineposition linedata.append( (0, clineposition, self.width, clineposition) ) textdata.append( (0, clineposition, text) ) lineposition = lineposition + delta print "done with lines" if orientation=="vertical": for (x1, y1, x2, y2) in linedata: G.add(Line(x+x1, y+y1, x+x2, y+y2)) for (x1, y1, t) in textdata: S = String(x+x1-self.extraOffset, y+y1, t) S.textAnchor = "end" G.add(S) elif orientation=="horizontal": for (y1, x1, y2, x2) in linedata: G.add(Line(x+x1, y+y1, x+x2, y+y2)) for (y1, x1, t) in textdata: S = String(x+x1, y+y1-self.extraOffset, t) S.textAnchor = "middle" G.add(S) else: raise ValueError, "bad orientation " + repr(orientation) return G
6d786e5e13d81898d3ab5797265018f2e864ef07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d786e5e13d81898d3ab5797265018f2e864ef07/barchart.py
def draw(self): self.valueAxis.configure(self.data) self.valueAxis.setPosition(self.x, self.y, self.height) xAxisCrossesAt = self.valueAxis.scale(0) if ((xAxisCrossesAt > self.y + self.height) or (xAxisCrossesAt < self.y)): self.categoryAxis.setPosition(self.x, self.y, self.width) else: self.categoryAxis.setPosition(self.x, xAxisCrossesAt, self.width) self.categoryAxis.configure(self.data) self.calcBarPositions()
def makeBackground(self):
def draw(self): self.valueAxis.configure(self.data) self.valueAxis.setPosition(self.x, self.y, self.height)
0df415dcb939a2513a321f75fdf136d8d6dd4fac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0df415dcb939a2513a321f75fdf136d8d6dd4fac/barcharts.py
def draw(self): self.valueAxis.configure(self.data) self.valueAxis.setPosition(self.x, self.y, self.height)
0df415dcb939a2513a321f75fdf136d8d6dd4fac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0df415dcb939a2513a321f75fdf136d8d6dd4fac/barcharts.py
g.add(self.categoryAxis) g.add(self.valueAxis)
return g def makeBars(self): g = Group()
def draw(self): self.valueAxis.configure(self.data) self.valueAxis.setPosition(self.x, self.y, self.height)
0df415dcb939a2513a321f75fdf136d8d6dd4fac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0df415dcb939a2513a321f75fdf136d8d6dd4fac/barcharts.py
def draw(self): self.valueAxis.configure(self.data) self.valueAxis.setPosition(self.x, self.y, self.width) yAxisCrossesAt = self.valueAxis.scale(0) if ((yAxisCrossesAt > self.x + self.width) or (yAxisCrossesAt < self.x)): self.categoryAxis.setPosition(self.x, self.y, self.height) else: self.categoryAxis.setPosition(yAxisCrossesAt, self.y, self.height) self.categoryAxis.configure(self.data) self.calcBarPositions()
def makeBackground(self):
def draw(self): self.valueAxis.configure(self.data) self.valueAxis.setPosition(self.x, self.y, self.width)
0df415dcb939a2513a321f75fdf136d8d6dd4fac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0df415dcb939a2513a321f75fdf136d8d6dd4fac/barcharts.py
def draw(self): self.valueAxis.configure(self.data) self.valueAxis.setPosition(self.x, self.y, self.width)
0df415dcb939a2513a321f75fdf136d8d6dd4fac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0df415dcb939a2513a321f75fdf136d8d6dd4fac/barcharts.py
g.add(self.categoryAxis) g.add(self.valueAxis)
return g def makeBars(self): g = Group()
def draw(self): self.valueAxis.configure(self.data) self.valueAxis.setPosition(self.x, self.y, self.width)
0df415dcb939a2513a321f75fdf136d8d6dd4fac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0df415dcb939a2513a321f75fdf136d8d6dd4fac/barcharts.py
rectList2 = [] for elem in rectList: if elem == (0,0,0,0): print 'got an empty one' if elem is not None: rectList2.append(elem) xMin, yMin, xMax, yMax = rectList2[0] for (x1, y1, x2, y2) in rectList2[1:]:
L = filter(lambda x: x is not None, rectList) if not L: return None xMin, yMin, xMax, yMax = L[0] for (x1, y1, x2, y2) in L[1:]:
def getRectsBounds(rectList): # filter out any None objects, e.g. empty groups rectList2 = [] for elem in rectList: if elem == (0,0,0,0): print 'got an empty one' if elem is not None: rectList2.append(elem) xMin, yMin, xMax, yMax = rectList2[0] for (x1, y1, x2, y2) in rectList2[1:]: if x1 < xMin: xMin = x1 if x2 > xMax: xMax = x2 if y1 < yMin: yMin = y1 if y2 > yMax: yMax = y2 return (xMin, yMin, xMax, yMax)
c829389599340aff92b329d736591e51c4a24a3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c829389599340aff92b329d736591e51c4a24a3c/shapes.py
(x1, y1, x2, y2) = getRectsBounds(b)
x1 = getRectsBounds(b) if x1 is None: return None x1, y1, x2, y2 = x1
def getBounds(self): if self.contents: b = [] for elem in self.contents: b.append(elem.getBounds()) (x1, y1, x2, y2) = getRectsBounds(b) trans = self.transform corners = [[x1,y1], [x1, y2], [x2, y1], [x2,y2]] newCorners = [] for corner in corners: newCorners.append(transformPoint(trans, corner)) return getPointsBounds(newCorners) else: #empty group needs a sane default; this #will happen when interactively creating a group #nothing has been added to yet. The alternative is #to handle None as an allowed return value everywhere. return None
c829389599340aff92b329d736591e51c4a24a3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c829389599340aff92b329d736591e51c4a24a3c/shapes.py
WedgeLabel3d._ydepth_3d = self._ydepth_3d
checkLabelOverlap = self.checkLabelOverlap
def _checkDXY(self,ba): if ba[0]=='n': if not hasattr(self,'_ody'): self._ody = self.dy self.dy = -self._ody + self._ydepth_3d
e79e0fad447462dc2f6790928f2cd07e6271fdb5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/e79e0fad447462dc2f6790928f2cd07e6271fdb5/piecharts.py
_addWedgeLabel(self,text,L.append,mid,OX(i,mid,0),OY(i,mid,0),style,labelClass=WedgeLabel3d)
labelX = OX(i,mid,0) labelY = OY(i,mid,0) _addWedgeLabel(self,text,L.append,mid,labelX,labelY,style,labelClass=WedgeLabel3d) if checkLabelOverlap: l = L[-1] l._origdata = { 'x': labelX, 'y':labelY, 'angle': mid, 'rx': self._radiusx, 'ry':self._radiusy, 'cx':CX(i,0), 'cy':CY(i,0), 'bounds': l.getBounds(), }
def _checkDXY(self,ba): if ba[0]=='n': if not hasattr(self,'_ody'): self._ody = self.dy self.dy = -self._ody + self._ydepth_3d
e79e0fad447462dc2f6790928f2cd07e6271fdb5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/e79e0fad447462dc2f6790928f2cd07e6271fdb5/piecharts.py
rlDir = os.path.dirname(reportlab.__file__) ppDir = os.path.join(rlDir, 'tools','pythonpoint') m1 = recursiveImport('stdparser', baseDir=ppDir)
D = os.path.join(os.path.dirname(reportlab.__file__), 'tools','pythonpoint') fn = os.path.join(D,'stdparser.py') if os.path.isfile(fn) or os.path.isfile(fn+'c') or os.path.isfile(fn+'o'): m1 = recursiveImport('stdparser', baseDir=D)
def test2(self): "try under a directory NOT on the path" rlDir = os.path.dirname(reportlab.__file__) ppDir = os.path.join(rlDir, 'tools','pythonpoint') m1 = recursiveImport('stdparser', baseDir=ppDir)
153abc6259a5e5a886dbe294edae46c25b20613b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/153abc6259a5e5a886dbe294edae46c25b20613b/test_lib_utils.py
unittest.TextTestRunner().run(makeSuite())
unittest.TextTestRunner().run(makeSuite())
def makeSuite(): return makeSuiteForClasses(ImporterTestCase)
153abc6259a5e5a886dbe294edae46c25b20613b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/153abc6259a5e5a886dbe294edae46c25b20613b/test_lib_utils.py
def open_for_read(name,mode='b'):
def open_for_read_by_name(name,mode='b'): if 'r' not in mode: mode = 'r'+mode try: return open(name,mode) except IOError: t, v = sys.exc_info()[:2] if _isFSD or __loader__ is None: raise try: name = _startswith_rl(name) s = __loader__.get_data(name) if 'b' not in mode and os.linesep!='\n': s = s.replace(os.linesep,'\n') return getStringIO(s) except: raise t, v import urllib, urlparse def open_for_read(name,mode='b', urlparse=urlparse.urlparse, urlopen=urllib.urlopen):
def open_for_read(name,mode='b'): '''attempt to open a file or URL for reading''' if hasattr(name,'read'): return name import urllib try: t, o = urllib.splittype(name) if not t or t=='file': raise ValueError o = urllib.urlopen(name) return getStringIO(o.read()) except: if 'r' not in mode: mode = 'r'+mode try: return open(name,mode) except IOError: t, v = sys.exc_info()[:2] if _isFSD or __loader__ is None: raise try: #we have a __loader__, perhaps the filename starts with #the dirname(reportlab.__file__) or is relative name = _startswith_rl(name) s = __loader__.get_data(name) if 'b' not in mode and os.linesep!='\n': s = s.replace(os.linesep,'\n') return getStringIO(s) except: raise t, v
cb904483bf49f44a457d420ce323d92f82163683 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/cb904483bf49f44a457d420ce323d92f82163683/utils.py
import urllib try: t, o = urllib.splittype(name) if not t or t=='file': raise ValueError o = urllib.urlopen(name) return getStringIO(o.read())
try: P = urlparse(name) if not P[0] or P[0]=='file': raise ValueError return getStringIO(urlopen(name).read())
def open_for_read(name,mode='b'): '''attempt to open a file or URL for reading''' if hasattr(name,'read'): return name import urllib try: t, o = urllib.splittype(name) if not t or t=='file': raise ValueError o = urllib.urlopen(name) return getStringIO(o.read()) except: if 'r' not in mode: mode = 'r'+mode try: return open(name,mode) except IOError: t, v = sys.exc_info()[:2] if _isFSD or __loader__ is None: raise try: #we have a __loader__, perhaps the filename starts with #the dirname(reportlab.__file__) or is relative name = _startswith_rl(name) s = __loader__.get_data(name) if 'b' not in mode and os.linesep!='\n': s = s.replace(os.linesep,'\n') return getStringIO(s) except: raise t, v
cb904483bf49f44a457d420ce323d92f82163683 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/cb904483bf49f44a457d420ce323d92f82163683/utils.py
if 'r' not in mode: mode = 'r'+mode try: return open(name,mode) except IOError: t, v = sys.exc_info()[:2] if _isFSD or __loader__ is None: raise try: name = _startswith_rl(name) s = __loader__.get_data(name) if 'b' not in mode and os.linesep!='\n': s = s.replace(os.linesep,'\n') return getStringIO(s) except: raise t, v
return open_for_read_by_name(P[2],mode) del urllib, urlparse
def open_for_read(name,mode='b'): '''attempt to open a file or URL for reading''' if hasattr(name,'read'): return name import urllib try: t, o = urllib.splittype(name) if not t or t=='file': raise ValueError o = urllib.urlopen(name) return getStringIO(o.read()) except: if 'r' not in mode: mode = 'r'+mode try: return open(name,mode) except IOError: t, v = sys.exc_info()[:2] if _isFSD or __loader__ is None: raise try: #we have a __loader__, perhaps the filename starts with #the dirname(reportlab.__file__) or is relative name = _startswith_rl(name) s = __loader__.get_data(name) if 'b' not in mode and os.linesep!='\n': s = s.replace(os.linesep,'\n') return getStringIO(s) except: raise t, v
cb904483bf49f44a457d420ce323d92f82163683 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/cb904483bf49f44a457d420ce323d92f82163683/utils.py
s = sin(30*_toradians)*r
s = sin(c)*r
def _StarSix(self): r = float(self.size)/2 c = 30*_toradians s = sin(30*_toradians)*r c = cos(c)*r z = s/2 g = c/2 return self._doPolygon((0,r,-z,s,-c,s,-s,0,-c,-s,-z,-s,0,-r,z,-s,c,-s,s,0,c,s,z,s))
056c274f652ec39e3042a9cd21dffdbc067e5b9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/056c274f652ec39e3042a9cd21dffdbc067e5b9e/markers.py
if self.angle: m.rotate(angle)
if self.angle: m.rotate(self.angle)
def draw(self): if self.kind: m = getattr(self,'_'+self.kind) if self.angle: _x, _dx, _y, _dy = self.x, self.dx, self.y, self.dy self.x, self.dx, self.y, self.dy = 0,0,0,0 try: m = m() finally: self.x, self.dx, self.y, self.dy = _x, _dx, _y, _dy if not isinstance(m,Group): _m, m = m, Group() m.add(_m) if self.angle: m.rotate(angle) x, y = _x+_dx, _y+_dy if x or y: m.shift(x,y) else: m = m() else: m = Group() return m
056c274f652ec39e3042a9cd21dffdbc067e5b9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/056c274f652ec39e3042a9cd21dffdbc067e5b9e/markers.py
D.save(fnRoot='Marker',formats=['pdf'], outDir='/tmp')
D.save(fnRoot='Marker',formats=['pdf'], outDir='/tmp')
def makeMarker(name,**kw): if Marker._attrMap['kind'].validate(name): m = apply(Marker,(),kw) m.kind = name elif name[-5:]=='_Flag' and Flag._attrMap['kind'].validate(name[:-5]): m = apply(Flag,(),kw) m.kind = name[:-5] m.size = 10 else: raise ValueError, "Invalid marker name %s" % name return m
056c274f652ec39e3042a9cd21dffdbc067e5b9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/056c274f652ec39e3042a9cd21dffdbc067e5b9e/markers.py
canvas.setFont('Times-Bold',16) canvas.drawString(108, layout.PAGE_HEIGHT-108, Title) canvas.setFont('Times-Roman',9)
def myFirstPage(canvas, doc): canvas.saveState() canvas.setFont('Times-Bold',16) canvas.drawString(108, layout.PAGE_HEIGHT-108, Title) canvas.setFont('Times-Roman',9) canvas.restoreState()
a4f41b2bc34b6dbf776d412796f45b7bd6a19152 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a4f41b2bc34b6dbf776d412796f45b7bd6a19152/fodyssey.py
ChapterStyle.fontsize = 14
ChapterStyle.fontsize = 16 InitialStyle = copy.deepcopy(ChapterStyle) InitialStyle.fontsize = 16 PreStyle = styles["Code"]
def go(): doc = layout.SimpleFlowDocument('fodyssey.pdf',layout.DEFAULT_PAGE_SIZE,showBoundary=0) doc.onFirstPage = myFirstPage doc.onNewPage = myLaterPages doc.build(Elements)
a4f41b2bc34b6dbf776d412796f45b7bd6a19152 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a4f41b2bc34b6dbf776d412796f45b7bd6a19152/fodyssey.py
Elements.append(layout.Spacer(0.2*inch, 0.1*inch))
spacer(0.1)
def p(txt, style=ParaStyle): Elements.append(layout.Spacer(0.2*inch, 0.1*inch)) Elements.append(Paragraph(txt, style))
a4f41b2bc34b6dbf776d412796f45b7bd6a19152 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a4f41b2bc34b6dbf776d412796f45b7bd6a19152/fodyssey.py
PreStyle = styles["Code"] InitialStyle = copy.copy(PreStyle) InitialStyle.alignment = TA_CENTER InitialStyle.fontsize = 14
def p(txt, style=ParaStyle): Elements.append(layout.Spacer(0.2*inch, 0.1*inch)) Elements.append(Paragraph(txt, style))
a4f41b2bc34b6dbf776d412796f45b7bd6a19152 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a4f41b2bc34b6dbf776d412796f45b7bd6a19152/fodyssey.py
s = layout.Spacer(0.1*inch, 0.1*inch) Elements.append(s) p = layout.Preformatted(txt, PreStyle)
spacer(0.1) p = layout.Preformatted(txt, style)
def pre(txt, style=PreStyle): s = layout.Spacer(0.1*inch, 0.1*inch) Elements.append(s) p = layout.Preformatted(txt, PreStyle) Elements.append(p)
a4f41b2bc34b6dbf776d412796f45b7bd6a19152 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a4f41b2bc34b6dbf776d412796f45b7bd6a19152/fodyssey.py
E.append([layout.Preformatted,'The Odyssey\n\nHomer\n', InitialStyle])
E.append([spacer,2]) E.append([fTitle,'<font color=red>%s</font>' % Title, InitialStyle]) E.append([fTitle,'<font size=-4>by</font> <font color=green>%s</font>' % Author, InitialStyle])
def findNext(L, i): while 1: if string.strip(L[i])=='': del L[i] kind = 1 if i<len(L): while string.strip(L[i])=='': del L[i]
a4f41b2bc34b6dbf776d412796f45b7bd6a19152 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a4f41b2bc34b6dbf776d412796f45b7bd6a19152/fodyssey.py
self.x = self.y = self.angle = 0
self.x = self.y = self.angle = self.skewY = self._dx = 0 self.skewX = 10 self._dy = 35.5 self.showPage = 1
def __init__(self): self.fillColor = white self.strokeColor = None self.strokeWidth = 0.1 self.background = ReportLabBlue self.shadow = 0.5 self.height = 86 self.width = 129 self.x = self.y = self.angle = 0
52735650fe65e7b701c80dd27326b3086bdc15b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/52735650fe65e7b701c80dd27326b3086bdc15b9/corp.py
g.add(definePath([ ('moveTo' ,15.7246,0 ), ('lineTo' ,9.49521,0 ), ('lineTo' ,6.64988,6.83711 ), ('curveTo' ,6.62224,6.95315 ,6.57391,7.10646 ,6.50485,7.29708 ), ('curveTo' ,6.43578,7.48767 ,6.35059,7.71559 ,6.24931,7.98079 ), ('lineTo' ,6.29074,6.71282 ), ('lineTo' ,6.29074,0 ), ('lineTo' ,0.55862,0 ), ('lineTo' ,0.55862,19.19365 ), ('lineTo' ,6.45649,19.19365 ), ('curveTo' ,9.05324,19.19365 ,10.99617,18.73371 ,12.28532,17.8138 ), ('curveTo' ,13.92439,16.63697 ,14.7439,14.96293 ,14.7439,12.79161 ), ('curveTo' ,14.7439,10.47114 ,13.64354,8.86755 ,11.44276,7.98079 ), 'closePath', ('moveTo' ,6.31838,10.30542 ), ('lineTo' ,6.70513,10.30542 ), ('curveTo' ,7.36812,10.30542 ,7.92062,10.53331 ,8.36261,10.98912 ), ('curveTo' ,8.80461,11.44491 ,9.0256,12.02504 ,9.0256,12.72947 ), ('curveTo' ,9.0256,14.16321 ,8.19227,14.88004 ,6.52556,14.88004 ), ('lineTo' ,6.31838,14.88004 ), 'closePath', ('moveTo' ,25.06173,4.54978 ), ('lineTo' ,30.47611,4.45033 ), ('curveTo' ,30.08951,2.88402 ,29.33668,1.70513 ,28.21787,0.91369 ), ('curveTo' ,27.09906,0.12223 ,25.63726,-0.27348 ,23.83245,-0.27348 ), ('curveTo' ,21.69611,-0.27348 ,20.02024,0.32322 ,18.80475,1.5166 ), ('curveTo' ,17.59846,2.72658 ,16.99531,4.37988 ,16.99531,6.47662 ), ('curveTo' ,16.99531,8.6065 ,17.64451,10.34269 ,18.94286,11.68527 ), ('curveTo' ,20.24124,13.03612 ,21.91711,13.71152 ,23.97056,13.71152 ), ('curveTo' ,26.01482,13.71152 ,27.64466,13.06096 ,28.86015,11.75985 ), ('curveTo' ,30.07566,10.45042 ,30.68326,8.71423 ,30.68326,6.5512 ), ('lineTo' ,30.65586,5.66859 ), ('lineTo' ,22.53407,5.66859 ), ('curveTo' ,22.59855,4.29287 ,23.03132,3.60503 ,23.83245,3.60503 ), ('curveTo' ,24.45861,3.60503 ,24.86837,3.91994 ,25.06173,4.54978 ), 'closePath', ('moveTo' ,25.18604,8.35371 ), ('curveTo' ,25.18604,8.60235 ,25.15384,8.83024 ,25.08937,9.03742 ), ('curveTo' ,25.02489,9.24463 ,24.93514,9.42278 ,24.82001,9.57197 ), ('curveTo' ,24.70492,9.72113 ,24.56911,9.83923 ,24.41255,9.92624 ), ('curveTo' ,24.25603,10.01326 ,24.08568,10.05678 ,23.90152,10.05678 ), ('curveTo' ,23.51474,10.05678 ,23.20169,9.89725 ,22.96225,9.57819 ), ('curveTo' ,22.72283,9.25913 ,22.60314,8.85096 ,22.60314,8.35371 ), 'closePath', ('moveTo' ,38.36308,-5.99181 ), ('lineTo' ,32.82428,-5.99181 ), ('lineTo' ,32.82428,13.43804 ), ('lineTo' ,38.36308,13.43804 ), ('lineTo' ,38.23873,11.53608 ), ('curveTo' ,38.46886,11.93387 ,38.70371,12.27159 ,38.94327,12.54922 ), ('curveTo' ,39.18254,12.82685 ,39.44037,13.05268 ,39.71676,13.22671 ), ('curveTo' ,39.99286,13.40074 ,40.28988,13.52712 ,40.60753,13.60585 ), ('curveTo' ,40.92518,13.68459 ,41.27759,13.72396 ,41.66419,13.72396 ), ('curveTo' ,43.10068,13.72396 ,44.2702,13.07755 ,45.17246,11.78472 ), ('curveTo' ,46.06588,10.50844 ,46.51229,8.81368 ,46.51229,6.70038 ), ('curveTo' ,46.51229,4.55394 ,46.08415,2.85502 ,45.22785,1.60362 ), ('curveTo' ,44.38983,0.35221 ,43.23416,-0.27348 ,41.76084,-0.27348 ), ('curveTo' ,40.41659,-0.27348 ,39.24235,0.42679 ,38.23873,1.82739 ), ('curveTo' ,38.2847,1.40472 ,38.31239,1.04007 ,38.32153,0.73345 ), ('curveTo' ,38.34923,0.41851 ,38.36308,0.04146 ,38.36308,-0.3978 ), 'closePath', ('moveTo' ,40.7802,6.84954 ), ('curveTo' ,40.7802,7.72802 ,40.66734,8.40964 ,40.44193,8.89448 ), ('curveTo' ,40.21621,9.37929 ,39.89621,9.62168 ,39.48191,9.62168 ), ('curveTo' ,38.62533,9.62168 ,38.19718,8.68108 ,38.19718,6.79983 ), ('curveTo' ,38.19718,4.87712 ,38.61177,3.91581 ,39.44037,3.91581 ), ('curveTo' ,39.85466,3.91581 ,40.18174,4.1727 ,40.42101,4.68654 ), ('curveTo' ,40.66057,5.20037 ,40.7802,5.92135 ,40.7802,6.84954 ), 'closePath', ('moveTo' ,62.10648,6.51392 ), ('curveTo' ,62.10648,4.44205 ,61.47118,2.79288 ,60.2003,1.56631 ), ('curveTo' ,58.92971,0.33978 ,57.22626,-0.27348 ,55.08965,-0.27348 ), ('curveTo' ,52.99018,-0.27348 ,51.31914,0.35221 ,50.07595,1.60362 ), ('curveTo' ,48.8419,2.8633 ,48.22517,4.55394 ,48.22517,6.67551 ), ('curveTo' ,48.22517,8.79709 ,48.85575,10.50016 ,50.1175,11.78472 ), ('curveTo' ,51.36982,13.07755 ,53.03172,13.72396 ,55.1035,13.72396 ), ('curveTo' ,57.28608,13.72396 ,58.99866,13.08168 ,60.24185,11.79712 ), ('curveTo' ,61.48503,10.51259 ,62.10648,8.75154 ,62.10648,6.51392 ), 'closePath', ('moveTo' ,56.73358,6.67551 ), ('curveTo' ,56.73358,7.17276 ,56.69675,7.62236 ,56.62308,8.02428 ), ('curveTo' ,56.54942,8.42623 ,56.44334,8.77016 ,56.30544,9.05607 ), ('curveTo' ,56.16724,9.34198 ,56.00134,9.56369 ,55.80804,9.72113 ), ('curveTo' ,55.61474,9.8786 ,55.39817,9.95733 ,55.1589,9.95733 ), ('curveTo' ,54.68921,9.95733 ,54.31174,9.65898 ,54.02621,9.06229 ), ('curveTo' ,53.74068,8.54018 ,53.59807,7.75702 ,53.59807,6.71282 ), ('curveTo' ,53.59807,5.68515 ,53.74068,4.90202 ,54.02621,4.36332 ), ('curveTo' ,54.31174,3.76663 ,54.69392,3.46828 ,55.17275,3.46828 ), ('curveTo' ,55.62388,3.46828 ,55.99692,3.7625 ,56.29159,4.35088 ), ('curveTo' ,56.58625,5.0056 ,56.73358,5.78047 ,56.73358,6.67551 ), 'closePath', ('moveTo' ,69.78629,0 ), ('lineTo' ,64.2475,0 ), ('lineTo' ,64.2475,13.43804 ), ('lineTo' ,69.78629,13.43804 ), ('lineTo' ,69.49605,10.81507 ), ('curveTo' ,70.33407,12.77921 ,71.71988,13.76126 ,73.65346,13.76126 ), ('lineTo' ,73.65346,8.16725 ), ('curveTo' ,73.04586,8.4656 ,72.5302,8.61478 ,72.10647,8.61478 ), ('curveTo' ,71.36068,8.61478 ,70.78756,8.37236 ,70.38711,7.88755 ), ('curveTo' ,69.98637,7.40274 ,69.78629,6.69623 ,69.78629,5.76804 ), 'closePath', ('moveTo' ,81.55427,0 ), ('lineTo' ,76.00163,0 ), ('lineTo' ,76.00163,9.42278 ), ('lineTo' ,74.42725,9.42278 ), ('lineTo' ,74.42725,13.43804 ), ('lineTo' ,76.00163,13.43804 ), ('lineTo' ,76.00163,17.39113 ), ('lineTo' ,81.55427,17.39113 ), ('lineTo' ,81.55427,13.43804 ), ('lineTo' ,83.39121,13.43804 ), ('lineTo' ,83.39121,9.42278 ), ('lineTo' ,81.55427,9.42278 ), 'closePath', ('moveTo' ,95.17333,0 ), ('lineTo' ,85.09024,0 ), ('lineTo' ,85.09024,19.19365 ), ('lineTo' ,90.85002,19.19365 ), ('lineTo' ,90.85002,4.61196 ), ('lineTo' ,95.17333,4.61196 ), 'closePath', ('moveTo' ,110.00787,0 ), ('lineTo' ,104.45523,0 ), ('curveTo' ,104.5012,0.44754 ,104.53803,0.87433 ,104.56573,1.2804 ), ('curveTo' ,104.59313,1.68651 ,104.62083,2.01385 ,104.64853,2.26246 ), ('curveTo' ,103.69087,0.57182 ,102.40644,-0.27348 ,100.79492,-0.27348 ), ('curveTo' ,99.39527,-0.27348 ,98.28557,0.35637 ,97.46611,1.61605 ), ('curveTo' ,96.65578,2.86746 ,96.25062,4.59952 ,96.25062,6.81227 ), ('curveTo' ,96.25062,8.95041 ,96.66963,10.63276 ,97.50765,11.8593 ), ('curveTo' ,98.34538,13.10242 ,99.4872,13.72396 ,100.93312,13.72396 ), ('curveTo' ,102.41557,13.72396 ,103.61249,12.92008 ,104.52418,11.31231 ), ('curveTo' ,104.50591,11.47806 ,104.49206,11.62309 ,104.48293,11.74741 ), ('curveTo' ,104.4735,11.87173 ,104.46437,11.9753 ,104.45523,12.05819 ), ('lineTo' ,104.39983,12.84135 ), ('lineTo' ,104.35858,13.43804 ), ('lineTo' ,110.00787,13.43804 ), 'closePath', ('moveTo' ,104.39983,6.88685 ), ('curveTo' ,104.39983,7.38409 ,104.37921,7.80676 ,104.33766,8.15481 ), ('curveTo' ,104.29641,8.5029 ,104.22952,8.78672 ,104.13758,9.00636 ), ('curveTo' ,104.04535,9.22598 ,103.92572,9.38341 ,103.77839,9.47874 ), ('curveTo' ,103.63106,9.57403 ,103.45161,9.62168 ,103.23974,9.62168 ), ('curveTo' ,102.30036,9.62168 ,101.83096,8.49875 ,101.83096,6.25285 ), ('curveTo' ,101.83096,4.64508 ,102.24967,3.8412 ,103.0877,3.8412 ), ('curveTo' ,103.96255,3.8412 ,104.39983,4.85641 ,104.39983,6.88685 ), 'closePath', ('moveTo' ,118.22604,0 ), ('lineTo' ,112.5629,0 ), ('lineTo' ,112.5629,20.99616 ), ('lineTo' ,118.10169,20.99616 ), ('lineTo' ,118.10169,13.63694 ), ('curveTo' ,118.10169,13.01538 ,118.07399,12.30268 ,118.01889,11.49877 ), ('curveTo' ,118.52542,12.31096 ,119.03636,12.88693 ,119.55202,13.22671 ), ('curveTo' ,120.08625,13.55821 ,120.75838,13.72396 ,121.5687,13.72396 ), ('curveTo' ,123.07885,13.72396 ,124.24837,13.09827 ,125.07697,11.84686 ), ('curveTo' ,125.90586,10.60373 ,126.32015,8.85099 ,126.32015,6.5885 ), ('curveTo' ,126.32015,4.42546 ,125.89201,2.74314 ,125.03571,1.54147 ), ('curveTo' ,124.18826,0.3315 ,123.01432,-0.27348 ,121.51331,-0.27348 ), ('curveTo' ,120.78608,-0.27348 ,120.16905,-0.12432 ,119.66252,0.17403 ), ('curveTo' ,119.41383,0.3315 ,119.15835,0.54283 ,118.8961,0.80803 ), ('curveTo' ,118.63356,1.07322 ,118.36866,1.40472 ,118.10169,1.80252 ), ('curveTo' ,118.11112,1.64505 ,118.12025,1.51039 ,118.12939,1.3985 ), ('curveTo' ,118.13852,1.28662 ,118.14766,1.19339 ,118.15709,1.11881 ), 'closePath', ('moveTo' ,120.58806,6.70038 ), ('curveTo' ,120.58806,8.62306 ,120.11837,9.5844 ,119.17898,9.5844 ), ('curveTo' ,118.35039,9.5844 ,117.93609,8.67693 ,117.93609,6.86198 ), ('curveTo' ,117.93609,4.96417 ,118.36424,4.01526 ,119.22053,4.01526 ), ('curveTo' ,120.13222,4.01526 ,120.58806,4.91027 ,120.58806,6.70038 ), 'closePath',
P = [ ('moveTo' ,15.7246,0 ), ('lineTo' ,9.49521,0 ), ('lineTo' ,6.64988,6.83711 ), ('curveTo' ,6.62224,6.95315 ,6.57391,7.10646 ,6.50485,7.29708 ), ('curveTo' ,6.43578,7.48767 ,6.35059,7.71559 ,6.24931,7.98079 ), ('lineTo' ,6.29074,6.71282 ), ('lineTo' ,6.29074,0 ), ('lineTo' ,0.55862,0 ), ('lineTo' ,0.55862,19.19365 ), ('lineTo' ,6.45649,19.19365 ), ('curveTo' ,9.05324,19.19365 ,10.99617,18.73371 ,12.28532,17.8138 ), ('curveTo' ,13.92439,16.63697 ,14.7439,14.96293 ,14.7439,12.79161 ), ('curveTo' ,14.7439,10.47114 ,13.64354,8.86755 ,11.44276,7.98079 ), 'closePath', ('moveTo' ,6.31838,10.30542 ), ('lineTo' ,6.70513,10.30542 ), ('curveTo' ,7.36812,10.30542 ,7.92062,10.53331 ,8.36261,10.98912 ), ('curveTo' ,8.80461,11.44491 ,9.0256,12.02504 ,9.0256,12.72947 ), ('curveTo' ,9.0256,14.16321 ,8.19227,14.88004 ,6.52556,14.88004 ), ('lineTo' ,6.31838,14.88004 ), 'closePath', ('moveTo' ,25.06173,4.54978 ), ('lineTo' ,30.47611,4.45033 ), ('curveTo' ,30.08951,2.88402 ,29.33668,1.70513 ,28.21787,0.91369 ), ('curveTo' ,27.09906,0.12223 ,25.63726,-0.27348 ,23.83245,-0.27348 ), ('curveTo' ,21.69611,-0.27348 ,20.02024,0.32322 ,18.80475,1.5166 ), ('curveTo' ,17.59846,2.72658 ,16.99531,4.37988 ,16.99531,6.47662 ), ('curveTo' ,16.99531,8.6065 ,17.64451,10.34269 ,18.94286,11.68527 ), ('curveTo' ,20.24124,13.03612 ,21.91711,13.71152 ,23.97056,13.71152 ), ('curveTo' ,26.01482,13.71152 ,27.64466,13.06096 ,28.86015,11.75985 ), ('curveTo' ,30.07566,10.45042 ,30.68326,8.71423 ,30.68326,6.5512 ), ('lineTo' ,30.65586,5.66859 ), ('lineTo' ,22.53407,5.66859 ), ('curveTo' ,22.59855,4.29287 ,23.03132,3.60503 ,23.83245,3.60503 ), ('curveTo' ,24.45861,3.60503 ,24.86837,3.91994 ,25.06173,4.54978 ), 'closePath', ('moveTo' ,25.18604,8.35371 ), ('curveTo' ,25.18604,8.60235 ,25.15384,8.83024 ,25.08937,9.03742 ), ('curveTo' ,25.02489,9.24463 ,24.93514,9.42278 ,24.82001,9.57197 ), ('curveTo' ,24.70492,9.72113 ,24.56911,9.83923 ,24.41255,9.92624 ), ('curveTo' ,24.25603,10.01326 ,24.08568,10.05678 ,23.90152,10.05678 ), ('curveTo' ,23.51474,10.05678 ,23.20169,9.89725 ,22.96225,9.57819 ), ('curveTo' ,22.72283,9.25913 ,22.60314,8.85096 ,22.60314,8.35371 ), 'closePath', ('moveTo' ,38.36308,-5.99181 ), ('lineTo' ,32.82428,-5.99181 ), ('lineTo' ,32.82428,13.43804 ), ('lineTo' ,38.36308,13.43804 ), ('lineTo' ,38.23873,11.53608 ), ('curveTo' ,38.46886,11.93387 ,38.70371,12.27159 ,38.94327,12.54922 ), ('curveTo' ,39.18254,12.82685 ,39.44037,13.05268 ,39.71676,13.22671 ), ('curveTo' ,39.99286,13.40074 ,40.28988,13.52712 ,40.60753,13.60585 ), ('curveTo' ,40.92518,13.68459 ,41.27759,13.72396 ,41.66419,13.72396 ), ('curveTo' ,43.10068,13.72396 ,44.2702,13.07755 ,45.17246,11.78472 ), ('curveTo' ,46.06588,10.50844 ,46.51229,8.81368 ,46.51229,6.70038 ), ('curveTo' ,46.51229,4.55394 ,46.08415,2.85502 ,45.22785,1.60362 ), ('curveTo' ,44.38983,0.35221 ,43.23416,-0.27348 ,41.76084,-0.27348 ), ('curveTo' ,40.41659,-0.27348 ,39.24235,0.42679 ,38.23873,1.82739 ), ('curveTo' ,38.2847,1.40472 ,38.31239,1.04007 ,38.32153,0.73345 ), ('curveTo' ,38.34923,0.41851 ,38.36308,0.04146 ,38.36308,-0.3978 ), 'closePath', ('moveTo' ,40.7802,6.84954 ), ('curveTo' ,40.7802,7.72802 ,40.66734,8.40964 ,40.44193,8.89448 ), ('curveTo' ,40.21621,9.37929 ,39.89621,9.62168 ,39.48191,9.62168 ), ('curveTo' ,38.62533,9.62168 ,38.19718,8.68108 ,38.19718,6.79983 ), ('curveTo' ,38.19718,4.87712 ,38.61177,3.91581 ,39.44037,3.91581 ), ('curveTo' ,39.85466,3.91581 ,40.18174,4.1727 ,40.42101,4.68654 ), ('curveTo' ,40.66057,5.20037 ,40.7802,5.92135 ,40.7802,6.84954 ), 'closePath', ('moveTo' ,62.10648,6.51392 ), ('curveTo' ,62.10648,4.44205 ,61.47118,2.79288 ,60.2003,1.56631 ), ('curveTo' ,58.92971,0.33978 ,57.22626,-0.27348 ,55.08965,-0.27348 ), ('curveTo' ,52.99018,-0.27348 ,51.31914,0.35221 ,50.07595,1.60362 ), ('curveTo' ,48.8419,2.8633 ,48.22517,4.55394 ,48.22517,6.67551 ), ('curveTo' ,48.22517,8.79709 ,48.85575,10.50016 ,50.1175,11.78472 ), ('curveTo' ,51.36982,13.07755 ,53.03172,13.72396 ,55.1035,13.72396 ), ('curveTo' ,57.28608,13.72396 ,58.99866,13.08168 ,60.24185,11.79712 ), ('curveTo' ,61.48503,10.51259 ,62.10648,8.75154 ,62.10648,6.51392 ), 'closePath', ('moveTo' ,56.73358,6.67551 ), ('curveTo' ,56.73358,7.17276 ,56.69675,7.62236 ,56.62308,8.02428 ), ('curveTo' ,56.54942,8.42623 ,56.44334,8.77016 ,56.30544,9.05607 ), ('curveTo' ,56.16724,9.34198 ,56.00134,9.56369 ,55.80804,9.72113 ), ('curveTo' ,55.61474,9.8786 ,55.39817,9.95733 ,55.1589,9.95733 ), ('curveTo' ,54.68921,9.95733 ,54.31174,9.65898 ,54.02621,9.06229 ), ('curveTo' ,53.74068,8.54018 ,53.59807,7.75702 ,53.59807,6.71282 ), ('curveTo' ,53.59807,5.68515 ,53.74068,4.90202 ,54.02621,4.36332 ), ('curveTo' ,54.31174,3.76663 ,54.69392,3.46828 ,55.17275,3.46828 ), ('curveTo' ,55.62388,3.46828 ,55.99692,3.7625 ,56.29159,4.35088 ), ('curveTo' ,56.58625,5.0056 ,56.73358,5.78047 ,56.73358,6.67551 ), 'closePath', ('moveTo' ,69.78629,0 ), ('lineTo' ,64.2475,0 ), ('lineTo' ,64.2475,13.43804 ), ('lineTo' ,69.78629,13.43804 ), ('lineTo' ,69.49605,10.81507 ), ('curveTo' ,70.33407,12.77921 ,71.71988,13.76126 ,73.65346,13.76126 ), ('lineTo' ,73.65346,8.16725 ), ('curveTo' ,73.04586,8.4656 ,72.5302,8.61478 ,72.10647,8.61478 ), ('curveTo' ,71.36068,8.61478 ,70.78756,8.37236 ,70.38711,7.88755 ), ('curveTo' ,69.98637,7.40274 ,69.78629,6.69623 ,69.78629,5.76804 ), 'closePath', ('moveTo' ,81.55427,0 ), ('lineTo' ,76.00163,0 ), ('lineTo' ,76.00163,9.42278 ), ('lineTo' ,74.42725,9.42278 ), ('lineTo' ,74.42725,13.43804 ), ('lineTo' ,76.00163,13.43804 ), ('lineTo' ,76.00163,17.39113 ), ('lineTo' ,81.55427,17.39113 ), ('lineTo' ,81.55427,13.43804 ), ('lineTo' ,83.39121,13.43804 ), ('lineTo' ,83.39121,9.42278 ), ('lineTo' ,81.55427,9.42278 ), 'closePath', ('moveTo' ,95.17333,0 ), ('lineTo' ,85.09024,0 ), ('lineTo' ,85.09024,19.19365 ), ('lineTo' ,90.85002,19.19365 ), ('lineTo' ,90.85002,4.61196 ), ('lineTo' ,95.17333,4.61196 ), 'closePath', ('moveTo' ,110.00787,0 ), ('lineTo' ,104.45523,0 ), ('curveTo' ,104.5012,0.44754 ,104.53803,0.87433 ,104.56573,1.2804 ), ('curveTo' ,104.59313,1.68651 ,104.62083,2.01385 ,104.64853,2.26246 ), ('curveTo' ,103.69087,0.57182 ,102.40644,-0.27348 ,100.79492,-0.27348 ), ('curveTo' ,99.39527,-0.27348 ,98.28557,0.35637 ,97.46611,1.61605 ), ('curveTo' ,96.65578,2.86746 ,96.25062,4.59952 ,96.25062,6.81227 ), ('curveTo' ,96.25062,8.95041 ,96.66963,10.63276 ,97.50765,11.8593 ), ('curveTo' ,98.34538,13.10242 ,99.4872,13.72396 ,100.93312,13.72396 ), ('curveTo' ,102.41557,13.72396 ,103.61249,12.92008 ,104.52418,11.31231 ), ('curveTo' ,104.50591,11.47806 ,104.49206,11.62309 ,104.48293,11.74741 ), ('curveTo' ,104.4735,11.87173 ,104.46437,11.9753 ,104.45523,12.05819 ), ('lineTo' ,104.39983,12.84135 ), ('lineTo' ,104.35858,13.43804 ), ('lineTo' ,110.00787,13.43804 ), 'closePath', ('moveTo' ,104.39983,6.88685 ), ('curveTo' ,104.39983,7.38409 ,104.37921,7.80676 ,104.33766,8.15481 ), ('curveTo' ,104.29641,8.5029 ,104.22952,8.78672 ,104.13758,9.00636 ), ('curveTo' ,104.04535,9.22598 ,103.92572,9.38341 ,103.77839,9.47874 ), ('curveTo' ,103.63106,9.57403 ,103.45161,9.62168 ,103.23974,9.62168 ), ('curveTo' ,102.30036,9.62168 ,101.83096,8.49875 ,101.83096,6.25285 ), ('curveTo' ,101.83096,4.64508 ,102.24967,3.8412 ,103.0877,3.8412 ), ('curveTo' ,103.96255,3.8412 ,104.39983,4.85641 ,104.39983,6.88685 ), 'closePath', ('moveTo' ,118.22604,0 ), ('lineTo' ,112.5629,0 ), ('lineTo' ,112.5629,20.99616 ), ('lineTo' ,118.10169,20.99616 ), ('lineTo' ,118.10169,13.63694 ), ('curveTo' ,118.10169,13.01538 ,118.07399,12.30268 ,118.01889,11.49877 ), ('curveTo' ,118.52542,12.31096 ,119.03636,12.88693 ,119.55202,13.22671 ), ('curveTo' ,120.08625,13.55821 ,120.75838,13.72396 ,121.5687,13.72396 ), ('curveTo' ,123.07885,13.72396 ,124.24837,13.09827 ,125.07697,11.84686 ), ('curveTo' ,125.90586,10.60373 ,126.32015,8.85099 ,126.32015,6.5885 ), ('curveTo' ,126.32015,4.42546 ,125.89201,2.74314 ,125.03571,1.54147 ), ('curveTo' ,124.18826,0.3315 ,123.01432,-0.27348 ,121.51331,-0.27348 ), ('curveTo' ,120.78608,-0.27348 ,120.16905,-0.12432 ,119.66252,0.17403 ), ('curveTo' ,119.41383,0.3315 ,119.15835,0.54283 ,118.8961,0.80803 ), ('curveTo' ,118.63356,1.07322 ,118.36866,1.40472 ,118.10169,1.80252 ), ('curveTo' ,118.11112,1.64505 ,118.12025,1.51039 ,118.12939,1.3985 ), ('curveTo' ,118.13852,1.28662 ,118.14766,1.19339 ,118.15709,1.11881 ), 'closePath', ('moveTo' ,120.58806,6.70038 ), ('curveTo' ,120.58806,8.62306 ,120.11837,9.5844 ,119.17898,9.5844 ), ('curveTo' ,118.35039,9.5844 ,117.93609,8.67693 ,117.93609,6.86198 ), ('curveTo' ,117.93609,4.96417 ,118.36424,4.01526 ,119.22053,4.01526 ), ('curveTo' ,120.13222,4.01526 ,120.58806,4.91027 ,120.58806,6.70038 ), 'closePath', ] + (self.showPage and [
def _paintLogo(self, g, dx=0, dy=0, strokeColor=None, strokeWidth=0.1, fillColor=white): g.add(definePath([ ('moveTo' ,15.7246,0 ), ('lineTo' ,9.49521,0 ), ('lineTo' ,6.64988,6.83711 ), ('curveTo' ,6.62224,6.95315 ,6.57391,7.10646 ,6.50485,7.29708 ), ('curveTo' ,6.43578,7.48767 ,6.35059,7.71559 ,6.24931,7.98079 ), ('lineTo' ,6.29074,6.71282 ), ('lineTo' ,6.29074,0 ), ('lineTo' ,0.55862,0 ), ('lineTo' ,0.55862,19.19365 ), ('lineTo' ,6.45649,19.19365 ), ('curveTo' ,9.05324,19.19365 ,10.99617,18.73371 ,12.28532,17.8138 ), ('curveTo' ,13.92439,16.63697 ,14.7439,14.96293 ,14.7439,12.79161 ), ('curveTo' ,14.7439,10.47114 ,13.64354,8.86755 ,11.44276,7.98079 ), 'closePath', ('moveTo' ,6.31838,10.30542 ), ('lineTo' ,6.70513,10.30542 ), ('curveTo' ,7.36812,10.30542 ,7.92062,10.53331 ,8.36261,10.98912 ), ('curveTo' ,8.80461,11.44491 ,9.0256,12.02504 ,9.0256,12.72947 ), ('curveTo' ,9.0256,14.16321 ,8.19227,14.88004 ,6.52556,14.88004 ), ('lineTo' ,6.31838,14.88004 ), 'closePath', ('moveTo' ,25.06173,4.54978 ), ('lineTo' ,30.47611,4.45033 ), ('curveTo' ,30.08951,2.88402 ,29.33668,1.70513 ,28.21787,0.91369 ), ('curveTo' ,27.09906,0.12223 ,25.63726,-0.27348 ,23.83245,-0.27348 ), ('curveTo' ,21.69611,-0.27348 ,20.02024,0.32322 ,18.80475,1.5166 ), ('curveTo' ,17.59846,2.72658 ,16.99531,4.37988 ,16.99531,6.47662 ), ('curveTo' ,16.99531,8.6065 ,17.64451,10.34269 ,18.94286,11.68527 ), ('curveTo' ,20.24124,13.03612 ,21.91711,13.71152 ,23.97056,13.71152 ), ('curveTo' ,26.01482,13.71152 ,27.64466,13.06096 ,28.86015,11.75985 ), ('curveTo' ,30.07566,10.45042 ,30.68326,8.71423 ,30.68326,6.5512 ), ('lineTo' ,30.65586,5.66859 ), ('lineTo' ,22.53407,5.66859 ), ('curveTo' ,22.59855,4.29287 ,23.03132,3.60503 ,23.83245,3.60503 ), ('curveTo' ,24.45861,3.60503 ,24.86837,3.91994 ,25.06173,4.54978 ), 'closePath', ('moveTo' ,25.18604,8.35371 ), ('curveTo' ,25.18604,8.60235 ,25.15384,8.83024 ,25.08937,9.03742 ), ('curveTo' ,25.02489,9.24463 ,24.93514,9.42278 ,24.82001,9.57197 ), ('curveTo' ,24.70492,9.72113 ,24.56911,9.83923 ,24.41255,9.92624 ), ('curveTo' ,24.25603,10.01326 ,24.08568,10.05678 ,23.90152,10.05678 ), ('curveTo' ,23.51474,10.05678 ,23.20169,9.89725 ,22.96225,9.57819 ), ('curveTo' ,22.72283,9.25913 ,22.60314,8.85096 ,22.60314,8.35371 ), 'closePath', ('moveTo' ,38.36308,-5.99181 ), ('lineTo' ,32.82428,-5.99181 ), ('lineTo' ,32.82428,13.43804 ), ('lineTo' ,38.36308,13.43804 ), ('lineTo' ,38.23873,11.53608 ), ('curveTo' ,38.46886,11.93387 ,38.70371,12.27159 ,38.94327,12.54922 ), ('curveTo' ,39.18254,12.82685 ,39.44037,13.05268 ,39.71676,13.22671 ), ('curveTo' ,39.99286,13.40074 ,40.28988,13.52712 ,40.60753,13.60585 ), ('curveTo' ,40.92518,13.68459 ,41.27759,13.72396 ,41.66419,13.72396 ), ('curveTo' ,43.10068,13.72396 ,44.2702,13.07755 ,45.17246,11.78472 ), ('curveTo' ,46.06588,10.50844 ,46.51229,8.81368 ,46.51229,6.70038 ), ('curveTo' ,46.51229,4.55394 ,46.08415,2.85502 ,45.22785,1.60362 ), ('curveTo' ,44.38983,0.35221 ,43.23416,-0.27348 ,41.76084,-0.27348 ), ('curveTo' ,40.41659,-0.27348 ,39.24235,0.42679 ,38.23873,1.82739 ), ('curveTo' ,38.2847,1.40472 ,38.31239,1.04007 ,38.32153,0.73345 ), ('curveTo' ,38.34923,0.41851 ,38.36308,0.04146 ,38.36308,-0.3978 ), 'closePath', ('moveTo' ,40.7802,6.84954 ), ('curveTo' ,40.7802,7.72802 ,40.66734,8.40964 ,40.44193,8.89448 ), ('curveTo' ,40.21621,9.37929 ,39.89621,9.62168 ,39.48191,9.62168 ), ('curveTo' ,38.62533,9.62168 ,38.19718,8.68108 ,38.19718,6.79983 ), ('curveTo' ,38.19718,4.87712 ,38.61177,3.91581 ,39.44037,3.91581 ), ('curveTo' ,39.85466,3.91581 ,40.18174,4.1727 ,40.42101,4.68654 ), ('curveTo' ,40.66057,5.20037 ,40.7802,5.92135 ,40.7802,6.84954 ), 'closePath', ('moveTo' ,62.10648,6.51392 ), ('curveTo' ,62.10648,4.44205 ,61.47118,2.79288 ,60.2003,1.56631 ), ('curveTo' ,58.92971,0.33978 ,57.22626,-0.27348 ,55.08965,-0.27348 ), ('curveTo' ,52.99018,-0.27348 ,51.31914,0.35221 ,50.07595,1.60362 ), ('curveTo' ,48.8419,2.8633 ,48.22517,4.55394 ,48.22517,6.67551 ), ('curveTo' ,48.22517,8.79709 ,48.85575,10.50016 ,50.1175,11.78472 ), ('curveTo' ,51.36982,13.07755 ,53.03172,13.72396 ,55.1035,13.72396 ), ('curveTo' ,57.28608,13.72396 ,58.99866,13.08168 ,60.24185,11.79712 ), ('curveTo' ,61.48503,10.51259 ,62.10648,8.75154 ,62.10648,6.51392 ), 'closePath', ('moveTo' ,56.73358,6.67551 ), ('curveTo' ,56.73358,7.17276 ,56.69675,7.62236 ,56.62308,8.02428 ), ('curveTo' ,56.54942,8.42623 ,56.44334,8.77016 ,56.30544,9.05607 ), ('curveTo' ,56.16724,9.34198 ,56.00134,9.56369 ,55.80804,9.72113 ), ('curveTo' ,55.61474,9.8786 ,55.39817,9.95733 ,55.1589,9.95733 ), ('curveTo' ,54.68921,9.95733 ,54.31174,9.65898 ,54.02621,9.06229 ), ('curveTo' ,53.74068,8.54018 ,53.59807,7.75702 ,53.59807,6.71282 ), ('curveTo' ,53.59807,5.68515 ,53.74068,4.90202 ,54.02621,4.36332 ), ('curveTo' ,54.31174,3.76663 ,54.69392,3.46828 ,55.17275,3.46828 ), ('curveTo' ,55.62388,3.46828 ,55.99692,3.7625 ,56.29159,4.35088 ), ('curveTo' ,56.58625,5.0056 ,56.73358,5.78047 ,56.73358,6.67551 ), 'closePath', ('moveTo' ,69.78629,0 ), ('lineTo' ,64.2475,0 ), ('lineTo' ,64.2475,13.43804 ), ('lineTo' ,69.78629,13.43804 ), ('lineTo' ,69.49605,10.81507 ), ('curveTo' ,70.33407,12.77921 ,71.71988,13.76126 ,73.65346,13.76126 ), ('lineTo' ,73.65346,8.16725 ), ('curveTo' ,73.04586,8.4656 ,72.5302,8.61478 ,72.10647,8.61478 ), ('curveTo' ,71.36068,8.61478 ,70.78756,8.37236 ,70.38711,7.88755 ), ('curveTo' ,69.98637,7.40274 ,69.78629,6.69623 ,69.78629,5.76804 ), 'closePath', ('moveTo' ,81.55427,0 ), ('lineTo' ,76.00163,0 ), ('lineTo' ,76.00163,9.42278 ), ('lineTo' ,74.42725,9.42278 ), ('lineTo' ,74.42725,13.43804 ), ('lineTo' ,76.00163,13.43804 ), ('lineTo' ,76.00163,17.39113 ), ('lineTo' ,81.55427,17.39113 ), ('lineTo' ,81.55427,13.43804 ), ('lineTo' ,83.39121,13.43804 ), ('lineTo' ,83.39121,9.42278 ), ('lineTo' ,81.55427,9.42278 ), 'closePath', ('moveTo' ,95.17333,0 ), ('lineTo' ,85.09024,0 ), ('lineTo' ,85.09024,19.19365 ), ('lineTo' ,90.85002,19.19365 ), ('lineTo' ,90.85002,4.61196 ), ('lineTo' ,95.17333,4.61196 ), 'closePath', ('moveTo' ,110.00787,0 ), ('lineTo' ,104.45523,0 ), ('curveTo' ,104.5012,0.44754 ,104.53803,0.87433 ,104.56573,1.2804 ), ('curveTo' ,104.59313,1.68651 ,104.62083,2.01385 ,104.64853,2.26246 ), ('curveTo' ,103.69087,0.57182 ,102.40644,-0.27348 ,100.79492,-0.27348 ), ('curveTo' ,99.39527,-0.27348 ,98.28557,0.35637 ,97.46611,1.61605 ), ('curveTo' ,96.65578,2.86746 ,96.25062,4.59952 ,96.25062,6.81227 ), ('curveTo' ,96.25062,8.95041 ,96.66963,10.63276 ,97.50765,11.8593 ), ('curveTo' ,98.34538,13.10242 ,99.4872,13.72396 ,100.93312,13.72396 ), ('curveTo' ,102.41557,13.72396 ,103.61249,12.92008 ,104.52418,11.31231 ), ('curveTo' ,104.50591,11.47806 ,104.49206,11.62309 ,104.48293,11.74741 ), ('curveTo' ,104.4735,11.87173 ,104.46437,11.9753 ,104.45523,12.05819 ), ('lineTo' ,104.39983,12.84135 ), ('lineTo' ,104.35858,13.43804 ), ('lineTo' ,110.00787,13.43804 ), 'closePath', ('moveTo' ,104.39983,6.88685 ), ('curveTo' ,104.39983,7.38409 ,104.37921,7.80676 ,104.33766,8.15481 ), ('curveTo' ,104.29641,8.5029 ,104.22952,8.78672 ,104.13758,9.00636 ), ('curveTo' ,104.04535,9.22598 ,103.92572,9.38341 ,103.77839,9.47874 ), ('curveTo' ,103.63106,9.57403 ,103.45161,9.62168 ,103.23974,9.62168 ), ('curveTo' ,102.30036,9.62168 ,101.83096,8.49875 ,101.83096,6.25285 ), ('curveTo' ,101.83096,4.64508 ,102.24967,3.8412 ,103.0877,3.8412 ), ('curveTo' ,103.96255,3.8412 ,104.39983,4.85641 ,104.39983,6.88685 ), 'closePath', ('moveTo' ,118.22604,0 ), ('lineTo' ,112.5629,0 ), ('lineTo' ,112.5629,20.99616 ), ('lineTo' ,118.10169,20.99616 ), ('lineTo' ,118.10169,13.63694 ), ('curveTo' ,118.10169,13.01538 ,118.07399,12.30268 ,118.01889,11.49877 ), ('curveTo' ,118.52542,12.31096 ,119.03636,12.88693 ,119.55202,13.22671 ), ('curveTo' ,120.08625,13.55821 ,120.75838,13.72396 ,121.5687,13.72396 ), ('curveTo' ,123.07885,13.72396 ,124.24837,13.09827 ,125.07697,11.84686 ), ('curveTo' ,125.90586,10.60373 ,126.32015,8.85099 ,126.32015,6.5885 ), ('curveTo' ,126.32015,4.42546 ,125.89201,2.74314 ,125.03571,1.54147 ), ('curveTo' ,124.18826,0.3315 ,123.01432,-0.27348 ,121.51331,-0.27348 ), ('curveTo' ,120.78608,-0.27348 ,120.16905,-0.12432 ,119.66252,0.17403 ), ('curveTo' ,119.41383,0.3315 ,119.15835,0.54283 ,118.8961,0.80803 ), ('curveTo' ,118.63356,1.07322 ,118.36866,1.40472 ,118.10169,1.80252 ), ('curveTo' ,118.11112,1.64505 ,118.12025,1.51039 ,118.12939,1.3985 ), ('curveTo' ,118.13852,1.28662 ,118.14766,1.19339 ,118.15709,1.11881 ), 'closePath', ('moveTo' ,120.58806,6.70038 ), ('curveTo' ,120.58806,8.62306 ,120.11837,9.5844 ,119.17898,9.5844 ), ('curveTo' ,118.35039,9.5844 ,117.93609,8.67693 ,117.93609,6.86198 ), ('curveTo' ,117.93609,4.96417 ,118.36424,4.01526 ,119.22053,4.01526 ), ('curveTo' ,120.13222,4.01526 ,120.58806,4.91027 ,120.58806,6.70038 ), 'closePath', ('moveTo',38.30626,-7.28346),('lineTo',38.30626,-25.55261),('lineTo',85.15777,-25.55261),('lineTo',85.15777,-1.39019),('lineTo',90.46172,-1.39019),('lineTo',90.46172,-31.15121),('lineTo',32.70766,-31.15121),('lineTo',32.70766,-7.28346), 'closePath', ('moveTo' ,32.70766,14.52164 ), ('lineTo' ,32.70766,47.81862 ), ('lineTo' ,80.14849,47.81862 ), ('lineTo' ,90.46172,37.21073 ), ('lineTo' ,90.46172,20.12025 ), ('lineTo' ,85.15777,20.12025 ), ('lineTo' ,85.15777,30.72814 ), ('lineTo' ,73.66589,30.72814 ), ('lineTo' ,73.66589,42.22002 ), ('lineTo' ,38.30626,42.22002 ), ('lineTo' ,38.30626,14.52164 ), 'closePath', ('moveTo' ,79.2645,36.32674 ), ('lineTo' ,85.15777,36.32674 ), ('lineTo' ,79.2645,42.22002 ), 'closePath', ], strokeColor=strokeColor,strokeWidth=strokeWidth,fillColor=fillColor, dx=dx, dy=dy))
52735650fe65e7b701c80dd27326b3086bdc15b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/52735650fe65e7b701c80dd27326b3086bdc15b9/corp.py
], strokeColor=strokeColor,strokeWidth=strokeWidth,fillColor=fillColor, dx=dx, dy=dy))
] or []) g.add(definePath(P,strokeColor=strokeColor,strokeWidth=strokeWidth,fillColor=fillColor, dx=dx, dy=dy))
def _paintLogo(self, g, dx=0, dy=0, strokeColor=None, strokeWidth=0.1, fillColor=white): g.add(definePath([ ('moveTo' ,15.7246,0 ), ('lineTo' ,9.49521,0 ), ('lineTo' ,6.64988,6.83711 ), ('curveTo' ,6.62224,6.95315 ,6.57391,7.10646 ,6.50485,7.29708 ), ('curveTo' ,6.43578,7.48767 ,6.35059,7.71559 ,6.24931,7.98079 ), ('lineTo' ,6.29074,6.71282 ), ('lineTo' ,6.29074,0 ), ('lineTo' ,0.55862,0 ), ('lineTo' ,0.55862,19.19365 ), ('lineTo' ,6.45649,19.19365 ), ('curveTo' ,9.05324,19.19365 ,10.99617,18.73371 ,12.28532,17.8138 ), ('curveTo' ,13.92439,16.63697 ,14.7439,14.96293 ,14.7439,12.79161 ), ('curveTo' ,14.7439,10.47114 ,13.64354,8.86755 ,11.44276,7.98079 ), 'closePath', ('moveTo' ,6.31838,10.30542 ), ('lineTo' ,6.70513,10.30542 ), ('curveTo' ,7.36812,10.30542 ,7.92062,10.53331 ,8.36261,10.98912 ), ('curveTo' ,8.80461,11.44491 ,9.0256,12.02504 ,9.0256,12.72947 ), ('curveTo' ,9.0256,14.16321 ,8.19227,14.88004 ,6.52556,14.88004 ), ('lineTo' ,6.31838,14.88004 ), 'closePath', ('moveTo' ,25.06173,4.54978 ), ('lineTo' ,30.47611,4.45033 ), ('curveTo' ,30.08951,2.88402 ,29.33668,1.70513 ,28.21787,0.91369 ), ('curveTo' ,27.09906,0.12223 ,25.63726,-0.27348 ,23.83245,-0.27348 ), ('curveTo' ,21.69611,-0.27348 ,20.02024,0.32322 ,18.80475,1.5166 ), ('curveTo' ,17.59846,2.72658 ,16.99531,4.37988 ,16.99531,6.47662 ), ('curveTo' ,16.99531,8.6065 ,17.64451,10.34269 ,18.94286,11.68527 ), ('curveTo' ,20.24124,13.03612 ,21.91711,13.71152 ,23.97056,13.71152 ), ('curveTo' ,26.01482,13.71152 ,27.64466,13.06096 ,28.86015,11.75985 ), ('curveTo' ,30.07566,10.45042 ,30.68326,8.71423 ,30.68326,6.5512 ), ('lineTo' ,30.65586,5.66859 ), ('lineTo' ,22.53407,5.66859 ), ('curveTo' ,22.59855,4.29287 ,23.03132,3.60503 ,23.83245,3.60503 ), ('curveTo' ,24.45861,3.60503 ,24.86837,3.91994 ,25.06173,4.54978 ), 'closePath', ('moveTo' ,25.18604,8.35371 ), ('curveTo' ,25.18604,8.60235 ,25.15384,8.83024 ,25.08937,9.03742 ), ('curveTo' ,25.02489,9.24463 ,24.93514,9.42278 ,24.82001,9.57197 ), ('curveTo' ,24.70492,9.72113 ,24.56911,9.83923 ,24.41255,9.92624 ), ('curveTo' ,24.25603,10.01326 ,24.08568,10.05678 ,23.90152,10.05678 ), ('curveTo' ,23.51474,10.05678 ,23.20169,9.89725 ,22.96225,9.57819 ), ('curveTo' ,22.72283,9.25913 ,22.60314,8.85096 ,22.60314,8.35371 ), 'closePath', ('moveTo' ,38.36308,-5.99181 ), ('lineTo' ,32.82428,-5.99181 ), ('lineTo' ,32.82428,13.43804 ), ('lineTo' ,38.36308,13.43804 ), ('lineTo' ,38.23873,11.53608 ), ('curveTo' ,38.46886,11.93387 ,38.70371,12.27159 ,38.94327,12.54922 ), ('curveTo' ,39.18254,12.82685 ,39.44037,13.05268 ,39.71676,13.22671 ), ('curveTo' ,39.99286,13.40074 ,40.28988,13.52712 ,40.60753,13.60585 ), ('curveTo' ,40.92518,13.68459 ,41.27759,13.72396 ,41.66419,13.72396 ), ('curveTo' ,43.10068,13.72396 ,44.2702,13.07755 ,45.17246,11.78472 ), ('curveTo' ,46.06588,10.50844 ,46.51229,8.81368 ,46.51229,6.70038 ), ('curveTo' ,46.51229,4.55394 ,46.08415,2.85502 ,45.22785,1.60362 ), ('curveTo' ,44.38983,0.35221 ,43.23416,-0.27348 ,41.76084,-0.27348 ), ('curveTo' ,40.41659,-0.27348 ,39.24235,0.42679 ,38.23873,1.82739 ), ('curveTo' ,38.2847,1.40472 ,38.31239,1.04007 ,38.32153,0.73345 ), ('curveTo' ,38.34923,0.41851 ,38.36308,0.04146 ,38.36308,-0.3978 ), 'closePath', ('moveTo' ,40.7802,6.84954 ), ('curveTo' ,40.7802,7.72802 ,40.66734,8.40964 ,40.44193,8.89448 ), ('curveTo' ,40.21621,9.37929 ,39.89621,9.62168 ,39.48191,9.62168 ), ('curveTo' ,38.62533,9.62168 ,38.19718,8.68108 ,38.19718,6.79983 ), ('curveTo' ,38.19718,4.87712 ,38.61177,3.91581 ,39.44037,3.91581 ), ('curveTo' ,39.85466,3.91581 ,40.18174,4.1727 ,40.42101,4.68654 ), ('curveTo' ,40.66057,5.20037 ,40.7802,5.92135 ,40.7802,6.84954 ), 'closePath', ('moveTo' ,62.10648,6.51392 ), ('curveTo' ,62.10648,4.44205 ,61.47118,2.79288 ,60.2003,1.56631 ), ('curveTo' ,58.92971,0.33978 ,57.22626,-0.27348 ,55.08965,-0.27348 ), ('curveTo' ,52.99018,-0.27348 ,51.31914,0.35221 ,50.07595,1.60362 ), ('curveTo' ,48.8419,2.8633 ,48.22517,4.55394 ,48.22517,6.67551 ), ('curveTo' ,48.22517,8.79709 ,48.85575,10.50016 ,50.1175,11.78472 ), ('curveTo' ,51.36982,13.07755 ,53.03172,13.72396 ,55.1035,13.72396 ), ('curveTo' ,57.28608,13.72396 ,58.99866,13.08168 ,60.24185,11.79712 ), ('curveTo' ,61.48503,10.51259 ,62.10648,8.75154 ,62.10648,6.51392 ), 'closePath', ('moveTo' ,56.73358,6.67551 ), ('curveTo' ,56.73358,7.17276 ,56.69675,7.62236 ,56.62308,8.02428 ), ('curveTo' ,56.54942,8.42623 ,56.44334,8.77016 ,56.30544,9.05607 ), ('curveTo' ,56.16724,9.34198 ,56.00134,9.56369 ,55.80804,9.72113 ), ('curveTo' ,55.61474,9.8786 ,55.39817,9.95733 ,55.1589,9.95733 ), ('curveTo' ,54.68921,9.95733 ,54.31174,9.65898 ,54.02621,9.06229 ), ('curveTo' ,53.74068,8.54018 ,53.59807,7.75702 ,53.59807,6.71282 ), ('curveTo' ,53.59807,5.68515 ,53.74068,4.90202 ,54.02621,4.36332 ), ('curveTo' ,54.31174,3.76663 ,54.69392,3.46828 ,55.17275,3.46828 ), ('curveTo' ,55.62388,3.46828 ,55.99692,3.7625 ,56.29159,4.35088 ), ('curveTo' ,56.58625,5.0056 ,56.73358,5.78047 ,56.73358,6.67551 ), 'closePath', ('moveTo' ,69.78629,0 ), ('lineTo' ,64.2475,0 ), ('lineTo' ,64.2475,13.43804 ), ('lineTo' ,69.78629,13.43804 ), ('lineTo' ,69.49605,10.81507 ), ('curveTo' ,70.33407,12.77921 ,71.71988,13.76126 ,73.65346,13.76126 ), ('lineTo' ,73.65346,8.16725 ), ('curveTo' ,73.04586,8.4656 ,72.5302,8.61478 ,72.10647,8.61478 ), ('curveTo' ,71.36068,8.61478 ,70.78756,8.37236 ,70.38711,7.88755 ), ('curveTo' ,69.98637,7.40274 ,69.78629,6.69623 ,69.78629,5.76804 ), 'closePath', ('moveTo' ,81.55427,0 ), ('lineTo' ,76.00163,0 ), ('lineTo' ,76.00163,9.42278 ), ('lineTo' ,74.42725,9.42278 ), ('lineTo' ,74.42725,13.43804 ), ('lineTo' ,76.00163,13.43804 ), ('lineTo' ,76.00163,17.39113 ), ('lineTo' ,81.55427,17.39113 ), ('lineTo' ,81.55427,13.43804 ), ('lineTo' ,83.39121,13.43804 ), ('lineTo' ,83.39121,9.42278 ), ('lineTo' ,81.55427,9.42278 ), 'closePath', ('moveTo' ,95.17333,0 ), ('lineTo' ,85.09024,0 ), ('lineTo' ,85.09024,19.19365 ), ('lineTo' ,90.85002,19.19365 ), ('lineTo' ,90.85002,4.61196 ), ('lineTo' ,95.17333,4.61196 ), 'closePath', ('moveTo' ,110.00787,0 ), ('lineTo' ,104.45523,0 ), ('curveTo' ,104.5012,0.44754 ,104.53803,0.87433 ,104.56573,1.2804 ), ('curveTo' ,104.59313,1.68651 ,104.62083,2.01385 ,104.64853,2.26246 ), ('curveTo' ,103.69087,0.57182 ,102.40644,-0.27348 ,100.79492,-0.27348 ), ('curveTo' ,99.39527,-0.27348 ,98.28557,0.35637 ,97.46611,1.61605 ), ('curveTo' ,96.65578,2.86746 ,96.25062,4.59952 ,96.25062,6.81227 ), ('curveTo' ,96.25062,8.95041 ,96.66963,10.63276 ,97.50765,11.8593 ), ('curveTo' ,98.34538,13.10242 ,99.4872,13.72396 ,100.93312,13.72396 ), ('curveTo' ,102.41557,13.72396 ,103.61249,12.92008 ,104.52418,11.31231 ), ('curveTo' ,104.50591,11.47806 ,104.49206,11.62309 ,104.48293,11.74741 ), ('curveTo' ,104.4735,11.87173 ,104.46437,11.9753 ,104.45523,12.05819 ), ('lineTo' ,104.39983,12.84135 ), ('lineTo' ,104.35858,13.43804 ), ('lineTo' ,110.00787,13.43804 ), 'closePath', ('moveTo' ,104.39983,6.88685 ), ('curveTo' ,104.39983,7.38409 ,104.37921,7.80676 ,104.33766,8.15481 ), ('curveTo' ,104.29641,8.5029 ,104.22952,8.78672 ,104.13758,9.00636 ), ('curveTo' ,104.04535,9.22598 ,103.92572,9.38341 ,103.77839,9.47874 ), ('curveTo' ,103.63106,9.57403 ,103.45161,9.62168 ,103.23974,9.62168 ), ('curveTo' ,102.30036,9.62168 ,101.83096,8.49875 ,101.83096,6.25285 ), ('curveTo' ,101.83096,4.64508 ,102.24967,3.8412 ,103.0877,3.8412 ), ('curveTo' ,103.96255,3.8412 ,104.39983,4.85641 ,104.39983,6.88685 ), 'closePath', ('moveTo' ,118.22604,0 ), ('lineTo' ,112.5629,0 ), ('lineTo' ,112.5629,20.99616 ), ('lineTo' ,118.10169,20.99616 ), ('lineTo' ,118.10169,13.63694 ), ('curveTo' ,118.10169,13.01538 ,118.07399,12.30268 ,118.01889,11.49877 ), ('curveTo' ,118.52542,12.31096 ,119.03636,12.88693 ,119.55202,13.22671 ), ('curveTo' ,120.08625,13.55821 ,120.75838,13.72396 ,121.5687,13.72396 ), ('curveTo' ,123.07885,13.72396 ,124.24837,13.09827 ,125.07697,11.84686 ), ('curveTo' ,125.90586,10.60373 ,126.32015,8.85099 ,126.32015,6.5885 ), ('curveTo' ,126.32015,4.42546 ,125.89201,2.74314 ,125.03571,1.54147 ), ('curveTo' ,124.18826,0.3315 ,123.01432,-0.27348 ,121.51331,-0.27348 ), ('curveTo' ,120.78608,-0.27348 ,120.16905,-0.12432 ,119.66252,0.17403 ), ('curveTo' ,119.41383,0.3315 ,119.15835,0.54283 ,118.8961,0.80803 ), ('curveTo' ,118.63356,1.07322 ,118.36866,1.40472 ,118.10169,1.80252 ), ('curveTo' ,118.11112,1.64505 ,118.12025,1.51039 ,118.12939,1.3985 ), ('curveTo' ,118.13852,1.28662 ,118.14766,1.19339 ,118.15709,1.11881 ), 'closePath', ('moveTo' ,120.58806,6.70038 ), ('curveTo' ,120.58806,8.62306 ,120.11837,9.5844 ,119.17898,9.5844 ), ('curveTo' ,118.35039,9.5844 ,117.93609,8.67693 ,117.93609,6.86198 ), ('curveTo' ,117.93609,4.96417 ,118.36424,4.01526 ,119.22053,4.01526 ), ('curveTo' ,120.13222,4.01526 ,120.58806,4.91027 ,120.58806,6.70038 ), 'closePath', ('moveTo',38.30626,-7.28346),('lineTo',38.30626,-25.55261),('lineTo',85.15777,-25.55261),('lineTo',85.15777,-1.39019),('lineTo',90.46172,-1.39019),('lineTo',90.46172,-31.15121),('lineTo',32.70766,-31.15121),('lineTo',32.70766,-7.28346), 'closePath', ('moveTo' ,32.70766,14.52164 ), ('lineTo' ,32.70766,47.81862 ), ('lineTo' ,80.14849,47.81862 ), ('lineTo' ,90.46172,37.21073 ), ('lineTo' ,90.46172,20.12025 ), ('lineTo' ,85.15777,20.12025 ), ('lineTo' ,85.15777,30.72814 ), ('lineTo' ,73.66589,30.72814 ), ('lineTo' ,73.66589,42.22002 ), ('lineTo' ,38.30626,42.22002 ), ('lineTo' ,38.30626,14.52164 ), 'closePath', ('moveTo' ,79.2645,36.32674 ), ('lineTo' ,85.15777,36.32674 ), ('lineTo' ,79.2645,42.22002 ), 'closePath', ], strokeColor=strokeColor,strokeWidth=strokeWidth,fillColor=fillColor, dx=dx, dy=dy))
52735650fe65e7b701c80dd27326b3086bdc15b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/52735650fe65e7b701c80dd27326b3086bdc15b9/corp.py
self._paintLogo(g,fillColor=fillColor) g.skew(kx=10, ky=0) g.shift(0,35.5)
self._paintLogo(g,fillColor=fillColor,strokeColor=strokeColor) g.skew(kx=self.skewX, ky=self.skewY) g.shift(self._dx,self._dy)
def draw(self): fillColor = self.fillColor strokeColor = self.strokeColor g = Group() bg = self.background shadow = self.shadow if bg: shadow = Color(bg.red*shadow,bg.green*shadow,bg.blue*shadow) self._paintLogo(g,dy=-2.5, dx=2,fillColor=shadow) self._paintLogo(g,fillColor=fillColor) g.skew(kx=10, ky=0) g.shift(0,35.5) G = Group() G.add(g) _w, _h = 129, 86 w, h = self.width, self.height if w!=_w or h!=_h: G.scale(w/float(_w),h/float(_h)) if bg is not None: G.insert(0,Rect(0,0,w,h,fillColor=bg,strokeColor=None))
52735650fe65e7b701c80dd27326b3086bdc15b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/52735650fe65e7b701c80dd27326b3086bdc15b9/corp.py
G.shift(self.x,self.y)
G.shift(x,y)
def draw(self): fillColor = self.fillColor strokeColor = self.strokeColor g = Group() bg = self.background shadow = self.shadow if bg: shadow = Color(bg.red*shadow,bg.green*shadow,bg.blue*shadow) self._paintLogo(g,dy=-2.5, dx=2,fillColor=shadow) self._paintLogo(g,fillColor=fillColor) g.skew(kx=10, ky=0) g.shift(0,35.5) G = Group() G.add(g) _w, _h = 129, 86 w, h = self.width, self.height if w!=_w or h!=_h: G.scale(w/float(_w),h/float(_h)) if bg is not None: G.insert(0,Rect(0,0,w,h,fillColor=bg,strokeColor=None))
52735650fe65e7b701c80dd27326b3086bdc15b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/52735650fe65e7b701c80dd27326b3086bdc15b9/corp.py
n = len(vals)-1
n = len(vals)
def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): #print "cellstyle is ", repr(cellstyle), id(cellstyle) if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: #print "setting cell color to %s" % `cellstyle.color` self.canv.setFillColor(cellstyle.color) if cur is None or cellstyle.leading != cur.leading or cellstyle.fontname != cur.fontname or cellstyle.fontsize != cur.fontsize: #print "setting font: %s, %s, %s" % (cellstyle.fontname, cellstyle.fontsize, cellstyle.leading) self.canv.setFont(cellstyle.fontname, cellstyle.fontsize, cellstyle.leading) self._curcellstyle = cellstyle #print "leading is ", cellstyle.leading, "size is", cellstyle.fontsize just = cellstyle.alignment #print "alignment is ", just if just == 'LEFT': draw = self.canv.drawString x = colpos + cellstyle.leftPadding elif just in ('CENTRE', 'CENTER'): draw = self.canv.drawCentredString x = colpos + colwidth * 0.5 elif just == 'RIGHT': draw = self.canv.drawRightString x = colpos + colwidth - cellstyle.rightPadding else: raise ValueError, 'Invalid justification %s' % just
05bfe223624d1df66401c7f78a6ac81f78006d39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/05bfe223624d1df66401c7f78a6ac81f78006d39/tables.py