bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def pfxJoin(pfx,*N): R=[] for n in N: R.append(pJoin(pfx,n)) return R
def pfxJoin(pfx,*N): R=[] for n in N: R.append(pJoin(pfx,n)) return R
4,700
def pfxJoin(pfx,*N): R=[] for n in N: R.append(pJoin(pfx,n)) return R
def pfxJoin(pfx,*N): R=[] for n in N: R.append(pJoin(pfx,n)) return R
4,701
def pfxJoin(pfx,*N): R=[] for n in N: R.append(pJoin(pfx,n)) return R
def pfxJoin(pfx,*N): R=[] for n in N: R.append(pJoin(pfx,n)) return R
4,702
def makeSectors(self): # normalize slice data if type(self.data) in (ListType, TupleType) and type(self.data[0]) in (ListType, TupleType): #it's a nested list, more than one sequence normData = [] n = [] for l in self.data: t = self.normalizeData(l) normData.append(t) n.append(len(t)) else: normData = self.normalizeData(self.data) n = len(normData)
def makeSectors(self): # normalize slice data if type(self.data) in (ListType, TupleType) and type(self.data[0]) in (ListType, TupleType): #it's a nested list, more than one sequence normData = [] n = [] for l in self.data: t = self.normalizeData(l) normData.append(t) n.append(len(t)) else: normData = self.normalizeData(self.data) n = len(normData)
4,703
def makeSectors(self): # normalize slice data if type(self.data) in (ListType, TupleType) and type(self.data[0]) in (ListType, TupleType): #it's a nested list, more than one sequence normData = [] n = [] for l in self.data: t = self.normalizeData(l) normData.append(t) n.append(len(t)) else: normData = self.normalizeData(self.data) n = len(normData)
def makeSectors(self): # normalize slice data if type(self.data) in (ListType, TupleType) and type(self.data[0]) in (ListType, TupleType): #it's a nested list, more than one sequence normData = [] n = [] for l in self.data: t = self.normalizeData(l) normData.append(t) n.append(len(t)) else: normData = self.normalizeData(self.data) n = len(normData)
4,704
def makeSectors(self): # normalize slice data if type(self.data) in (ListType, TupleType) and type(self.data[0]) in (ListType, TupleType): #it's a nested list, more than one sequence normData = [] n = [] for l in self.data: t = self.normalizeData(l) normData.append(t) n.append(len(t)) else: normData = self.normalizeData(self.data) n = len(normData)
def makeSectors(self): # normalize slice data if type(self.data) in (ListType, TupleType) and type(self.data[0]) in (ListType, TupleType): #it's a nested list, more than one sequence normData = [] n = [] for l in self.data: t = self.normalizeData(l) normData.append(t) n.append(len(t)) else: normData = self.normalizeData(self.data) n = len(normData)
4,705
def getSubsetInternalName(self, subset, doc): '''Returns the name of a PDF Font object corresponding to a given subset of this dynamic font. Use this function instead of PDFDocument.getInternalFontName.'''
def getSubsetInternalName(self, subset, doc): '''Returns the name of a PDF Font object corresponding to a given subset of this dynamic font. Use this function instead of PDFDocument.getInternalFontName.'''
4,706
def extractInfo(self, charInfo=1): """Extract typographic information from the loaded font file.
def extractInfo(self, charInfo=1): """Extract typographic information from the loaded font file.
4,707
def makeSubset(self, subset): """Create a subset of a TrueType font""" output = TTFontMaker()
def makeSubset(self, subset): """Create a subset of a TrueType font""" output = TTFontMaker()
4,708
def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word list
def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word list
4,709
def _Flag_Palestine(self): s = _size g = Group() box = Rect(0, s/3, s*2, s/3, fillColor = colors.mintcream, strokeColor = colors.black, strokeWidth=0) g.add(box)
def _Flag_Palestine(self): s = _size g = Group() box = Rect(0, s/3, s*2, s/3, fillColor = colors.mintcream, strokeColor = None, strokeWidth=0) g.add(box)
4,710
def run(format, VERBOSE=0): formats = string.split(format, ',') for i in range(0, len(formats)): formats[i] == string.lower(string.strip(formats[i])) allfiles = glob.glob('*.py') allfiles.sort() for fn in allfiles: f = string.split(fn, '.')[0] c = getclass(f) if c != None: print c.__name__ try: for f in formats: if f: c().save(formats=[f],outDir='.',fnRoot=c.__name__) if VERBOSE: print " %s.%s" % (c.__name__, f) except: print " COULDN'T CREATE '%s.%s'!" % (c.__name__, format)
def run(format, VERBOSE=0): formats = string.split(format, ',') for i in range(0, len(formats)): formats[i] == string.lower(string.strip(formats[i])) allfiles = glob.glob('*.py') allfiles.sort() for fn in allfiles: f = string.split(fn, '.')[0] c = getclass(f) if c != None: print c.__name__ try: for fmt in formats: if fmt: c().save(formats=[fmt],outDir='.',fnRoot=c.__name__) if VERBOSE: print " %s.%s" % (c.__name__, f) except: print " COULDN'T CREATE '%s.%s'!" % (c.__name__, format)
4,711
def run(format, VERBOSE=0): formats = string.split(format, ',') for i in range(0, len(formats)): formats[i] == string.lower(string.strip(formats[i])) allfiles = glob.glob('*.py') allfiles.sort() for fn in allfiles: f = string.split(fn, '.')[0] c = getclass(f) if c != None: print c.__name__ try: for f in formats: if f: c().save(formats=[f],outDir='.',fnRoot=c.__name__) if VERBOSE: print " %s.%s" % (c.__name__, f) except: print " COULDN'T CREATE '%s.%s'!" % (c.__name__, format)
def run(format, VERBOSE=0): formats = string.split(format, ',') for i in range(0, len(formats)): formats[i] == string.lower(string.strip(formats[i])) allfiles = glob.glob('*.py') allfiles.sort() for fn in allfiles: f = string.split(fn, '.')[0] c = getclass(f) if c != None: print c.__name__ try: for f in formats: if f: c().save(formats=[f],outDir='.',fnRoot=c.__name__) if VERBOSE: print " %s.%s" % (c.__name__, fmt) except: print " COULDN'T CREATE '%s.%s'!" % (c.__name__, format)
4,712
def rgb2cmyk(r,g,b): c = 1 - r m = 1 - g y = 1 - b k = min(c,m,y) c = min(1,max(0,c-k) m = min(1,max(0,m-k) y = min(1,max(0,y-k) k = min(1,max(0,k)) return (c,m,y,k)
def rgb2cmyk(r,g,b): c = 1 - r m = 1 - g y = 1 - b k = min(c,m,y) c = min(1,max(0,c-k)) m = min(1,max(0,m-k)) y = min(1,max(0,y-k)) k = min(1,max(0,k)) return (c,m,y,k)
4,713
def __repr__(self): bT = self.bulletText H = "Preformatted(" if bT is not None: H = "Preformatted(bulletText=%s," % repr(bT) import string text = join(self.lines, "\n") return "%s'''\\ \n%s''')" % (H, text)
def __repr__(self): bT = self.bulletText H = "Preformatted(" if bT is not None: H = "Preformatted(bulletText=%s," % repr(bT) import string text = join(self.lines, "\n") return "%s'''\\ \n%s''')" % (H, text)
4,714
def _listCellGeom(self, V,w,s,W=None,H=None,aH=72000): aW = w-s.leftPadding-s.rightPadding aH = aH - s.topPadding - s.bottomPadding t = 0 w = 0 canv = getattr(self,'canv',None) for v in V: vw, vh = v.wrapOn(canv,aW, aH) if W is not None: W.append(vw) if H is not None: H.append(vh) w = max(w,vw) t = t + vh + v.getSpaceBefore()+v.getSpaceAfter() else: return w, t return w, t - V[0].getSpaceBefore()-V[-1].getSpaceAfter()
def _listCellGeom(self, V,w,s,W=None,H=None,aH=72000): aW = w-s.leftPadding-s.rightPadding aH = aH - s.topPadding - s.bottomPadding t = 0 w = 0 canv = getattr(self,'canv',None) for v in V: vw, vh = v.wrapOn(canv,aW, aH) if W is not None: W.append(vw) if H is not None: H.append(vh) w = max(w,vw) t = t + vh + v.getSpaceBefore()+v.getSpaceAfter() return w, t - V[0].getSpaceBefore()-V[-1].getSpaceAfter()
4,715
def failTest(x,t,tb=1,**kw): goodTest(x,t,tb,**kw)
def failTest(x,t,tb=1,**kw): goodTest(x,t,tb,**kw)
4,716
def demo(self): d = Drawing(200, 100)
defdemo(self):d=Drawing(200,100)
4,717
def normalizeData(self): sum = 0.0 for number in self.data: sum = sum + number
def normalizeData(self): sum = 0.0 for number in self.data: sum = sum + number
4,718
def bitmap_rgb(self): return tuple(map(lambda x: int((x*255)&255), self.rgb()))
def bitmap_rgb(self): return tuple(map(lambda x: int((x*255)&255), self.rgb()))
4,719
def _reduceDocStringLength(docStr): "Return first line of a multiline string." return split(docStr, '\n')[0]
def reduceDocStringLength(docStr): "Return first line of a multiline string." return split(docStr, '\n')[0]
4,720
def beginModule(self, name, doc, imported): append = self.outLines.append lev, label = self.indentLevel, self.indentLabel self.outLines.append('%sModule: %s' % (lev*label, name))
def beginModule(self, name, doc, imported): append = self.outLines.append lev, label = self.indentLevel, self.indentLabel self.outLines.append('%sModule: %s' % (lev*label, name))
4,721
def beginClass(self, name, doc, bases): append = self.outLines.append lev, label = self.indentLevel, self.indentLabel
def beginClass(self, name, doc, bases): append = self.outLines.append lev, label = self.indentLevel, self.indentLabel
4,722
def beginMethod(self, name, doc, sig): append = self.outLines.append lev, label = self.indentLevel, self.indentLabel append('%s%s%s' % (lev*label, name, sig))
def beginMethod(self, name, doc, sig): append = self.outLines.append lev, label = self.indentLevel, self.indentLabel append('%s%s%s' % (lev*label, name, sig))
4,723
def beginFunction(self, name, doc, sig): append = self.outLines.append lev, label = self.indentLevel, self.indentLabel self.outLines.append('%s%s%s' % (lev*label, name, sig))
def beginFunction(self, name, doc, sig): append = self.outLines.append lev, label = self.indentLevel, self.indentLabel self.outLines.append('%s%s%s' % (lev*label, name, sig))
4,724
def printUsage(): """docpy0.py - Automated documentation for Python source code.
def printUsage(): """docpy0.py - Automated documentation for Python source code.
4,725
def printUsage(): """docpy0.py - Automated documentation for Python source code.
def printUsage(): """docpy0.py - Automated documentation for Python source code.
4,726
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)
def documentModule0(path, builder=PdfDocBuilder0()): """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)
4,727
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
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
4,728
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)
def documentPackage0(pathOrName, builder=PdfDocBuilder0()): """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)
4,729
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)
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. """ if string.find(pathOrName, os.sep) > -1: name = os.path.splitext(os.path.basename(pathOrName))[0] path = pathOrName 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)
4,730
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)
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__(pathOrName) if '.' in pathOrName: subname = 'package' + pathOrName[string.find(pathOrName, '.'):] package = eval(subname) name = pathOrName path = os.path.dirname(package.__file__) cwd = os.getcwd() builder.beginPackage(name) os.path.walk(path, _packageWalkCallback, builder) builder.endPackage(name) os.chdir(cwd)
4,731
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)
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)
4,732
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)
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)
4,733
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)
defmain():"""Handlecommand-lineoptionsandtriggercorrespondingaction."""opts,args=getopt.getopt(sys.argv[1:],'hf:m:p:')#On-hprintusageandexitimmediately.foro,ainopts:ifo=='-h':printprintUsage.__doc__#printUsage()sys.exit(0)#On-fsettheDocBuildertouseoradefaultone.builder=DocBuilder0()foro,ainopts:ifo=='-f':builder=eval("%sDocBuilder0()"%a)break#Nowcalltherealdocumentationfunctions.foro,ainopts:ifo=='-m':builder.begin()documentModule0(a,builder)builder.end()sys.exit(0)elifo=='-p':builder.begin()documentPackage0(a,builder)builder.end()sys.exit(0)
4,734
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)
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 = PdfDocBuilder0() 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)
4,735
def cache_imagedata(self): image = self.image if not pdfutils.cachedImageExists(image): if not zlib: print 'zlib not available' return try: import Image except ImportError: print 'Python Imaging Library not available' return pdfutils.cacheImageFile(image)
def cache_imagedata(self): image = self.image if not pdfutils.cachedImageExists(image): if not zlib: warnOnce('zlib not available') return try: import Image except ImportError: print 'Python Imaging Library not available' return pdfutils.cacheImageFile(image)
4,736
def cache_imagedata(self): image = self.image if not pdfutils.cachedImageExists(image): if not zlib: print 'zlib not available' return try: import Image except ImportError: print 'Python Imaging Library not available' return pdfutils.cacheImageFile(image)
def cache_imagedata(self): image = self.image if not pdfutils.cachedImageExists(image): if not zlib: print 'zlib not available' return try: import Image except ImportError: warnOnce('Python Imaging Library not available') return pdfutils.cacheImageFile(image)
4,737
def PIL_imagedata(self): image = self.image if not zlib: print 'zlib not available' return myimage = image.convert('RGB') imgwidth, imgheight = myimage.size
def PIL_imagedata(self): image = self.image myimage = image.convert('RGB') imgwidth, imgheight = myimage.size
4,738
def PIL_imagedata(self): image = self.image if not zlib: print 'zlib not available' return myimage = image.convert('RGB') imgwidth, imgheight = myimage.size
def PIL_imagedata(self): image = self.image if not zlib: print 'zlib not available' return myimage = image.convert('RGB') imgwidth, imgheight = myimage.size
4,739
def sample3(drawing=None): "Add sample swatches to a diagram." d = drawing swatches = Legend0() swatches.alignment = 'right' swatches.x = 80 swatches.y = 160 swatches.deltax = 60 swatches.dxTextSpace = 10 swatches.columnMaximum = 4 items = [(colors.red, 'before'), (colors.green, 'after')] swatches.colorNamePairs = items d.add(swatches, 'legend') return d
def sample3(drawing=None): "Add sample swatches to a diagram." d = drawing or Drawing(400, 200) swatches = Legend0() swatches.alignment = 'right' swatches.x = 80 swatches.y = 160 swatches.deltax = 60 swatches.dxTextSpace = 10 swatches.columnMaximum = 4 items = [(colors.red, 'before'), (colors.green, 'after')] swatches.colorNamePairs = items d.add(swatches, 'legend') return d
4,740
def get_rl_tempfile(fn=None): if not fn: import tempfile return tempfile.mktemp('','',get_rl_tempdir()) else: return os.path.join(get_rl_tempdir(),fn)
def get_rl_tempfile(fn=None): if not fn: import tempfile fn = tempfile.mktemp() return os.path.join(get_rl_tempdir(),fn)
4,741
def split(self,availWidth, availHeight): if len(self.frags)<=0: return []
def split(self,availWidth, availHeight): if len(self.frags)<=0: return []
4,742
def flagged(i,TESTS=TESTS): return 'all' in TESTS or '*' in TESTS or str(i) in TESTS
def flagged(i,TESTS=TESTS): return 'all' in TESTS or '*' in TESTS or str(i) in TESTS
4,743
def multiBuild(self, story, filename=None, canvasmaker=canvas.Canvas, maxPasses = 10): """Makes multiple passes until all indexing flowables are happy.""" self._indexingFlowables = [] #scan the story and keep a copy for thing in story: if thing.isIndexing(): self._indexingFlowables.append(thing) #print 'scanned story, found these indexing flowables:\n' #print self._indexingFlowables
defif isFile and not hasSeek: filename = filename._filename multiBuild(self,if isFile and not hasSeek: filename = filename._filename story,if isFile and not hasSeek: filename = filename._filename filename=None,if isFile and not hasSeek: filename = filename._filename canvasmaker=canvas.Canvas,if isFile and not hasSeek: filename = filename._filename maxPassesif isFile and not hasSeek: filename = filename._filename =if isFile and not hasSeek: filename = filename._filename 10):if isFile and not hasSeek: filename = filename._filename """Makesif isFile and not hasSeek: filename = filename._filename multipleif isFile and not hasSeek: filename = filename._filename passesif isFile and not hasSeek: filename = filename._filename untilif isFile and not hasSeek: filename = filename._filename allif isFile and not hasSeek: filename = filename._filename indexingif isFile and not hasSeek: filename = filename._filename flowablesif isFile and not hasSeek: filename = filename._filename areif isFile and not hasSeek: filename = filename._filename happy."""if isFile and not hasSeek: filename = filename._filename self._indexingFlowablesif isFile and not hasSeek: filename = filename._filename =if isFile and not hasSeek: filename = filename._filename []if isFile and not hasSeek: filename = filename._filename #scanif isFile and not hasSeek: filename = filename._filename theif isFile and not hasSeek: filename = filename._filename storyif isFile and not hasSeek: filename = filename._filename andif isFile and not hasSeek: filename = filename._filename keepif isFile and not hasSeek: filename = filename._filename aif isFile and not hasSeek: filename = filename._filename copyif isFile and not hasSeek: filename = filename._filename forif isFile and not hasSeek: filename = filename._filename thingif isFile and not hasSeek: filename = filename._filename inif isFile and not hasSeek: filename = filename._filename story:if isFile and not hasSeek: filename = filename._filename ifif isFile and not hasSeek: filename = filename._filename thing.isIndexing():if isFile and not hasSeek: filename = filename._filename self._indexingFlowables.append(thing)if isFile and not hasSeek: filename = filename._filename #printif isFile and not hasSeek: filename = filename._filename 'scannedif isFile and not hasSeek: filename = filename._filename story,if isFile and not hasSeek: filename = filename._filename foundif isFile and not hasSeek: filename = filename._filename theseif isFile and not hasSeek: filename = filename._filename indexingif isFile and not hasSeek: filename = filename._filename flowables:\n'if isFile and not hasSeek: filename = filename._filename #printif isFile and not hasSeek: filename = filename._filename self._indexingFlowables
4,744
def multiBuild(self, story, filename=None, canvasmaker=canvas.Canvas, maxPasses = 10): """Makes multiple passes until all indexing flowables are happy.""" self._indexingFlowables = [] #scan the story and keep a copy for thing in story: if thing.isIndexing(): self._indexingFlowables.append(thing) #print 'scanned story, found these indexing flowables:\n' #print self._indexingFlowables
def multiBuild(self, story, filename=None, canvasmaker=canvas.Canvas, maxPasses = 10): """Makes multiple passes until all indexing flowables are happy.""" self._indexingFlowables = [] #scan the story and keep a copy for thing in story: if thing.isIndexing(): self._indexingFlowables.append(thing) #print 'scanned story, found these indexing flowables:\n' #print self._indexingFlowables
4,745
def getProperties(self,recur=1): # return any children which are defined and whatever # differs from the parent props = {}
def getProperties(self,recur=1): # return any children which are defined and whatever # differs from the parent props = {}
4,746
def getProperties(self,recur=1): # return any children which are defined and whatever # differs from the parent props = {}
defgetProperties(self,recur=1):#returnanychildrenwhicharedefinedandwhatever#differsfromtheparentprops={}
4,747
def _setRange(self, dataSeries): """Set minimum and maximum axis values.
def _setRange(self, dataSeries): """Set minimum and maximum axis values.
4,748
def _setRange(self, dataSeries): """Set minimum and maximum axis values.
def _setRange(self, dataSeries): """Set minimum and maximum axis values.
4,749
def drawImage(self, image, x, y, width=None, height=None, mask=None): """Draws the image (PIL Image object or filename) as specified.
def drawImage(self, image, x, y, width=None, height=None, mask=None): """Draws the image (PIL Image object or filename) as specified.
4,750
def drawImage(self, image, x, y, width=None, height=None, mask=None): """Draws the image (PIL Image object or filename) as specified.
def drawImage(self, image, x, y, width=None, height=None, mask=None): """Draws the image (PIL Image object or filename) as specified.
4,751
def moveCursor(self, dx, dy): """Moves to a point dx, dy away from the start of the current line - NOT from the current point! So if you call it in mid-sentence, watch out.""" if self._code[-1][-3:]==' Td': L = string.split(self._code[-1]) if len(L)==3: del self._code[-1] else: self._code[-1] = string.join(L[:-4]) if dx<>0 or dy<>0: self._code.append('%s Td' % fp_str(dx, -dy))
def moveCursor(self, dx, dy): """Moves to a point dx, dy away from the start of the current line - NOT from the current point! So if you call it in mid-sentence, watch out.""" if len(self._code) and self._code[-1][-3:]==' Td': L = string.split(self._code[-1]) if len(L)==3: del self._code[-1] else: self._code[-1] = string.join(L[:-4]) if dx<>0 or dy<>0: self._code.append('%s Td' % fp_str(dx, -dy))
4,752
def Paragraph(text, style, bulletText=None, frags=None)
def Paragraph(text, style, bulletText=None, frags=None)
4,753
def readColor(text): """Read color names or tuples, RGB or CMYK, and return a Color object.""" if not text: return None from reportlab.lib import colors if text[0] in LETTERS: return colors.__dict__[text] tup = lengthSequence(text) msg = "Color tuple must have 3 (or 4) elements for RGB (or CMYC)." assert 3 <= len(tup) <= 4, msg msg = "Color tuple must have all elements <= 1.0." for i in range(len(tup)): assert tup[i] <= 1.0, msg if len(tup) == 3: colClass = colors.Color elif len(tup) == 4: colClass = colors.CMYKColor return apply(colClass, tup)
def readColor(text): """Read color names or tuples, RGB or CMYK, and return a Color object.""" if not text: return None from reportlab.lib import colors from string import letters if text[0] in letters: return colors.__dict__[text] tup = lengthSequence(text) msg = "Color tuple must have 3 (or 4) elements for RGB (or CMYC)." assert 3 <= len(tup) <= 4, msg msg = "Color tuple must have all elements <= 1.0." for i in range(len(tup)): assert tup[i] <= 1.0, msg if len(tup) == 3: colClass = colors.Color elif len(tup) == 4: colClass = colors.CMYKColor return apply(colClass, tup)
4,754
def handleSpecialCharacters(engine, text, program=None): from paraparser import greeks, symenc from string import whitespace standard={'lt':'<', 'gt':'>', 'amp':'&'} # add space prefix if space here if text[0:1] in whitespace: program.append(" ") #print "handling", repr(text) # shortcut if 0 and "&" not in text: result = [] for x in text.split(): result.append(x+" ") if result: last = result[-1] if text[-1:] not in whitespace: result[-1] = last.strip() program.extend(result) return program if program is None: program = [] amptext = text.split("&") first = 1 lastfrag = amptext[-1] for fragment in amptext: if not first: # check for special chars semi = fragment.find(";") if semi>0: name = fragment[:semi] if name[0]=='#': try: if name[1] == 'x': n = atoi(name[2:], 16) else: n = atoi(name[1:]) except atoi_error: n = -1 if 0<=n<=255: fragment = chr(n)+fragment[semi+1:] elif symenc.has_key(n): fragment = fragment[semi+1:] (f,b,i) = engine.shiftfont(program, face="symbol") program.append(symenc[n]) engine.shiftfont(program, face=f) if fragment and fragment[0] in WHITESPACE: program.append(" ") # follow with a space else: fragment = "&"+fragment elif standard.has_key(name): fragment = standard[name]+fragment[semi+1:] elif greeks.has_key(name): fragment = fragment[semi+1:] greeksub = greeks[name] (f,b,i) = engine.shiftfont(program, face="symbol") program.append(greeksub) engine.shiftfont(program, face=f) if fragment and fragment[0] in WHITESPACE: program.append(" ") # follow with a space else: # add back the & fragment = "&"+fragment else: # add back the & fragment = "&"+fragment # add white separated components of fragment followed by space sfragment = fragment.split() for w in sfragment[:-1]: program.append(w+" ") # does the last one need a space? if sfragment and fragment: # reader 3 used to go nuts if you don't special case the last frag, but it's fixed? if fragment[-1] in WHITESPACE: # or fragment==lastfrag: program.append( sfragment[-1]+" " ) else: last = sfragment[-1].strip() if last: #print "last is", repr(last) program.append( last ) first = 0 #print "HANDLED", program return program
def handleSpecialCharacters(engine, text, program=None): from paraparser import greeks, symenc from string import whitespace, atoi, atoi_error standard={'lt':'<', 'gt':'>', 'amp':'&'} # add space prefix if space here if text[0:1] in whitespace: program.append(" ") #print "handling", repr(text) # shortcut if 0 and "&" not in text: result = [] for x in text.split(): result.append(x+" ") if result: last = result[-1] if text[-1:] not in whitespace: result[-1] = last.strip() program.extend(result) return program if program is None: program = [] amptext = text.split("&") first = 1 lastfrag = amptext[-1] for fragment in amptext: if not first: # check for special chars semi = fragment.find(";") if semi>0: name = fragment[:semi] if name[0]=='#': try: if name[1] == 'x': n = atoi(name[2:], 16) else: n = atoi(name[1:]) except atoi_error: n = -1 if 0<=n<=255: fragment = chr(n)+fragment[semi+1:] elif symenc.has_key(n): fragment = fragment[semi+1:] (f,b,i) = engine.shiftfont(program, face="symbol") program.append(symenc[n]) engine.shiftfont(program, face=f) if fragment and fragment[0] in WHITESPACE: program.append(" ") # follow with a space else: fragment = "&"+fragment elif standard.has_key(name): fragment = standard[name]+fragment[semi+1:] elif greeks.has_key(name): fragment = fragment[semi+1:] greeksub = greeks[name] (f,b,i) = engine.shiftfont(program, face="symbol") program.append(greeksub) engine.shiftfont(program, face=f) if fragment and fragment[0] in WHITESPACE: program.append(" ") # follow with a space else: # add back the & fragment = "&"+fragment else: # add back the & fragment = "&"+fragment # add white separated components of fragment followed by space sfragment = fragment.split() for w in sfragment[:-1]: program.append(w+" ") # does the last one need a space? if sfragment and fragment: # reader 3 used to go nuts if you don't special case the last frag, but it's fixed? if fragment[-1] in WHITESPACE: # or fragment==lastfrag: program.append( sfragment[-1]+" " ) else: last = sfragment[-1].strip() if last: #print "last is", repr(last) program.append( last ) first = 0 #print "HANDLED", program return program
4,755
def handleSpecialCharacters(engine, text, program=None): from paraparser import greeks, symenc from string import whitespace standard={'lt':'<', 'gt':'>', 'amp':'&'} # add space prefix if space here if text[0:1] in whitespace: program.append(" ") #print "handling", repr(text) # shortcut if 0 and "&" not in text: result = [] for x in text.split(): result.append(x+" ") if result: last = result[-1] if text[-1:] not in whitespace: result[-1] = last.strip() program.extend(result) return program if program is None: program = [] amptext = text.split("&") first = 1 lastfrag = amptext[-1] for fragment in amptext: if not first: # check for special chars semi = fragment.find(";") if semi>0: name = fragment[:semi] if name[0]=='#': try: if name[1] == 'x': n = atoi(name[2:], 16) else: n = atoi(name[1:]) except atoi_error: n = -1 if 0<=n<=255: fragment = chr(n)+fragment[semi+1:] elif symenc.has_key(n): fragment = fragment[semi+1:] (f,b,i) = engine.shiftfont(program, face="symbol") program.append(symenc[n]) engine.shiftfont(program, face=f) if fragment and fragment[0] in WHITESPACE: program.append(" ") # follow with a space else: fragment = "&"+fragment elif standard.has_key(name): fragment = standard[name]+fragment[semi+1:] elif greeks.has_key(name): fragment = fragment[semi+1:] greeksub = greeks[name] (f,b,i) = engine.shiftfont(program, face="symbol") program.append(greeksub) engine.shiftfont(program, face=f) if fragment and fragment[0] in WHITESPACE: program.append(" ") # follow with a space else: # add back the & fragment = "&"+fragment else: # add back the & fragment = "&"+fragment # add white separated components of fragment followed by space sfragment = fragment.split() for w in sfragment[:-1]: program.append(w+" ") # does the last one need a space? if sfragment and fragment: # reader 3 used to go nuts if you don't special case the last frag, but it's fixed? if fragment[-1] in WHITESPACE: # or fragment==lastfrag: program.append( sfragment[-1]+" " ) else: last = sfragment[-1].strip() if last: #print "last is", repr(last) program.append( last ) first = 0 #print "HANDLED", program return program
def handleSpecialCharacters(engine, text, program=None): from paraparser import greeks, symenc from string import whitespace standard={'lt':'<', 'gt':'>', 'amp':'&'} # add space prefix if space here if text[0:1] in whitespace: program.append(" ") #print "handling", repr(text) # shortcut if 0 and "&" not in text: result = [] for x in text.split(): result.append(x+" ") if result: last = result[-1] if text[-1:] not in whitespace: result[-1] = last.strip() program.extend(result) return program if program is None: program = [] amptext = text.split("&") first = 1 lastfrag = amptext[-1] for fragment in amptext: if not first: # check for special chars semi = fragment.find(";") if semi>0: name = fragment[:semi] if name[0]=='#': try: if name[1] == 'x': n = atoi(name[2:], 16) else: n = atoi(name[1:]) except atoi_error: n = -1 if 0<=n<=255: fragment = chr(n)+fragment[semi+1:] elif symenc.has_key(n): fragment = fragment[semi+1:] (f,b,i) = engine.shiftfont(program, face="symbol") program.append(symenc[n]) engine.shiftfont(program, face=f) if fragment and fragment[0] in whitespace: program.append(" ") # follow with a space else: fragment = "&"+fragment elif standard.has_key(name): fragment = standard[name]+fragment[semi+1:] elif greeks.has_key(name): fragment = fragment[semi+1:] greeksub = greeks[name] (f,b,i) = engine.shiftfont(program, face="symbol") program.append(greeksub) engine.shiftfont(program, face=f) if fragment and fragment[0] in whitespace: program.append(" ") # follow with a space else: # add back the & fragment = "&"+fragment else: # add back the & fragment = "&"+fragment # add white separated components of fragment followed by space sfragment = fragment.split() for w in sfragment[:-1]: program.append(w+" ") # does the last one need a space? if sfragment and fragment: # reader 3 used to go nuts if you don't special case the last frag, but it's fixed? if fragment[-1] in WHITESPACE: # or fragment==lastfrag: program.append( sfragment[-1]+" " ) else: last = sfragment[-1].strip() if last: #print "last is", repr(last) program.append( last ) first = 0 #print "HANDLED", program return program
4,756
def handleSpecialCharacters(engine, text, program=None): from paraparser import greeks, symenc from string import whitespace standard={'lt':'<', 'gt':'>', 'amp':'&'} # add space prefix if space here if text[0:1] in whitespace: program.append(" ") #print "handling", repr(text) # shortcut if 0 and "&" not in text: result = [] for x in text.split(): result.append(x+" ") if result: last = result[-1] if text[-1:] not in whitespace: result[-1] = last.strip() program.extend(result) return program if program is None: program = [] amptext = text.split("&") first = 1 lastfrag = amptext[-1] for fragment in amptext: if not first: # check for special chars semi = fragment.find(";") if semi>0: name = fragment[:semi] if name[0]=='#': try: if name[1] == 'x': n = atoi(name[2:], 16) else: n = atoi(name[1:]) except atoi_error: n = -1 if 0<=n<=255: fragment = chr(n)+fragment[semi+1:] elif symenc.has_key(n): fragment = fragment[semi+1:] (f,b,i) = engine.shiftfont(program, face="symbol") program.append(symenc[n]) engine.shiftfont(program, face=f) if fragment and fragment[0] in WHITESPACE: program.append(" ") # follow with a space else: fragment = "&"+fragment elif standard.has_key(name): fragment = standard[name]+fragment[semi+1:] elif greeks.has_key(name): fragment = fragment[semi+1:] greeksub = greeks[name] (f,b,i) = engine.shiftfont(program, face="symbol") program.append(greeksub) engine.shiftfont(program, face=f) if fragment and fragment[0] in WHITESPACE: program.append(" ") # follow with a space else: # add back the & fragment = "&"+fragment else: # add back the & fragment = "&"+fragment # add white separated components of fragment followed by space sfragment = fragment.split() for w in sfragment[:-1]: program.append(w+" ") # does the last one need a space? if sfragment and fragment: # reader 3 used to go nuts if you don't special case the last frag, but it's fixed? if fragment[-1] in WHITESPACE: # or fragment==lastfrag: program.append( sfragment[-1]+" " ) else: last = sfragment[-1].strip() if last: #print "last is", repr(last) program.append( last ) first = 0 #print "HANDLED", program return program
def handleSpecialCharacters(engine, text, program=None): from paraparser import greeks, symenc from string import whitespace standard={'lt':'<', 'gt':'>', 'amp':'&'} # add space prefix if space here if text[0:1] in whitespace: program.append(" ") #print "handling", repr(text) # shortcut if 0 and "&" not in text: result = [] for x in text.split(): result.append(x+" ") if result: last = result[-1] if text[-1:] not in whitespace: result[-1] = last.strip() program.extend(result) return program if program is None: program = [] amptext = text.split("&") first = 1 lastfrag = amptext[-1] for fragment in amptext: if not first: # check for special chars semi = fragment.find(";") if semi>0: name = fragment[:semi] if name[0]=='#': try: if name[1] == 'x': n = atoi(name[2:], 16) else: n = atoi(name[1:]) except atoi_error: n = -1 if 0<=n<=255: fragment = chr(n)+fragment[semi+1:] elif symenc.has_key(n): fragment = fragment[semi+1:] (f,b,i) = engine.shiftfont(program, face="symbol") program.append(symenc[n]) engine.shiftfont(program, face=f) if fragment and fragment[0] in whitespace: program.append(" ") # follow with a space else: fragment = "&"+fragment elif standard.has_key(name): fragment = standard[name]+fragment[semi+1:] elif greeks.has_key(name): fragment = fragment[semi+1:] greeksub = greeks[name] (f,b,i) = engine.shiftfont(program, face="symbol") program.append(greeksub) engine.shiftfont(program, face=f) if fragment and fragment[0] in whitespace: program.append(" ") # follow with a space else: # add back the & fragment = "&"+fragment else: # add back the & fragment = "&"+fragment # add white separated components of fragment followed by space sfragment = fragment.split() for w in sfragment[:-1]: program.append(w+" ") # does the last one need a space? if sfragment and fragment: # reader 3 used to go nuts if you don't special case the last frag, but it's fixed? if fragment[-1] in WHITESPACE: # or fragment==lastfrag: program.append( sfragment[-1]+" " ) else: last = sfragment[-1].strip() if last: #print "last is", repr(last) program.append( last ) first = 0 #print "HANDLED", program return program
4,757
def handleSpecialCharacters(engine, text, program=None): from paraparser import greeks, symenc from string import whitespace standard={'lt':'<', 'gt':'>', 'amp':'&'} # add space prefix if space here if text[0:1] in whitespace: program.append(" ") #print "handling", repr(text) # shortcut if 0 and "&" not in text: result = [] for x in text.split(): result.append(x+" ") if result: last = result[-1] if text[-1:] not in whitespace: result[-1] = last.strip() program.extend(result) return program if program is None: program = [] amptext = text.split("&") first = 1 lastfrag = amptext[-1] for fragment in amptext: if not first: # check for special chars semi = fragment.find(";") if semi>0: name = fragment[:semi] if name[0]=='#': try: if name[1] == 'x': n = atoi(name[2:], 16) else: n = atoi(name[1:]) except atoi_error: n = -1 if 0<=n<=255: fragment = chr(n)+fragment[semi+1:] elif symenc.has_key(n): fragment = fragment[semi+1:] (f,b,i) = engine.shiftfont(program, face="symbol") program.append(symenc[n]) engine.shiftfont(program, face=f) if fragment and fragment[0] in WHITESPACE: program.append(" ") # follow with a space else: fragment = "&"+fragment elif standard.has_key(name): fragment = standard[name]+fragment[semi+1:] elif greeks.has_key(name): fragment = fragment[semi+1:] greeksub = greeks[name] (f,b,i) = engine.shiftfont(program, face="symbol") program.append(greeksub) engine.shiftfont(program, face=f) if fragment and fragment[0] in WHITESPACE: program.append(" ") # follow with a space else: # add back the & fragment = "&"+fragment else: # add back the & fragment = "&"+fragment # add white separated components of fragment followed by space sfragment = fragment.split() for w in sfragment[:-1]: program.append(w+" ") # does the last one need a space? if sfragment and fragment: # reader 3 used to go nuts if you don't special case the last frag, but it's fixed? if fragment[-1] in WHITESPACE: # or fragment==lastfrag: program.append( sfragment[-1]+" " ) else: last = sfragment[-1].strip() if last: #print "last is", repr(last) program.append( last ) first = 0 #print "HANDLED", program return program
def handleSpecialCharacters(engine, text, program=None): from paraparser import greeks, symenc from string import whitespace standard={'lt':'<', 'gt':'>', 'amp':'&'} # add space prefix if space here if text[0:1] in whitespace: program.append(" ") #print "handling", repr(text) # shortcut if 0 and "&" not in text: result = [] for x in text.split(): result.append(x+" ") if result: last = result[-1] if text[-1:] not in whitespace: result[-1] = last.strip() program.extend(result) return program if program is None: program = [] amptext = text.split("&") first = 1 lastfrag = amptext[-1] for fragment in amptext: if not first: # check for special chars semi = fragment.find(";") if semi>0: name = fragment[:semi] if name[0]=='#': try: if name[1] == 'x': n = atoi(name[2:], 16) else: n = atoi(name[1:]) except atoi_error: n = -1 if 0<=n<=255: fragment = chr(n)+fragment[semi+1:] elif symenc.has_key(n): fragment = fragment[semi+1:] (f,b,i) = engine.shiftfont(program, face="symbol") program.append(symenc[n]) engine.shiftfont(program, face=f) if fragment and fragment[0] in WHITESPACE: program.append(" ") # follow with a space else: fragment = "&"+fragment elif standard.has_key(name): fragment = standard[name]+fragment[semi+1:] elif greeks.has_key(name): fragment = fragment[semi+1:] greeksub = greeks[name] (f,b,i) = engine.shiftfont(program, face="symbol") program.append(greeksub) engine.shiftfont(program, face=f) if fragment and fragment[0] in WHITESPACE: program.append(" ") # follow with a space else: # add back the & fragment = "&"+fragment else: # add back the & fragment = "&"+fragment # add white separated components of fragment followed by space sfragment = fragment.split() for w in sfragment[:-1]: program.append(w+" ") # does the last one need a space? if sfragment and fragment: # reader 3 used to go nuts if you don't special case the last frag, but it's fixed? if fragment[-1] in whitespace: # or fragment==lastfrag: program.append( sfragment[-1]+" " ) else: last = sfragment[-1].strip() if last: #print "last is", repr(last) program.append( last ) first = 0 #print "HANDLED", program return program
4,758
def cleanBlockQuotedText(text,joiner=' '): """This is an internal utility which takes triple- quoted text form within the document and returns (hopefully) the paragraph the user intended originally.""" stripped = string.strip(text) lines = string.split(stripped, '\n') trimmed_lines = map(string.lstrip, lines) return string.join(trimmed_lines, joiner)
def cleanBlockQuotedText(text,joiner=' '): """This is an internal utility which takes triple- quoted text form within the document and returns (hopefully) the paragraph the user intended originally.""" L = map(_lineClean, split(text, '\n')) return join(L, joiner) def setXPos(tx,dx): if dx>1e-6 or dx<-1e-6: tx.setXPos(dx)
4,759
def _leftDrawParaLine( tx, offset, extraspace, words, last=0): tx.setXPos(offset) tx._textOut(string.join(words),1)
def _leftDrawParaLine( tx, offset, extraspace, words, last=0): setXPos(tx,offset) tx._textOut(join(words),1) setXPos(tx,-offset)
4,760
def _centerDrawParaLine( tx, offset, extraspace, words, last=0): m = offset + 0.5 * extraspace tx.setXPos(m) tx._textOut(string.join(words),1)
def _centerDrawParaLine( tx, offset, extraspace, words, last=0): m = offset + 0.5 * extraspace setXPos(tx,m) tx._textOut(join(words),1) setXPos(tx,-m)
4,761
def _rightDrawParaLine( tx, offset, extraspace, words, last=0): m = offset + extraspace tx.setXPos(m) tx._textOut(string.join(words),1)
def _rightDrawParaLine( tx, offset, extraspace, words, last=0): m = offset + extraspace setXPos(tx,m) tx._textOut(join(words),1) setXPos(tx,-m)
4,762
def _justifyDrawParaLine( tx, offset, extraspace, words, last=0): tx.setXPos(offset) text = string.join(words) if last: #last one, left align tx._textOut(text,1) else: nSpaces = len(words)-1 if nSpaces: tx.setWordSpace(extraspace / float(nSpaces)) tx._textOut(text,1) tx.setWordSpace(0) else: tx._textOut(text,1)
def _justifyDrawParaLine( tx, offset, extraspace, words, last=0): setXPos(tx,offset) text = join(words) if last: #last one, left align tx._textOut(text,1) else: nSpaces = len(words)-1 if nSpaces: tx.setWordSpace(extraspace / float(nSpaces)) tx._textOut(text,1) tx.setWordSpace(0) else: tx._textOut(text,1)
4,763
def _leftDrawParaLineX( tx, offset, line, last=0): tx.setXPos(offset) _putFragLine(tx, line.words)
def _leftDrawParaLineX( tx, offset, line, last=0): setXPos(tx,offset) _putFragLine(tx, line.words)
4,764
def _centerDrawParaLineX( tx, offset, line, last=0): m = offset+0.5*line.extraSpace tx.setXPos(m) _putFragLine(tx, line.words)
def _centerDrawParaLineX( tx, offset, line, last=0): m = offset+0.5*line.extraSpace setXPos(tx,m) _putFragLine(tx, line.words)
4,765
def _rightDrawParaLineX( tx, offset, line, last=0): m = offset+line.extraSpace tx.setXPos(m) _putFragLine(tx, line.words)
def _rightDrawParaLineX( tx, offset, line, last=0): m = offset+line.extraSpace setXPos(tx,m) _putFragLine(tx, line.words)
4,766
def _justifyDrawParaLineX( tx, offset, line, last=0): if last: #last one, left align tx.setXPos(offset) _putFragLine(tx, line.words) else: tx.setXPos(offset) nSpaces = line.wordCount - 1 if nSpaces: tx.setWordSpace(line.extraSpace / float(nSpaces)) _putFragLine(tx, line.words) tx.setWordSpace(0) else: _putFragLine(tx, line.words)
def _justifyDrawParaLineX( tx, offset, line, last=0): if last: #last one, left align _putFragLine(tx, line.words) else: nSpaces = line.wordCount - 1 if nSpaces: tx.setWordSpace(line.extraSpace / float(nSpaces)) _putFragLine(tx, line.words) tx.setWordSpace(0) else: _putFragLine(tx, line.words)
4,767
def _justifyDrawParaLineX( tx, offset, line, last=0): if last: #last one, left align tx.setXPos(offset) _putFragLine(tx, line.words) else: tx.setXPos(offset) nSpaces = line.wordCount - 1 if nSpaces: tx.setWordSpace(line.extraSpace / float(nSpaces)) _putFragLine(tx, line.words) tx.setWordSpace(0) else: _putFragLine(tx, line.words)
def _justifyDrawParaLineX( tx, offset, line, last=0): if last: #last one, left align _putFragLine(tx, line.words) else: nSpaces = line.wordCount - 1 if nSpaces: tx.setWordSpace(line.extraSpace / float(nSpaces)) _putFragLine(tx, line.words) tx.setWordSpace(0) else: _putFragLine(tx, line.words)
4,768
def _getFragWords(frags): ''' given a Parafrag list return a list of fragwords [[size, (f00,w00), ..., (f0n,w0n)],....,[size, (fm0,wm0), ..., (f0n,wmn)]] each pair f,w represents a style and some string each sublist represents a word ''' R = [] W = [] n = 0 for f in frags: text = f.text #del f.text # we can't do this until we sort out splitting # of paragraphs if text!='': S = string.split(text,' ') if S[-1]=='': del S[-1] if W!=[] and text[0] in [' ','\t']: W.insert(0,n) R.append(W) W = [] n = 0 for w in S[:-1]: W.append((f,w)) n = n + stringWidth(w, f.fontName, f.fontSize) W.insert(0,n) R.append(W) W = [] n = 0 w = S[-1] W.append((f,w)) n = n + stringWidth(w, f.fontName, f.fontSize) if text[-1] in [' ','\t']: W.insert(0,n) R.append(W) W = [] n = 0 elif hasattr(f,'cbDefn'): if W!=[]: W.insert(0,n) R.append(W) W = [] n = 0 R.append([0,(f,'')]) if W!=[]: W.insert(0,n) R.append(W) return R
def _getFragWords(frags): ''' given a Parafrag list return a list of fragwords [[size, (f00,w00), ..., (f0n,w0n)],....,[size, (fm0,wm0), ..., (f0n,wmn)]] each pair f,w represents a style and some string each sublist represents a word ''' R = [] W = [] n = 0 for f in frags: text = f.text #del f.text # we can't do this until we sort out splitting # of paragraphs if text!='': S = split(text,' ') if S[-1]=='': del S[-1] if W!=[] and text[0] in [' ','\t']: W.insert(0,n) R.append(W) W = [] n = 0 for w in S[:-1]: W.append((f,w)) n = n + stringWidth(w, f.fontName, f.fontSize) W.insert(0,n) R.append(W) W = [] n = 0 w = S[-1] W.append((f,w)) n = n + stringWidth(w, f.fontName, f.fontSize) if text[-1] in [' ','\t']: W.insert(0,n) R.append(W) W = [] n = 0 elif hasattr(f,'cbDefn'): if W!=[]: W.insert(0,n) R.append(W) W = [] n = 0 R.append([0,(f,'')]) if W!=[]: W.insert(0,n) R.append(W) return R
4,769
def _handleBulletWidth(bulletText,style,maxWidths): '''work out bullet width and adjust maxWidths[0] if neccessary ''' if bulletText <> None: if type(bulletText) is StringType: bulletWidth = stringWidth( bulletText, style.bulletFontName, style.bulletFontSize) else: #it's a list of fragments bulletWidth = 0 for f in bulletText: bulletWidth = bulletWidth + stringWidth(f.text, f.fontName, f.fontSize) bulletRight = style.bulletIndent + bulletWidth if bulletRight > style.firstLineIndent: #..then it overruns, and we have less space available on line 1 maxWidths[0] = maxWidths[0] - (bulletRight - style.firstLineIndent)
def _handleBulletWidth(bulletText,style,maxWidths): '''work out bullet width and adjust maxWidths[0] if neccessary ''' if bulletText <> None: if type(bulletText) is StringType: bulletWidth = stringWidth( bulletText, style.bulletFontName, style.bulletFontSize) else: #it's a list of fragments bulletWidth = 0 for f in bulletText: bulletWidth = bulletWidth + stringWidth(f.text, f.fontName, f.fontSize) bulletRight = style.bulletIndent + bulletWidth if bulletRight > style.firstLineIndent: #..then it overruns, and we have less space available on line 1 maxWidths[0] = maxWidths[0] - (bulletRight - style.firstLineIndent)
4,770
def _handleBulletWidth(bulletText,style,maxWidths): '''work out bullet width and adjust maxWidths[0] if neccessary ''' if bulletText <> None: if type(bulletText) is StringType: bulletWidth = stringWidth( bulletText, style.bulletFontName, style.bulletFontSize) else: #it's a list of fragments bulletWidth = 0 for f in bulletText: bulletWidth = bulletWidth + stringWidth(f.text, f.fontName, f.fontSize) bulletRight = style.bulletIndent + bulletWidth if bulletRight > style.firstLineIndent: #..then it overruns, and we have less space available on line 1 maxWidths[0] = maxWidths[0] - (bulletRight - style.firstLineIndent)
def _handleBulletWidth(bulletText,style,maxWidths): '''work out bullet width and adjust maxWidths[0] if neccessary ''' if bulletText <> None: if type(bulletText) is StringType: bulletWidth = stringWidth( bulletText, style.bulletFontName, style.bulletFontSize) else: #it's a list of fragments bulletWidth = 0 for f in bulletText: bulletWidth = bulletWidth + stringWidth(f.text, f.fontName, f.fontSize) bulletRight = style.bulletIndent + bulletWidth indent = style.leftIndent+style.firstLineIndent if bulletRight > indent: #..then it overruns, and we have less space available on line 1 maxWidths[0] = maxWidths[0] - (bulletRight - style.firstLineIndent)
4,771
def _handleBulletWidth(bulletText,style,maxWidths): '''work out bullet width and adjust maxWidths[0] if neccessary ''' if bulletText <> None: if type(bulletText) is StringType: bulletWidth = stringWidth( bulletText, style.bulletFontName, style.bulletFontSize) else: #it's a list of fragments bulletWidth = 0 for f in bulletText: bulletWidth = bulletWidth + stringWidth(f.text, f.fontName, f.fontSize) bulletRight = style.bulletIndent + bulletWidth if bulletRight > style.firstLineIndent: #..then it overruns, and we have less space available on line 1 maxWidths[0] = maxWidths[0] - (bulletRight - style.firstLineIndent)
def _handleBulletWidth(bulletText,style,maxWidths): '''work out bullet width and adjust maxWidths[0] if neccessary ''' if bulletText <> None: if type(bulletText) is StringType: bulletWidth = stringWidth( bulletText, style.bulletFontName, style.bulletFontSize) else: #it's a list of fragments bulletWidth = 0 for f in bulletText: bulletWidth = bulletWidth + stringWidth(f.text, f.fontName, f.fontSize) bulletRight = style.bulletIndent + bulletWidth if bulletRight > style.firstLineIndent: #..then it overruns, and we have less space available on line 1 maxWidths[0] = maxWidths[0] - (bulletRight - indent)
4,772
def wrap(self, availWidth, availHeight): # work out widths array for breaking self.width = availWidth first_line_width = availWidth - self.style.firstLineIndent - self.style.rightIndent later_widths = availWidth - self.style.leftIndent - self.style.rightIndent self.blPara = self.breakLines([first_line_width, later_widths]) self.height = len(self.blPara.lines) * self.style.leading
def wrap(self, availWidth, availHeight): # work out widths array for breaking self.width = availWidth leftIndent = self.style.leftIndent first_line_width = availWidth - (leftIndent+self.style.firstLineIndent) - self.style.rightIndent later_widths = availWidth - leftIndent - self.style.rightIndent self.blPara = self.breakLines([first_line_width, later_widths]) self.height = len(self.blPara.lines) * self.style.leading
4,773
def wrap(self, availWidth, availHeight): # work out widths array for breaking self.width = availWidth first_line_width = availWidth - self.style.firstLineIndent - self.style.rightIndent later_widths = availWidth - self.style.leftIndent - self.style.rightIndent self.blPara = self.breakLines([first_line_width, later_widths]) self.height = len(self.blPara.lines) * self.style.leading
def wrap(self, availWidth, availHeight): # work out widths array for breaking self.width = availWidth first_line_width = availWidth - self.style.firstLineIndent - self.style.rightIndent later_widths = availWidth - self.style.leftIndent - self.style.rightIndent self.blPara = self.breakLines([first_line_width, later_widths]) self.height = len(self.blPara.lines) * self.style.leading
4,774
def split(self,availWidth, availHeight): if len(self.frags)<=0: return []
def split(self,availWidth, availHeight): if len(self.frags)<=0: return []
4,775
def split(self,availWidth, availHeight): if len(self.frags)<=0: return []
def split(self,availWidth, availHeight): if len(self.frags)<=0: return []
4,776
def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word list
def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word list
4,777
def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word list
def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word list
4,778
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite."""
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite."""
4,779
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite."""
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite."""
4,780
def getPlainText(self): """Convenience function for templates which want access to the raw text, without XML tags. """ plains = [] for frag in self.frags: plains.append(frag.text) return string.join(plains, '')
def getPlainText(self): """Convenience function for templates which want access to the raw text, without XML tags. """ plains = [] for frag in self.frags: plains.append(frag.text) return string.join(plains, '')
4,781
def getImageFromZODB(self, name) : """Retrieves an Image from the ZODB, converts it to PIL, and makes it 0.75 inch high. """ try : # try to get it from ZODB logo = getattr(self.parent.context, name) except AttributeError : # not found ! return None
def getImageFromZODB(self, name) : """Retrieves an Image from the ZODB, converts it to PIL, and makes it 0.75 inch high. """ try : # try to get it from ZODB logo = getattr(self.parent.context, name) except AttributeError : # not found ! return None
4,782
def check_text(text,p=_parser): print '##########' text = cleanBlockQuotedText(text) l,rv,bv = p.parse(text,style) if rv is None: for l in _parser.errors: print l else: print 'ParaStyle', l.fontName,l.fontSize,l.textColor for l in rv: print l.fontName,l.fontSize,l.textColor,l.bold, l.rise, '|%s|'%l.text[:25], if hasattr(l,'cbDefn'): print 'cbDefn',l.cbDefn.name,l.cbDefn.label,l.cbDefn.kind else: print
def check_text(text,p=_parser): print '##########' text = cleanBlockQuotedText(text) l,rv,bv = p.parse(text,style) if rv is None: for l in _parser.errors: print l else: print 'ParaStyle', l.fontName,l.fontSize,l.textColor for l in rv: print l.fontName,l.fontSize,l.textColor,l.bold, l.rise, '|%s|'%l.text[:25], if hasattr(l,'cbDefn'): print 'cbDefn',l.cbDefn.name,l.cbDefn.label,l.cbDefn.kind else: print
4,783
def calcBarPositions(self): """Works out where they go. default vertical.
def calcBarPositions(self): """Works out where they go. default vertical.
4,784
def run(): LIBS = [] setup( name="Reportlab", version="1.15.3", description="Reportlab PDF generation tools", author="The boys from SW19", author_email="info@reportlab.com", url="http://www.reportlab.com/", package_dir = {'': '..'}, packages=[ # include anything with an __init__ 'reportlab', 'reportlab.docs', 'reportlab.docs.graphguide', 'reportlab.docs.images', 'reportlab.docs.reference', 'reportlab.docs.userguide', 'reportlab.fonts', 'reportlab.graphics', 'reportlab.graphics.charts', 'reportlab.graphics.widgets', 'reportlab.lib', 'reportlab.pdfbase', 'reportlab.pdfgen', 'reportlab.platypus', ], data_files = [('docs/images', ['docs/images/Edit_Prefs.gif', 'docs/images/Python_21.gif', 'docs/images/Python_21_HINT.gif', 'docs/images/fileExchange.gif', 'docs/images/jpn.gif', 'docs/images/jpnchars.jpg', 'docs/images/lj8100.jpg', 'docs/images/replogo.a85', 'docs/images/replogo.gif']), ('fonts', ['fonts/LeERC___.AFM', 'fonts/LeERC___.PFB', 'fonts/luxiserif.ttf', 'fonts/rina.ttf'] )], ext_modules = [Extension( '_rl_accel', ['lib/_rl_accel.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'sgmlop', ['lib/sgmlop.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'pyHnj', ['lib/pyHnjmodule.c', 'lib/hyphen.c', 'lib/hnjalloc.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), ], )
def run(): LIBS = [] setup( name="Reportlab", version="1.17", licence="BSD license, Copyright (c) 2000-2003, ReportLab Inc.", description="Reportlab PDF generation tools", author="The boys from SW19", author_email="info@reportlab.com", url="http://www.reportlab.com/", package_dir = {'': '..'}, packages=[ # include anything with an __init__ 'reportlab', 'reportlab.docs', 'reportlab.docs.graphguide', 'reportlab.docs.images', 'reportlab.docs.reference', 'reportlab.docs.userguide', 'reportlab.fonts', 'reportlab.graphics', 'reportlab.graphics.charts', 'reportlab.graphics.widgets', 'reportlab.lib', 'reportlab.pdfbase', 'reportlab.pdfgen', 'reportlab.platypus', ], data_files = [('docs/images', ['docs/images/Edit_Prefs.gif', 'docs/images/Python_21.gif', 'docs/images/Python_21_HINT.gif', 'docs/images/fileExchange.gif', 'docs/images/jpn.gif', 'docs/images/jpnchars.jpg', 'docs/images/lj8100.jpg', 'docs/images/replogo.a85', 'docs/images/replogo.gif']), ('fonts', ['fonts/LeERC___.AFM', 'fonts/LeERC___.PFB', 'fonts/luxiserif.ttf', 'fonts/rina.ttf'] )], ext_modules = [Extension( '_rl_accel', ['lib/_rl_accel.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'sgmlop', ['lib/sgmlop.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'pyHnj', ['lib/pyHnjmodule.c', 'lib/hyphen.c', 'lib/hnjalloc.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), ], )
4,785
def run(): LIBS = [] setup( name="Reportlab", version="1.15.3", description="Reportlab PDF generation tools", author="The boys from SW19", author_email="info@reportlab.com", url="http://www.reportlab.com/", package_dir = {'': '..'}, packages=[ # include anything with an __init__ 'reportlab', 'reportlab.docs', 'reportlab.docs.graphguide', 'reportlab.docs.images', 'reportlab.docs.reference', 'reportlab.docs.userguide', 'reportlab.fonts', 'reportlab.graphics', 'reportlab.graphics.charts', 'reportlab.graphics.widgets', 'reportlab.lib', 'reportlab.pdfbase', 'reportlab.pdfgen', 'reportlab.platypus', ], data_files = [('docs/images', ['docs/images/Edit_Prefs.gif', 'docs/images/Python_21.gif', 'docs/images/Python_21_HINT.gif', 'docs/images/fileExchange.gif', 'docs/images/jpn.gif', 'docs/images/jpnchars.jpg', 'docs/images/lj8100.jpg', 'docs/images/replogo.a85', 'docs/images/replogo.gif']), ('fonts', ['fonts/LeERC___.AFM', 'fonts/LeERC___.PFB', 'fonts/luxiserif.ttf', 'fonts/rina.ttf'] )], ext_modules = [Extension( '_rl_accel', ['lib/_rl_accel.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'sgmlop', ['lib/sgmlop.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'pyHnj', ['lib/pyHnjmodule.c', 'lib/hyphen.c', 'lib/hnjalloc.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), ], )
def run(): LIBS = [] setup( name="Reportlab", version="1.15.3", description="Reportlab PDF generation tools", author="The boys from SW19", author_email="info@reportlab.com", url="http://www.reportlab.com/", package_dir = {'reportlab': '.'}, packages=[ # include anything with an __init__ 'reportlab', 'reportlab.docs', 'reportlab.docs.graphguide', 'reportlab.docs.images', 'reportlab.docs.reference', 'reportlab.docs.userguide', 'reportlab.fonts', 'reportlab.graphics', 'reportlab.graphics.charts', 'reportlab.graphics.widgets', 'reportlab.lib', 'reportlab.pdfbase', 'reportlab.pdfgen', 'reportlab.platypus', ], data_files = [('docs/images', ['docs/images/Edit_Prefs.gif', 'docs/images/Python_21.gif', 'docs/images/Python_21_HINT.gif', 'docs/images/fileExchange.gif', 'docs/images/jpn.gif', 'docs/images/jpnchars.jpg', 'docs/images/lj8100.jpg', 'docs/images/replogo.a85', 'docs/images/replogo.gif']), ('fonts', ['fonts/LeERC___.AFM', 'fonts/LeERC___.PFB', 'fonts/luxiserif.ttf', 'fonts/rina.ttf'] )], ext_modules = [Extension( '_rl_accel', ['lib/_rl_accel.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'sgmlop', ['lib/sgmlop.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'pyHnj', ['lib/pyHnjmodule.c', 'lib/hyphen.c', 'lib/hnjalloc.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), ], )
4,786
def run(): LIBS = [] setup( name="Reportlab", version="1.15.3", description="Reportlab PDF generation tools", author="The boys from SW19", author_email="info@reportlab.com", url="http://www.reportlab.com/", package_dir = {'': '..'}, packages=[ # include anything with an __init__ 'reportlab', 'reportlab.docs', 'reportlab.docs.graphguide', 'reportlab.docs.images', 'reportlab.docs.reference', 'reportlab.docs.userguide', 'reportlab.fonts', 'reportlab.graphics', 'reportlab.graphics.charts', 'reportlab.graphics.widgets', 'reportlab.lib', 'reportlab.pdfbase', 'reportlab.pdfgen', 'reportlab.platypus', ], data_files = [('docs/images', ['docs/images/Edit_Prefs.gif', 'docs/images/Python_21.gif', 'docs/images/Python_21_HINT.gif', 'docs/images/fileExchange.gif', 'docs/images/jpn.gif', 'docs/images/jpnchars.jpg', 'docs/images/lj8100.jpg', 'docs/images/replogo.a85', 'docs/images/replogo.gif']), ('fonts', ['fonts/LeERC___.AFM', 'fonts/LeERC___.PFB', 'fonts/luxiserif.ttf', 'fonts/rina.ttf'] )], ext_modules = [Extension( '_rl_accel', ['lib/_rl_accel.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'sgmlop', ['lib/sgmlop.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'pyHnj', ['lib/pyHnjmodule.c', 'lib/hyphen.c', 'lib/hnjalloc.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), ], )
def run(): LIBS = [] setup( name="Reportlab", version="1.15.3", description="Reportlab PDF generation tools", author="The boys from SW19", author_email="info@reportlab.com", url="http://www.reportlab.com/", package_dir = {'': '..'}, packages=[ # include anything with an __init__ 'reportlab', 'reportlab.docs', 'reportlab.docs.graphguide', 'reportlab.docs.reference', 'reportlab.docs.userguide', 'reportlab.fonts', 'reportlab.graphics', 'reportlab.graphics.charts', 'reportlab.graphics.widgets', 'reportlab.lib', 'reportlab.pdfbase', 'reportlab.pdfgen', 'reportlab.platypus', ], data_files = [('docs/images', ['docs/images/Edit_Prefs.gif', 'docs/images/Python_21.gif', 'docs/images/Python_21_HINT.gif', 'docs/images/fileExchange.gif', 'docs/images/jpn.gif', 'docs/images/jpnchars.jpg', 'docs/images/lj8100.jpg', 'docs/images/replogo.a85', 'docs/images/replogo.gif']), ('fonts', ['fonts/LeERC___.AFM', 'fonts/LeERC___.PFB', 'fonts/luxiserif.ttf', 'fonts/rina.ttf'] )], ext_modules = [Extension( '_rl_accel', ['lib/_rl_accel.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'sgmlop', ['lib/sgmlop.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'pyHnj', ['lib/pyHnjmodule.c', 'lib/hyphen.c', 'lib/hnjalloc.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), ], )
4,787
def run(): LIBS = [] setup( name="Reportlab", version="1.15.3", description="Reportlab PDF generation tools", author="The boys from SW19", author_email="info@reportlab.com", url="http://www.reportlab.com/", package_dir = {'': '..'}, packages=[ # include anything with an __init__ 'reportlab', 'reportlab.docs', 'reportlab.docs.graphguide', 'reportlab.docs.images', 'reportlab.docs.reference', 'reportlab.docs.userguide', 'reportlab.fonts', 'reportlab.graphics', 'reportlab.graphics.charts', 'reportlab.graphics.widgets', 'reportlab.lib', 'reportlab.pdfbase', 'reportlab.pdfgen', 'reportlab.platypus', ], data_files = [('docs/images', ['docs/images/Edit_Prefs.gif', 'docs/images/Python_21.gif', 'docs/images/Python_21_HINT.gif', 'docs/images/fileExchange.gif', 'docs/images/jpn.gif', 'docs/images/jpnchars.jpg', 'docs/images/lj8100.jpg', 'docs/images/replogo.a85', 'docs/images/replogo.gif']), ('fonts', ['fonts/LeERC___.AFM', 'fonts/LeERC___.PFB', 'fonts/luxiserif.ttf', 'fonts/rina.ttf'] )], ext_modules = [Extension( '_rl_accel', ['lib/_rl_accel.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'sgmlop', ['lib/sgmlop.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'pyHnj', ['lib/pyHnjmodule.c', 'lib/hyphen.c', 'lib/hnjalloc.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), ], )
def run(): LIBS = [] setup( name="Reportlab", version="1.15.3", description="Reportlab PDF generation tools", author="The boys from SW19", author_email="info@reportlab.com", url="http://www.reportlab.com/", package_dir = {'': '..'}, packages=[ # include anything with an __init__ 'reportlab', 'reportlab.docs', 'reportlab.docs.graphguide', 'reportlab.docs.images', 'reportlab.docs.reference', 'reportlab.docs.userguide', 'reportlab.graphics', 'reportlab.graphics.charts', 'reportlab.graphics.widgets', 'reportlab.lib', 'reportlab.pdfbase', 'reportlab.pdfgen', 'reportlab.platypus', ], data_files = [('docs/images', ['docs/images/Edit_Prefs.gif', 'docs/images/Python_21.gif', 'docs/images/Python_21_HINT.gif', 'docs/images/fileExchange.gif', 'docs/images/jpn.gif', 'docs/images/jpnchars.jpg', 'docs/images/lj8100.jpg', 'docs/images/replogo.a85', 'docs/images/replogo.gif']), ('fonts', ['fonts/LeERC___.AFM', 'fonts/LeERC___.PFB', 'fonts/luxiserif.ttf', 'fonts/rina.ttf'] )], ext_modules = [Extension( '_rl_accel', ['lib/_rl_accel.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'sgmlop', ['lib/sgmlop.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'pyHnj', ['lib/pyHnjmodule.c', 'lib/hyphen.c', 'lib/hnjalloc.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), ], )
4,788
def run(): LIBS = [] setup( name="Reportlab", version="1.15.3", description="Reportlab PDF generation tools", author="The boys from SW19", author_email="info@reportlab.com", url="http://www.reportlab.com/", package_dir = {'': '..'}, packages=[ # include anything with an __init__ 'reportlab', 'reportlab.docs', 'reportlab.docs.graphguide', 'reportlab.docs.images', 'reportlab.docs.reference', 'reportlab.docs.userguide', 'reportlab.fonts', 'reportlab.graphics', 'reportlab.graphics.charts', 'reportlab.graphics.widgets', 'reportlab.lib', 'reportlab.pdfbase', 'reportlab.pdfgen', 'reportlab.platypus', ], data_files = [('docs/images', ['docs/images/Edit_Prefs.gif', 'docs/images/Python_21.gif', 'docs/images/Python_21_HINT.gif', 'docs/images/fileExchange.gif', 'docs/images/jpn.gif', 'docs/images/jpnchars.jpg', 'docs/images/lj8100.jpg', 'docs/images/replogo.a85', 'docs/images/replogo.gif']), ('fonts', ['fonts/LeERC___.AFM', 'fonts/LeERC___.PFB', 'fonts/luxiserif.ttf', 'fonts/rina.ttf'] )], ext_modules = [Extension( '_rl_accel', ['lib/_rl_accel.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'sgmlop', ['lib/sgmlop.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'pyHnj', ['lib/pyHnjmodule.c', 'lib/hyphen.c', 'lib/hnjalloc.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), ], )
def run(): LIBS = [] setup( name="Reportlab", version="1.15.3", description="Reportlab PDF generation tools", author="The boys from SW19", author_email="info@reportlab.com", url="http://www.reportlab.com/", package_dir = {'': '..'}, packages=[ # include anything with an __init__ 'reportlab', 'reportlab.docs', 'reportlab.docs.graphguide', 'reportlab.docs.images', 'reportlab.docs.reference', 'reportlab.docs.userguide', 'reportlab.fonts', 'reportlab.graphics', 'reportlab.graphics.charts', 'reportlab.graphics.widgets', 'reportlab.lib', 'reportlab.pdfbase', 'reportlab.pdfgen', 'reportlab.platypus', 'reportlab.test', 'reportlab.tools', 'reportlab.tools.docco', 'reportlab.tools.py2pdf', 'reportlab.tools.pythonpoint', 'reportlab.tools.pythonpoint.demos', 'reportlab.tools.pythonpoint.styles', ], data_files = [(pjoin(package_path, 'docs', 'images'), ['docs/images/Edit_Prefs.gif', 'docs/images/Python_21.gif', 'docs/images/Python_21_HINT.gif', 'docs/images/fileExchange.gif', 'docs/images/jpn.gif', 'docs/images/jpnchars.jpg', 'docs/images/lj8100.jpg', 'docs/images/replogo.a85', 'docs/images/replogo.gif']), (pjoin(package_path, 'fonts'), ['fonts/LeERC___.AFM', 'fonts/LeERC___.PFB', 'fonts/luxiserif.ttf', 'fonts/rina.ttf']), (package_path, ['README', 'changes', 'license.txt']), (pjoin(package_path, 'test'), ['test/pythonpowered.gif',]), (pjoin(package_path, 'lib'), ['lib/hyphen.mashed',]), ], ext_modules = [Extension( '_rl_accel', ['lib/_rl_accel.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'sgmlop', ['lib/sgmlop.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'pyHnj', ['lib/pyHnjmodule.c', 'lib/hyphen.c', 'lib/hnjalloc.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), ], )
4,789
def run(): LIBS = [] setup( name="Reportlab", version="1.15.3", description="Reportlab PDF generation tools", author="The boys from SW19", author_email="info@reportlab.com", url="http://www.reportlab.com/", package_dir = {'': '..'}, packages=[ # include anything with an __init__ 'reportlab', 'reportlab.docs', 'reportlab.docs.graphguide', 'reportlab.docs.images', 'reportlab.docs.reference', 'reportlab.docs.userguide', 'reportlab.fonts', 'reportlab.graphics', 'reportlab.graphics.charts', 'reportlab.graphics.widgets', 'reportlab.lib', 'reportlab.pdfbase', 'reportlab.pdfgen', 'reportlab.platypus', ], data_files = [('docs/images', ['docs/images/Edit_Prefs.gif', 'docs/images/Python_21.gif', 'docs/images/Python_21_HINT.gif', 'docs/images/fileExchange.gif', 'docs/images/jpn.gif', 'docs/images/jpnchars.jpg', 'docs/images/lj8100.jpg', 'docs/images/replogo.a85', 'docs/images/replogo.gif']), ('fonts', ['fonts/LeERC___.AFM', 'fonts/LeERC___.PFB', 'fonts/luxiserif.ttf', 'fonts/rina.ttf'] )], ext_modules = [Extension( '_rl_accel', ['lib/_rl_accel.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'sgmlop', ['lib/sgmlop.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'pyHnj', ['lib/pyHnjmodule.c', 'lib/hyphen.c', 'lib/hnjalloc.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), ], )
def run(): LIBS = [] setup( name="Reportlab", version="1.15.3", description="Reportlab PDF generation tools", author="The boys from SW19", author_email="info@reportlab.com", url="http://www.reportlab.com/", package_dir = {'': '..'}, packages=[ # include anything with an __init__ 'reportlab', 'reportlab.docs', 'reportlab.docs.graphguide', 'reportlab.docs.images', 'reportlab.docs.reference', 'reportlab.docs.userguide', 'reportlab.fonts', 'reportlab.graphics', 'reportlab.graphics.charts', 'reportlab.graphics.widgets', 'reportlab.lib', 'reportlab.pdfbase', 'reportlab.pdfgen', 'reportlab.platypus', ], data_files = [('docs/images', ['docs/images/Edit_Prefs.gif', 'docs/images/Python_21.gif', 'docs/images/Python_21_HINT.gif', 'docs/images/fileExchange.gif', 'docs/images/jpn.gif', 'docs/images/jpnchars.jpg', 'docs/images/lj8100.jpg', 'docs/images/replogo.a85', 'docs/images/replogo.gif']), ('fonts', ['fonts/LeERC___.AFM', 'fonts/LeERC___.PFB', 'fonts/luxiserif.ttf', 'fonts/rina.ttf'] )], ext_modules = [Extension( 'reportlab/lib/_rl_accel', ['lib/_rl_accel.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'sgmlop', ['lib/sgmlop.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'pyHnj', ['lib/pyHnjmodule.c', 'lib/hyphen.c', 'lib/hnjalloc.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), ], )
4,790
def run(): LIBS = [] setup( name="Reportlab", version="1.15.3", description="Reportlab PDF generation tools", author="The boys from SW19", author_email="info@reportlab.com", url="http://www.reportlab.com/", package_dir = {'': '..'}, packages=[ # include anything with an __init__ 'reportlab', 'reportlab.docs', 'reportlab.docs.graphguide', 'reportlab.docs.images', 'reportlab.docs.reference', 'reportlab.docs.userguide', 'reportlab.fonts', 'reportlab.graphics', 'reportlab.graphics.charts', 'reportlab.graphics.widgets', 'reportlab.lib', 'reportlab.pdfbase', 'reportlab.pdfgen', 'reportlab.platypus', ], data_files = [('docs/images', ['docs/images/Edit_Prefs.gif', 'docs/images/Python_21.gif', 'docs/images/Python_21_HINT.gif', 'docs/images/fileExchange.gif', 'docs/images/jpn.gif', 'docs/images/jpnchars.jpg', 'docs/images/lj8100.jpg', 'docs/images/replogo.a85', 'docs/images/replogo.gif']), ('fonts', ['fonts/LeERC___.AFM', 'fonts/LeERC___.PFB', 'fonts/luxiserif.ttf', 'fonts/rina.ttf'] )], ext_modules = [Extension( '_rl_accel', ['lib/_rl_accel.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'sgmlop', ['lib/sgmlop.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'pyHnj', ['lib/pyHnjmodule.c', 'lib/hyphen.c', 'lib/hnjalloc.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), ], )
def run(): LIBS = [] setup( name="Reportlab", version="1.15.3", description="Reportlab PDF generation tools", author="The boys from SW19", author_email="info@reportlab.com", url="http://www.reportlab.com/", package_dir = {'': '..'}, packages=[ # include anything with an __init__ 'reportlab', 'reportlab.docs', 'reportlab.docs.graphguide', 'reportlab.docs.images', 'reportlab.docs.reference', 'reportlab.docs.userguide', 'reportlab.fonts', 'reportlab.graphics', 'reportlab.graphics.charts', 'reportlab.graphics.widgets', 'reportlab.lib', 'reportlab.pdfbase', 'reportlab.pdfgen', 'reportlab.platypus', ], data_files = [('docs/images', ['docs/images/Edit_Prefs.gif', 'docs/images/Python_21.gif', 'docs/images/Python_21_HINT.gif', 'docs/images/fileExchange.gif', 'docs/images/jpn.gif', 'docs/images/jpnchars.jpg', 'docs/images/lj8100.jpg', 'docs/images/replogo.a85', 'docs/images/replogo.gif']), ('fonts', ['fonts/LeERC___.AFM', 'fonts/LeERC___.PFB', 'fonts/luxiserif.ttf', 'fonts/rina.ttf'] )], ext_modules = [Extension( '_rl_accel', ['lib/_rl_accel.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'reportlab/lib/sgmlop', ['lib/sgmlop.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'pyHnj', ['lib/pyHnjmodule.c', 'lib/hyphen.c', 'lib/hnjalloc.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), ], )
4,791
def run(): LIBS = [] setup( name="Reportlab", version="1.15.3", description="Reportlab PDF generation tools", author="The boys from SW19", author_email="info@reportlab.com", url="http://www.reportlab.com/", package_dir = {'': '..'}, packages=[ # include anything with an __init__ 'reportlab', 'reportlab.docs', 'reportlab.docs.graphguide', 'reportlab.docs.images', 'reportlab.docs.reference', 'reportlab.docs.userguide', 'reportlab.fonts', 'reportlab.graphics', 'reportlab.graphics.charts', 'reportlab.graphics.widgets', 'reportlab.lib', 'reportlab.pdfbase', 'reportlab.pdfgen', 'reportlab.platypus', ], data_files = [('docs/images', ['docs/images/Edit_Prefs.gif', 'docs/images/Python_21.gif', 'docs/images/Python_21_HINT.gif', 'docs/images/fileExchange.gif', 'docs/images/jpn.gif', 'docs/images/jpnchars.jpg', 'docs/images/lj8100.jpg', 'docs/images/replogo.a85', 'docs/images/replogo.gif']), ('fonts', ['fonts/LeERC___.AFM', 'fonts/LeERC___.PFB', 'fonts/luxiserif.ttf', 'fonts/rina.ttf'] )], ext_modules = [Extension( '_rl_accel', ['lib/_rl_accel.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'sgmlop', ['lib/sgmlop.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'pyHnj', ['lib/pyHnjmodule.c', 'lib/hyphen.c', 'lib/hnjalloc.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), ], )
def run(): LIBS = [] setup( name="Reportlab", version="1.15.3", description="Reportlab PDF generation tools", author="The boys from SW19", author_email="info@reportlab.com", url="http://www.reportlab.com/", package_dir = {'': '..'}, packages=[ # include anything with an __init__ 'reportlab', 'reportlab.docs', 'reportlab.docs.graphguide', 'reportlab.docs.images', 'reportlab.docs.reference', 'reportlab.docs.userguide', 'reportlab.fonts', 'reportlab.graphics', 'reportlab.graphics.charts', 'reportlab.graphics.widgets', 'reportlab.lib', 'reportlab.pdfbase', 'reportlab.pdfgen', 'reportlab.platypus', ], data_files = [('docs/images', ['docs/images/Edit_Prefs.gif', 'docs/images/Python_21.gif', 'docs/images/Python_21_HINT.gif', 'docs/images/fileExchange.gif', 'docs/images/jpn.gif', 'docs/images/jpnchars.jpg', 'docs/images/lj8100.jpg', 'docs/images/replogo.a85', 'docs/images/replogo.gif']), ('fonts', ['fonts/LeERC___.AFM', 'fonts/LeERC___.PFB', 'fonts/luxiserif.ttf', 'fonts/rina.ttf'] )], ext_modules = [Extension( '_rl_accel', ['lib/_rl_accel.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'sgmlop', ['lib/sgmlop.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), Extension( 'reportlab/lib/pyHnj', ['lib/pyHnjmodule.c', 'lib/hyphen.c', 'lib/hnjalloc.c'], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, # libraries to link against ), ], )
4,792
def makeSuite(): suite = unittest.TestSuite() suite.addTest(PlatypusTestCase('test1')) return suite
def makeSuite(): suite = unittest.TestSuite() suite.addTest(PlatypusTestCase('test1')) return suite
4,793
def draw(self, drawing, canvas, x=0, y=0, showBoundary=rl_config.showBoundary): """This is the top level function, which draws the drawing at the given location. The recursive part is handled by drawNode.""" #stash references for ease of communication self._canvas = canvas canvas.__dict__['_drawing'] = self._drawing = drawing try: if showBoundary: canvas.rect(x, y, drawing.width, drawing.height) canvas.saveState() deltas = STATE_DEFAULTS.copy() deltas['transform'] = [1,0,0,1,x,y] self._tracker.push(deltas) self.applyState() self.drawNode(drawing) self.pop() canvas.restoreState() finally: #remove any circular references del self._canvas, self._drawing, canvas._drawing
def draw(self, drawing, canvas, x=0, y=0, showBoundary=rl_config.showBoundary): """This is the top level function, which draws the drawing at the given location. The recursive part is handled by drawNode.""" #stash references for ease of communication self._canvas = canvas canvas.__dict__['_drawing'] = self._drawing = drawing try: if showBoundary: canvas.rect(x, y, drawing.width, drawing.height) canvas.saveState() deltas = STATE_DEFAULTS.copy() deltas['transform'] = canvas._baseCTM[0:4]+(x,y) self._tracker.push(deltas) self.applyState() self.drawNode(drawing) self.pop() canvas.restoreState() finally: #remove any circular references del self._canvas, self._drawing, canvas._drawing
4,794
def drawToPMCanvas(d, dpi=72, bg=0xffffff, configPIL=None, showBoundary=rl_config.showBoundary): w = int(d.width+0.5) h = int(d.height+0.5) c = PMCanvas(w, h, dpi=dpi, bg=bg, configPIL=configPIL) draw(d, c, 0, 0) return c
def drawToPMCanvas(d, dpi=72, bg=0xffffff, configPIL=None, showBoundary=rl_config.showBoundary): w = int(d.width*dpi/72.0+0.5) h = int(d.height*dpi/72.0+0.5) c = PMCanvas(w, h, dpi=dpi, bg=bg, configPIL=configPIL) draw(d, c, 0, 0) return c
4,795
def breakLines(self, width): """ Returns a broken line structure. There are two cases
def breakLines(self, width): """ Returns a broken line structure. There are two cases
4,796
def breakLines(self, width): """ Returns a broken line structure. There are two cases
def breakLines(self, width): """ Returns a broken line structure. There are two cases
4,797
def breakLines(self, width): """ Returns a broken line structure. There are two cases
def breakLines(self, width): """ Returns a broken line structure. There are two cases
4,798
def breakLines(self, width): """ Returns a broken line structure. There are two cases
def breakLines(self, width): """ Returns a broken line structure. There are two cases
4,799