bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def testFonts(): # make a custom encoded font. import reportlab.pdfgen.canvas c = reportlab.pdfgen.canvas.Canvas('testfonts.pdf') c.setPageCompression(0) c.setFont('Helvetica', 12) c.drawString(100, 700, 'The text below should be in a custom encoding in which all vowels become "z"') # invent a new language where vowel... | def testFonts(): # make a custom encoded font. import reportlab.pdfgen.canvas c = reportlab.pdfgen.canvas.Canvas('testfonts.pdf') c.setPageCompression(0) c.setFont('Helvetica', 12) c.drawString(100, 700, 'The text below should be in a custom encoding in which all vowels become "z"') # invent a new language where vowel... | 5,100 |
def testFonts(): # make a custom encoded font. import reportlab.pdfgen.canvas c = reportlab.pdfgen.canvas.Canvas('testfonts.pdf') c.setPageCompression(0) c.setFont('Helvetica', 12) c.drawString(100, 700, 'The text below should be in a custom encoding in which all vowels become "z"') # invent a new language where vowel... | def testFonts(): # make a custom encoded font. import reportlab.pdfgen.canvas c = reportlab.pdfgen.canvas.Canvas('testfonts.pdf') c.setPageCompression(0) c.setFont('Helvetica', 12) c.drawString(100, 700, 'The text below should be in a custom encoding in which all vowels become "z"') # invent a new language where vowel... | 5,101 |
def testFonts(): # make a custom encoded font. import reportlab.pdfgen.canvas c = reportlab.pdfgen.canvas.Canvas('testfonts.pdf') c.setPageCompression(0) c.setFont('Helvetica', 12) c.drawString(100, 700, 'The text below should be in a custom encoding in which all vowels become "z"') # invent a new language where vowel... | def testFonts(): # make a custom encoded font. import reportlab.pdfgen.canvas c = reportlab.pdfgen.canvas.Canvas('testfonts.pdf') c.setPageCompression(0) c.setFont('Helvetica', 12) c.drawString(100, 700, 'The text below should be in a custom encoding in which all vowels become "z"') # invent a new language where vowel... | 5,102 |
def testFonts(): # make a custom encoded font. import reportlab.pdfgen.canvas c = reportlab.pdfgen.canvas.Canvas('testfonts.pdf') c.setPageCompression(0) c.setFont('Helvetica', 12) c.drawString(100, 700, 'The text below should be in a custom encoding in which all vowels become "z"') # invent a new language where vowel... | def testFonts(): # make a custom encoded font. import reportlab.pdfgen.canvas c = reportlab.pdfgen.canvas.Canvas('testfonts.pdf') c.setPageCompression(0) c.setFont('Helvetica', 12) c.drawString(100, 700, 'The text below should be in a custom encoding in which all vowels become "z"') # invent a new language where vowel... | 5,103 |
def testFonts(): # make a custom encoded font. import reportlab.pdfgen.canvas c = reportlab.pdfgen.canvas.Canvas('testfonts.pdf') c.setPageCompression(0) c.setFont('Helvetica', 12) c.drawString(100, 700, 'The text below should be in a custom encoding in which all vowels become "z"') # invent a new language where vowel... | def testFonts(): # make a custom encoded font. import reportlab.pdfgen.canvas c = reportlab.pdfgen.canvas.Canvas('testfonts.pdf') c.setPageCompression(0) c.setFont('Helvetica', 12) c.drawString(100, 700, 'The text below should be in a custom encoding in which all vowels become "z"') # invent a new language where vowel... | 5,104 |
def testFonts(): # make a custom encoded font. import reportlab.pdfgen.canvas c = reportlab.pdfgen.canvas.Canvas('testfonts.pdf') c.setPageCompression(0) c.setFont('Helvetica', 12) c.drawString(100, 700, 'The text below should be in a custom encoding in which all vowels become "z"') # invent a new language where vowel... | def testFonts(): # make a custom encoded font. import reportlab.pdfgen.canvas c = reportlab.pdfgen.canvas.Canvas('testfonts.pdf') c.setPageCompression(0) c.setFont('Helvetica', 12) c.drawString(100, 700, 'The text below should be in a custom encoding in which all vowels become "z"') # invent a new language where vowel... | 5,105 |
def testFonts(): # make a custom encoded font. import reportlab.pdfgen.canvas c = reportlab.pdfgen.canvas.Canvas('testfonts.pdf') c.setPageCompression(0) c.setFont('Helvetica', 12) c.drawString(100, 700, 'The text below should be in a custom encoding in which all vowels become "z"') # invent a new language where vowel... | def testFonts(): # make a custom encoded font. import reportlab.pdfgen.canvas c = reportlab.pdfgen.canvas.Canvas('testfonts.pdf') c.setPageCompression(0) c.setFont('Helvetica', 12) c.drawString(100, 700, 'The text below should be in a custom encoding in which all vowels become "z"') # invent a new language where vowel... | 5,106 |
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 extr... | def getFunctionBody(f, linesInFile): """Get the full source code for a function or method. Works with a list of lines since we will typically grab several things out of the same file. It extracts a multiline text block. It can be fooled by devious use of dedentation inside brackets, which could be fixed in a future ... | 5,107 |
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 extr... | 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 extr... | 5,108 |
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 extr... | 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 extr... | 5,109 |
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 extr... | 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 extr... | 5,110 |
def format(self, document): dictionary = self.dictionary # copy it for modification dictionary = PDFDictionary(dictionary.dict.copy()) content = self.content filters = self.filters if self.content is None: raise ValueError, "stream content not set" if filters is None: filters = document.defaultStreamFilters # only appl... | def format(self, document): dictionary = self.dictionary # copy it for modification dictionary = PDFDictionary(dictionary.dict.copy()) content = self.content filters = self.filters if self.content is None: raise ValueError, "stream content not set" if filters is None: filters = document.defaultStreamFilters # only appl... | 5,111 |
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... | 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... | 5,112 |
def recursiveImport(modulename, baseDir=None, noCWD=0, debug=0): """Dynamically imports possible packagized module, or raises ImportError""" import imp parts = string.split(modulename, '.') name = parts[0] if baseDir is None: path = sys.path[:] else: if type(baseDir) not in SeqTypes: path = [baseDir] else: path = list... | def recursiveImport(modulename, baseDir=None, noCWD=0, debug=0): """Dynamically imports possible packagized module, or raises ImportError""" import imp parts = string.split(modulename, '.') name = parts[0] if baseDir is None: path = sys.path[:] else: if type(baseDir) not in SeqTypes: path = [baseDir] else: path = list... | 5,113 |
def recursiveImport(modulename, baseDir=None, noCWD=0, debug=0): """Dynamically imports possible packagized module, or raises ImportError""" import imp parts = string.split(modulename, '.') name = parts[0] if baseDir is None: path = sys.path[:] else: if type(baseDir) not in SeqTypes: path = [baseDir] else: path = list... | def recursiveImport(modulename, baseDir=None, noCWD=0, debug=0): """Dynamically imports possible packagized module, or raises ImportError""" import imp parts = string.split(modulename, '.') name = parts[0] if baseDir is None: path = sys.path[:] else: if type(baseDir) not in SeqTypes: path = [baseDir] else: path = list... | 5,114 |
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.''' | 5,115 |
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. | 5,116 |
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. | 5,117 |
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. | 5,118 |
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. | 5,119 |
def _getLineFunc(self, start, end, parent=None): _3d_dx = getattr(parent,'_3d_dx',None) if _3d_dx is not None: _3d_dy = getattr(parent,'_3d_dy',None) f = self._dataIndex and self._cyLine3d or self._cxLine3d return lambda v, s=start, e=end, f=f: f(v,s,e,_3d_dx=_3d_dx,_3d_dy=_3d_dy) else: f = self._dataIndex and self._cy... | def _getLineFunc(self, start, end, parent=None): _3d_dx = getattr(parent,'_3d_dx',None) if _3d_dx is not None: _3d_dy = getattr(parent,'_3d_dy',None) f = self._dataIndex and self._cyLine3d or self._cxLine3d return lambda v, s=start, e=end, f=f,_3d_dx=_3d_dx,_3d_dy=_3d_dy: f(v,s,e,_3d_dx=_3d_dx,_3d_dy=_3d_dy) else: f = ... | 5,120 |
def drawCentredString(self, x, y, text, text_anchor='middle'): if self.fillColor is not None: textLen = stringWidth(text, self._font,self._fontSize) if text_anchor=='end': x = x-textLen elif text_anchor=='middle': x = x - textLen/2 self.drawString(x,y,text) | def drawCentredString(self, x, y, text, text_anchor='middle'): if self._fillColor is not None: textLen = stringWidth(text, self._font,self._fontSize) if text_anchor=='end': x = x-textLen elif text_anchor=='middle': x = x - textLen/2 self.drawString(x,y,text) | 5,121 |
def draw(self): #center it self.canv.drawImage(self.filename, 0, 0, self.drawWidth, self.drawHeight, mask=mask, ) | def draw(self): #center it self.canv.drawImage(self.filename, 0, 0, self.drawWidth, self.drawHeight, mask=self._mask, ) | 5,122 |
def calcPositions(self): """Works out where they go. | def calcPositions(self): """Works out where they go. | 5,123 |
def gAdd(t,g=g,fontName=fontName,fontSize=fontSize,fillColor=fillColor): t.fontName = fontName t.fontSize = fontSize t.fillColor = fillColor return g.add(t) | def gAdd(t,g=g,fontName=fontName,fontSize=fontSize,fillColor=fillColor): t.fontName = fontName t.fontSize = fontSize t.fillColor = fillColor return g.add(t) | 5,124 |
def _getFragWords(frags): ''' given a Parafrag list return a list of fragwords [[size, (f00,w00), ..., (f0n,w0n)],....,[size, (fm0,wm0), ..., (f0n,wmn)]] each pair f,w represents a style and some string each sublist represents a word ''' R = [] W = [] n = 0 for f in frags: text = f.text #del f.text # we can't do this u... | def _getFragWords(frags): ''' given a Parafrag list return a list of fragwords [[size, (f00,w00), ..., (f0n,w0n)],....,[size, (fm0,wm0), ..., (f0n,wmn)]] each pair f,w represents a style and some string each sublist represents a word ''' R = [] W = [] n = 0 for f in frags: text = f.text #del f.text # we can't do this u... | 5,125 |
def raiseConfigError(msg): import exceptions class ConfigError(exceptions.Exception): pass raise ConfigError(msg) | def raiseConfigError(msg): import exceptions class ConfigError(exceptions.Exception): pass raise ConfigError(msg) | 5,126 |
def _addObjImport(obj,I): '''add an import of obj's class to a dictionary of imports''' from inspect import getmodule c = obj.__class__ m = getmodule(c).__name__ cn = c.__name__ if not I.has_key(m): I[m] = [cn] elif cn not in I[m]: I[m].append(cn) | def _addObjImport(obj,I,n=None): '''add an import of obj's class to a dictionary of imports''' from inspect import getmodule c = obj.__class__ m = getmodule(c).__name__ cn = c.__name__ if not I.has_key(m): I[m] = [cn] elif cn not in I[m]: I[m].append(cn) | 5,127 |
def _addObjImport(obj,I): '''add an import of obj's class to a dictionary of imports''' from inspect import getmodule c = obj.__class__ m = getmodule(c).__name__ cn = c.__name__ if not I.has_key(m): I[m] = [cn] elif cn not in I[m]: I[m].append(cn) | def _addObjImport(obj,I): '''add an import of obj's class to a dictionary of imports''' from inspect import getmodule c = obj.__class__ m = getmodule(c).__name__ n = n or c.__name__ if not I.has_key(m): I[m] = [cn] elif cn not in I[m]: I[m].append(cn) | 5,128 |
def _addObjImport(obj,I): '''add an import of obj's class to a dictionary of imports''' from inspect import getmodule c = obj.__class__ m = getmodule(c).__name__ cn = c.__name__ if not I.has_key(m): I[m] = [cn] elif cn not in I[m]: I[m].append(cn) | def _addObjImport(obj,I): '''add an import of obj's class to a dictionary of imports''' from inspect import getmodule c = obj.__class__ m = getmodule(c).__name__ cn = c.__name__ if not I.has_key(m): I[m] = [n] elif n not in I[m]: I[m].append(n) | 5,129 |
def definePath(pathSegs=[],isClipPath=0, dx=0, dy=0, **kw): O = [] P = [] for seg in pathSegs: if type(seg) not in [ListType,TupleType]: opName = seg args = [] else: opName = seg[0] args = seg[1:] if opName not in _PATH_OP_NAMES: raise ValueError, 'bad operator name %s' % opName op = _PATH_OP_NAMES.index(opName) if len... | def definePath(pathSegs=[],isClipPath=0, dx=0, dy=0, **kw): O = [] P = [] for seg in pathSegs: if type(seg) not in [ListType,TupleType]: opName = seg args = [] else: opName = seg[0] args = seg[1:] if opName not in _PATH_OP_NAMES: raise ValueError, 'bad operator name %s' % opName op = _PATH_OP_NAMES.index(opName) if len... | 5,130 |
def start_onDraw(self,attr): defn = ParaFrag() if attr.has_key('name'): defn.name = attr['name'] else: self._syntax_error('<onDraw/> needs at least a name attribute') | def start_onDraw(self,attr): defn = ParaFrag() if attr.has_key('name'): defn.name = attr['name'] else: self._syntax_error('<onDraw/> needs at least a name attribute') | 5,131 |
def start_onDraw(self,attr): defn = ParaFrag() if attr.has_key('name'): defn.name = attr['name'] else: self._syntax_error('<onDraw/> needs at least a name attribute') | def start_onDraw(self,attr): defn = ParaFrag() if attr.has_key('name'): defn.name = attr['name'] else: self._syntax_error('<onDraw/> needs at least a name attribute') | 5,132 |
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] | 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] | 5,133 |
def __getitem__(self, index): try: return self._children[index] except KeyError: child = self._prototype() #should we copy down? how to keep in synch? child.setProperties(Widget.getProperties(self)) self._children[index] = child return child | def __getitem__(self, index): try: return self._children[index] except KeyError: child = self._prototype() #should we copy down? how to keep in synch?for i in child._attrMap.keys(): del child.__dict__[i] child = TypedPropertyElementWrapper(self,child) self._children[index] = child return child | 5,134 |
def getModuleObjects(folder, rootName, typ): "Get a list of all function objects defined *somewhere* in a package." folders = [folder] + subFoldersOfFolder(folder) objects = [] for f in folders: sys.path.insert(0, f) os.chdir(f) pattern = os.path.join('*.py') prefix = f[string.find(f, rootName):] prefix = string.repl... | def getModuleObjects(folder, rootName, typ): "Get a list of all function objects defined *somewhere* in a package." folders = [folder] + subFoldersOfFolder(folder) objects = [] for f in folders: sys.path.insert(0, f) os.chdir(f) pattern = os.path.join('*.py') prefix = f[string.find(f, rootName):] prefix = string.repl... | 5,135 |
def getModuleObjects(folder, rootName, typ): "Get a list of all function objects defined *somewhere* in a package." folders = [folder] + subFoldersOfFolder(folder) objects = [] for f in folders: sys.path.insert(0, f) os.chdir(f) pattern = os.path.join('*.py') prefix = f[string.find(f, rootName):] prefix = string.repl... | def getModuleObjects(folder, rootName, typ): "Get a list of all function objects defined *somewhere* in a package." folders = [folder] + subFoldersOfFolder(folder) objects = [] for f in folders: sys.path.insert(0, f) os.chdir(f) pattern = os.path.join('*.py') prefix = f[string.find(f, rootName):] prefix = string.repl... | 5,136 |
def draw(self): s = float(self.size) #abbreviate as we will use this a lot g = Group() | def draw(self): s = float(self.size) #abbreviate as we will use this a lot g = Group() | 5,137 |
def test(): """This function produces two pdf files with examples of all the signs and symbols from this file. """ | def test(): """This function produces three pdf files with examples of all the signs and symbols from this file. """ | 5,138 |
def _drawBkgrnd(self): nrows = self._nrows ncols = self._ncols for cmd, (sc, sr), (ec, er), arg in self._bkgrndcmds: if sc < 0: sc = sc + ncols if ec < 0: ec = ec + ncols if sr < 0: sr = sr + nrows if er < 0: er = er + nrows x0 = self._colpositions[sc] y0 = self._rowpositions[sr] x1 = self._colpositions[min(ec+1,ncols)... | def _drawBkgrnd(self): nrows = self._nrows ncols = self._ncols for cmd, (sc, sr), (ec, er), arg in self._bkgrndcmds: if sc < 0: sc = sc + ncols if ec < 0: ec = ec + ncols if sr < 0: sr = sr + nrows if er < 0: er = er + nrows x0 = self._colpositions[sc] y0 = self._rowpositions[sr] x1 = self._colpositions[min(ec+1,ncols)... | 5,139 |
def _drawBkgrnd(self): nrows = self._nrows ncols = self._ncols for cmd, (sc, sr), (ec, er), arg in self._bkgrndcmds: if sc < 0: sc = sc + ncols if ec < 0: ec = ec + ncols if sr < 0: sr = sr + nrows if er < 0: er = er + nrows x0 = self._colpositions[sc] y0 = self._rowpositions[sr] x1 = self._colpositions[min(ec+1,ncols)... | def _drawBkgrnd(self): nrows = self._nrows ncols = self._ncols for cmd, (sc, sr), (ec, er), arg in self._bkgrndcmds: if sc < 0: sc = sc + ncols if ec < 0: ec = ec + ncols if sr < 0: sr = sr + nrows if er < 0: er = er + nrows x0 = self._colpositions[sc] y0 = self._rowpositions[sr] x1 = self._colpositions[min(ec+1,ncols)... | 5,140 |
def startGroup(self): if self.verbose: print "+++ begin SVGCanvas.startGroup" group = transformNode(self.doc, "g", transform="") self.currGroup.appendChild(group) self.currGroup = group if self.verbose: print "+++ end SVGCanvas.startGroup" | def startGroup(self): if self.verbose: print "+++ begin SVGCanvas.startGroup" currGroup, group = self.currGroup, transformNode(self.doc, "g", transform="") currGroup.appendChild(group) self.currGroup = group if self.verbose: print "+++ end SVGCanvas.startGroup" | 5,141 |
def startGroup(self): if self.verbose: print "+++ begin SVGCanvas.startGroup" group = transformNode(self.doc, "g", transform="") self.currGroup.appendChild(group) self.currGroup = group if self.verbose: print "+++ end SVGCanvas.startGroup" | def startGroup(self): if self.verbose: print "+++ begin SVGCanvas.startGroup" group = transformNode(self.doc, "g", transform="") self.currGroup.appendChild(group) self.currGroup = group if self.verbose: print "+++ end SVGCanvas.startGroup" | 5,142 |
def endGroup(self): if self.verbose: print "+++ begin SVGCanvas.endGroup" if not self.currGroup.getAttribute("transform"): pass #self.currGroup.removeAttribute("transform") # self.currGroup = self.currGroup.parentNode if self.verbose: print "+++ end SVGCanvas.endGroup" | def endGroup(self): if self.verbose: print "+++ begin SVGCanvas.endGroup" if not self.currGroup.getAttribute("transform"): pass #self.currGroup.removeAttribute("transform") # self.currGroup = self.currGroup.parentNode if self.verbose: print "+++ end SVGCanvas.endGroup" | 5,143 |
def transform(self, a, b, c, d, e, f): if self.verbose: print "!!! begin SVGCanvas.transform", a, b, c, d, e, f tr = self.currGroup.getAttribute("transform") t = 'matrix(%f, %f, %f, %f, %f, %f)' % (a,b,c,d,e,f) if (a, b, c, d, e, f) != (1, 0, 0, 1, 0, 0): self.currGroup.setAttribute("transform", "%s %s" % (tr, t)) # se... | deftransform(self,a,b,c,d,e,f):ifself.verbose:print"!!!beginSVGCanvas.transform",a,b,c,d,e,ftr=self.currGroup.getAttribute("transform")t='matrix(%f,%f,%f,%f,%f,%f)'%(a,b,c,d,e,f)if(a,b,c,d,e,f)!=(1,0,0,1,0,0):self.currGroup.setAttribute("transform","%s%s"%(tr,t))#self.currGroup=self.currGroup.parentNode | 5,144 |
def drawGroup(self, group): if self.verbose: print "### begin _SVGRenderer.drawGroup" | def drawGroup(self, group): if self.verbose: print "### begin _SVGRenderer.drawGroup" | 5,145 |
def drawGroup(self, group): if self.verbose: print "### begin _SVGRenderer.drawGroup" | def drawGroup(self, group): if self.verbose: print "### begin _SVGRenderer.drawGroup" | 5,146 |
def applyStateChanges(self, delta, newState): """This takes a set of states, and outputs the operators needed to set those properties""" | def applyStateChanges(self, delta, newState): """This takes a set of states, and outputs the operators needed to set those properties""" | 5,147 |
def _setRange(self, dataSeries): """Set minimum and maximum axis values. | def _setRange(self, dataSeries): """Set minimum and maximum axis values. | 5,148 |
def _getFragWords(frags): ''' given a fragment list return a list of lists [[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... | def _getFragWords(frags): ''' given a fragment list return a list of lists [[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... | 5,149 |
def _getFragWords(frags): ''' given a fragment list return a list of lists [[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... | def _getFragWords(frags): ''' given a fragment list return a list of lists [[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... | 5,150 |
def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word li... | def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word li... | 5,151 |
def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word li... | def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word li... | 5,152 |
def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word li... | def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word li... | 5,153 |
def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word li... | def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word li... | 5,154 |
def __init__(self, places=2, decimalSep='.', thousandSep=None, prefix=None, suffix=None): self.decimalPlaces = places self.decimalSeparator = decimalSep self.thousandSeparator = thousandSep self.prefix = prefix self.suffix = suffix | def __init__(self, places=2, decimalSep='.', thousandSep=None, prefix=None, suffix=None): self.places = places self.dot = decimalSep self.comma = thousandSep self.prefix = prefix self.suffix = suffix | 5,155 |
def format(self, num): # positivize the numbers sign=num<0 if sign: num = -num places, sep = self.decimalPlaces, self.decimalSeparator strip = places<=0 if places and strip: places = -places strInt, strFrac = (('%.' + str(places) + 'f') % num).split('.') | def format(self, num): # positivize the numbers sign=num<0 if sign: num = -num places, sep = self.places, self.dot strip = places<=0 if places and strip: places = -places strInt, strFrac = (('%.' + str(places) + 'f') % num).split('.') | 5,156 |
def format(self, num): # positivize the numbers sign=num<0 if sign: num = -num places, sep = self.decimalPlaces, self.decimalSeparator strip = places<=0 if places and strip: places = -places strInt, strFrac = (('%.' + str(places) + 'f') % num).split('.') | def format(self, num): # positivize the numbers sign=num<0 if sign: num = -num places, sep = self.decimalPlaces, self.decimalSeparator strip = places<=0 if places and strip: places = -places strInt, strFrac = (('%.' + str(places) + 'f') % num).split('.') | 5,157 |
def format(self, num): # positivize the numbers sign=num<0 if sign: num = -num places, sep = self.decimalPlaces, self.decimalSeparator strip = places<=0 if places and strip: places = -places strInt, strFrac = (('%.' + str(places) + 'f') % num).split('.') | def format(self, num): # positivize the numbers sign=num<0 if sign: num = -num places, sep = self.decimalPlaces, self.decimalSeparator strip = places<=0 if places and strip: places = -places strInt, strFrac = (('%.' + str(places) + 'f') % num).split('.') | 5,158 |
def format(self, num): # positivize the numbers sign=num<0 if sign: num = -num places, sep = self.decimalPlaces, self.decimalSeparator strip = places<=0 if places and strip: places = -places strInt, strFrac = (('%.' + str(places) + 'f') % num).split('.') | def format(self, num): # positivize the numbers sign=num<0 if sign: num = -num places, sep = self.decimalPlaces, self.decimalSeparator strip = places<=0 if places and strip: places = -places strInt, strFrac = (('%.' + str(places) + 'f') % num).split('.') | 5,159 |
def format(self, num): # positivize the numbers sign=num<0 if sign: num = -num places, sep = self.decimalPlaces, self.decimalSeparator strip = places<=0 if places and strip: places = -places strInt, strFrac = (('%.' + str(places) + 'f') % num).split('.') | def format(self, num): # positivize the numbers sign=num<0 if sign: num = -num places, sep = self.decimalPlaces, self.decimalSeparator strip = places<=0 if places and strip: places = -places strInt, strFrac = (('%.' + str(places) + 'f') % num).split('.') | 5,160 |
def format(self, num): # positivize the numbers sign=num<0 if sign: num = -num places, sep = self.decimalPlaces, self.decimalSeparator strip = places<=0 if places and strip: places = -places strInt, strFrac = (('%.' + str(places) + 'f') % num).split('.') | def format(self, num): # positivize the numbers sign=num<0 if sign: num = -num places, sep = self.decimalPlaces, self.decimalSeparator strip = places<=0 if places and strip: places = -places strInt, strFrac = (('%.' + str(places) + 'f') % num).split('.') | 5,161 |
def parsexml0(xmltext, startingat=0, toplevel=1, # snarf in some globals strip=string.strip, split=string.split, find=string.find, entityReplacer=unEscapeContentList, #len=len, None=None #LENCDATAMARKER=LENCDATAMARKER, CDATAMARKER=CDATAMARKER ): """simple recursive descent xml parser... return (dictionary, endcharacter... | def parsexml0(xmltext, startingat=0, toplevel=1, # snarf in some globals strip=string.strip, split=string.split, find=string.find, entityReplacer=unEscapeContentList, #len=len, None=None #LENCDATAMARKER=LENCDATAMARKER, CDATAMARKER=CDATAMARKER ): """simple recursive descent xml parser... return (dictionary, endcharacter... | 5,162 |
def saveAsPresentation(self): """Write the PDF document, one slide per page.""" if self.verbose: print 'saving presentation...' pageSize = (self.pageWidth, self.pageHeight) filename = os.path.splitext(self.sourceFilename)[0] + '.pdf' if self.outDir: filename = os.path.join(self.outDir,os.path.basename(filename)) if sel... | def saveAsPresentation(self): """Write the PDF document, one slide per page.""" if self.verbose: print 'saving presentation...' pageSize = (self.pageWidth, self.pageHeight) if self.sourceFilename: filename = os.path.splitext(self.sourceFilename)[0] + '.pdf' if self.outDir: filename = os.path.join(self.outDir,os.path.ba... | 5,163 |
def saveAsPresentation(self): """Write the PDF document, one slide per page.""" if self.verbose: print 'saving presentation...' pageSize = (self.pageWidth, self.pageHeight) filename = os.path.splitext(self.sourceFilename)[0] + '.pdf' if self.outDir: filename = os.path.join(self.outDir,os.path.basename(filename)) if sel... | def saveAsPresentation(self): """Write the PDF document, one slide per page.""" if self.verbose: print 'saving presentation...' pageSize = (self.pageWidth, self.pageHeight) filename = os.path.splitext(self.sourceFilename)[0] + '.pdf' if self.outDir: filename = os.path.join(self.outDir,os.path.basename(filename)) if sel... | 5,164 |
def saveAsHandout(self): """Write the PDF document, multiple slides per page.""" | def saveAsHandout(self): """Write the PDF document, multiple slides per page.""" | 5,165 |
def save(self): "Save the PDF document." | def save(self): "Save the PDF document." | 5,166 |
def save(self): "Save the PDF document." | def save(self): "Save the PDF document." | 5,167 |
def process(datafilename, notes=0, handout=0, cols=0, verbose=0, outDir=None): "Process one PythonPoint source file." from reportlab.tools.pythonpoint.stdparser import PPMLParser parser = PPMLParser() parser.sourceFilename = datafilename rawdata = open(datafilename).read() parser.feed(rawdata) pres = parser.getPresenta... | def process(datafilename, notes=0, handout=0, cols=0, verbose=0, outDir=None): "Process one PythonPoint source file." from reportlab.tools.pythonpoint.stdparser import PPMLParser parser = PPMLParser() parser.sourceFilename = datafilename parser.feed(rawdata) pres = parser.getPresentation() pres.sourceFilename = datafil... | 5,168 |
def process(datafilename, notes=0, handout=0, cols=0, verbose=0, outDir=None): "Process one PythonPoint source file." from reportlab.tools.pythonpoint.stdparser import PPMLParser parser = PPMLParser() parser.sourceFilename = datafilename rawdata = open(datafilename).read() parser.feed(rawdata) pres = parser.getPresenta... | def process(datafilename, notes=0, handout=0, cols=0, verbose=0, outDir=None): "Process one PythonPoint source file." from reportlab.tools.pythonpoint.stdparser import PPMLParser parser = PPMLParser() parser.sourceFilename = datafilename rawdata = open(datafilename).read() parser.feed(rawdata) pres = parser.getPresenta... | 5,169 |
def process(datafilename, notes=0, handout=0, cols=0, verbose=0, outDir=None): "Process one PythonPoint source file." from reportlab.tools.pythonpoint.stdparser import PPMLParser parser = PPMLParser() parser.sourceFilename = datafilename rawdata = open(datafilename).read() parser.feed(rawdata) pres = parser.getPresenta... | defreturn pdfcontent process(datafilename,return pdfcontent notes=0,return pdfcontent handout=0,return pdfcontent cols=0,return pdfcontent verbose=0,return pdfcontent outDir=None):return pdfcontent "Processreturn pdfcontent onereturn pdfcontent PythonPointreturn pdfcontent sourcereturn pdfcontent file."return pdfconten... | 5,170 |
def __init__(self, filename, width=None, height=None, kind='direct', mask="auto", lazy=1): """If size to draw at not specified, get it from the image.""" self.hAlign = 'CENTER' self._mask = mask # if it is a JPEG, will be inlined within the file - # but we still need to know its size now fp = hasattr(filename,'read') i... | def __init__(self, filename, width=None, height=None, kind='direct', mask="auto", lazy=1): """If size to draw at not specified, get it from the image.""" self.hAlign = 'CENTER' self._mask = mask # if it is a JPEG, will be inlined within the file - # but we still need to know its size now fp = hasattr(filename,'read') i... | 5,171 |
def __getattr__(self,a): if a=='_img': from reportlab.lib.utils import ImageReader #this may raise an error self._img = ImageReader(self.filename) return self._img elif a in ('drawWidth','drawHeight','imageWidth','imageHeight'): self._setup_inner() return self.__dict__[a] raise AttributeError(a) | def __getattr__(self,a): if a=='_img': from reportlab.lib.utils import ImageReader #this may raise an error self._img = ImageReader(self._file) del self._file return self._img elif a in ('drawWidth','drawHeight','imageWidth','imageHeight'): self._setup_inner() return self.__dict__[a] raise AttributeError(a) | 5,172 |
def cvs_checkout(d): os.chdir(d) cvsdir = os.path.join(d,projdir) recursive_rmdir(cvsdir) recursive_rmdir('docs') cvs = find_exe('cvs') python = find_exe('python') if cvs is None: os.exit(1) os.environ['CVSROOT']=':pserver:%s@cvs.reportlab.sourceforge.net:/cvsroot/reportlab' % USER if release: do_exec(cvs+(' export -... | def cvs_checkout(d): os.chdir(d) cvsdir = os.path.join(d,projdir) recursive_rmdir(cvsdir) recursive_rmdir('docs') cvs = find_exe('cvs') python = find_exe('python') if cvs is None: os.exit(1) os.environ['CVSROOT']=':pserver:%s@cvs.reportlab.sourceforge.net:/cvsroot/reportlab' % USER if release: do_exec(cvs+(' export -... | 5,173 |
def cvs_checkout(d): os.chdir(d) cvsdir = os.path.join(d,projdir) recursive_rmdir(cvsdir) recursive_rmdir('docs') cvs = find_exe('cvs') python = find_exe('python') if cvs is None: os.exit(1) os.environ['CVSROOT']=':pserver:%s@cvs.reportlab.sourceforge.net:/cvsroot/reportlab' % USER if release: do_exec(cvs+(' export -... | def cvs_checkout(d): os.chdir(d) cvsdir = os.path.join(d,projdir) recursive_rmdir(cvsdir) recursive_rmdir('docs') cvs = find_exe('cvs') python = find_exe('python') if cvs is None: os.exit(1) os.environ['CVSROOT']=':pserver:%s@cvs.reportlab.sourceforge.net:/cvsroot/reportlab' % USER if release: do_exec(cvs+(' export -... | 5,174 |
def makeSuite(folder): "Build a test suite of all available test files." allTests = unittest.TestSuite() sys.path.insert(0, folder) for filename in GlobDirectoryWalker(folder, 'test_*.py'): modname = os.path.splitext(os.path.basename(filename))[0] try: module = __import__(modname) allTests.addTest(module.makeSuite())... | def makeSuite(folder): "Build a test suite of all available test files." allTests = unittest.TestSuite() sys.path.insert(0, folder) for filename in GlobDirectoryWalker(folder, 'test_*.py'): modname = os.path.splitext(os.path.basename(filename))[0] try: module = __import__(modname) allTests.addTest(module.makeSuite())... | 5,175 |
def testEntityUnicode(self): "Numeric entities should be unescaped by parser" txt = u"Hello © copyright" fragList = ParaParser().parse(txt, self.style)[1] self.assertEquals(map(lambda x:x.text, fragList), [u'Hello ',u'\xc2\xa9',u' copyright']) | def testEntityUnicode(self): "Numeric entities should be unescaped by parser" txt = u"Hello © copyright" fragList = ParaParser().parse(txt, self.style)[1] self.assertEquals(map(lambda x:x.text, fragList), [u'Hello ',u'\xc2\xa9',u' copyright']) | 5,176 |
def getCommentary(): """Returns the story for the commentary - all the paragraphs.""" styleSheet = getSampleStyleSheet() story = [] story.append(Paragraph(""" PLATYPUS User Guide and Test Script """, styleSheet['Heading1'])) spam = """ Welcome to PLATYPUS! Platypus stands for "Page Layout and Typography Using Scri... | def getCommentary(): """Returns the story for the commentary - all the paragraphs.""" styleSheet = getSampleStyleSheet() story = [] story.append(Paragraph(""" PLATYPUS User Guide and Test Script """, styleSheet['Heading1'])) spam = """ Welcome to PLATYPUS! Platypus stands for "Page Layout and Typography Using Scri... | 5,177 |
def wrap(self, availWidth, availHeight): """This will be called by the enclosing frame before objects are asked their size, drawn or whatever. It returns the size actually used.""" return (self.width, self.height) | def wrap(self, availWidth, availHeight): """This will be called by the enclosing frame before objects are asked their size, drawn or whatever. It returns the size actually used.""" return (self.width, self.height) | 5,178 |
def wrap(self, availWidth, availHeight): """This will be called by the enclosing frame before objects are asked their size, drawn or whatever. It returns the size actually used.""" return (self.width, self.height) | def wrap(self, availWidth, availHeight): """This will be called by the enclosing frame before objects are asked their size, drawn or whatever. It returns the size actually used.""" return (self.width, self.height) | 5,179 |
def wrap(self, availWidth, availHeight): """This will be called by the enclosing frame before objects are asked their size, drawn or whatever. It returns the size actually used.""" return (self.width, self.height) | def wrap(self, availWidth, availHeight): """This will be called by the enclosing frame before objects are asked their size, drawn or whatever.It returns the size actually used.""" return (self.width, self.height) | 5,180 |
def ellipse(self, x1, y1, x2, y2, stroke=1, fill=0): """Draw an ellipse with foci at (x1,y1) (x2,y2). Uses bezierArc, which conveniently handles 360 degrees. Special thanks to Robert Kern.""" ### XXXX above documentation is WRONG. Exactly what are (x1,y1), (x2,y2)? pointList = pdfgeom.bezierArc(x1,y1, x2,y2, 0, 360) ... | def ellipse(self, x1, y1, x2, y2, stroke=1, fill=0): """Draw an ellipse defined by an enclosing rectangle. Note that (x1,y1) and (x2,y2) are the corner points of the enclosing rectangle. Uses bezierArc, which conveniently handles 360 degrees. Special thanks to Robert Kern.""" ### XXXX above documentation is WRONG. Ex... | 5,181 |
def ellipse(self, x1, y1, x2, y2, stroke=1, fill=0): """Draw an ellipse with foci at (x1,y1) (x2,y2). Uses bezierArc, which conveniently handles 360 degrees. Special thanks to Robert Kern.""" ### XXXX above documentation is WRONG. Exactly what are (x1,y1), (x2,y2)? pointList = pdfgeom.bezierArc(x1,y1, x2,y2, 0, 360) ... | defellipse(self,x1,y1,x2,y2,stroke=1,fill=0):"""Drawanellipsewithfociat(x1,y1)(x2,y2).UsesbezierArc,whichconvenientlyhandles360degrees.SpecialthankstoRobertKern."""###XXXXabovedocumentationisWRONG.Exactlywhatare(x1,y1),(x2,y2)?pointList=pdfgeom.bezierArc(x1,y1,x2,y2,0,360)#movetofirstpointself._code.append('n%sm'%fp_st... | 5,182 |
def test0(self): "Test if all manuals buildable from source." | def test0(self): "Test if all manuals buildable from source." | 5,183 |
def makeSuite(): suite = unittest.TestSuite() loader = unittest.TestLoader() if sys.platform[:4] != 'java': suite.addTest(loader.loadTestsFromTestCase(ManualTestCase)) return suite | def makeSuite(): suite = unittest.TestSuite() loader = unittest.TestLoader() if sys.platform[:4] != 'java': suite.addTest(loader.loadTestsFromTestCase(ManualTestCase)) return suite | 5,184 |
def findT1File(self,ext='.pfb'): if hasattr(self,'pfbFileName'): r = os.path.splitext(self.pfbFileName)[0] + ext if os.path.isfile(r): return r try: r = _fontdata.findT1File(self.name) except: afm = bruteForceSearchForAFM(self.name) if afm: if ext == '.pfb': pfb = os.path.splitext(afm)[0] + 'pfb' if os.path.isfile(pfb)... | def findT1File(self,ext='.pfb'): 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': pfb = os... | 5,185 |
def findT1File(self,ext='.pfb'): if hasattr(self,'pfbFileName'): r = os.path.splitext(self.pfbFileName)[0] + ext if os.path.isfile(r): return r try: r = _fontdata.findT1File(self.name) except: afm = bruteForceSearchForAFM(self.name) if afm: if ext == '.pfb': pfb = os.path.splitext(afm)[0] + 'pfb' if os.path.isfile(pfb)... | def findT1File(self,ext='.pfb'): if hasattr(self,'pfbFileName'): r = os.path.splitext(self.pfbFileName)[0] + ext if os.path.isfile(r): return r 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... | 5,186 |
def getTypeFace(faceName): """Lazily construct known typefaces if not found""" try: return _typefaces[faceName] except KeyError: # not found, construct it if known if faceName in standardFonts: face = TypeFace(faceName) registerTypeFace(face) #print 'auto-constructing type face %s' % face.name return face else: #try a ... | def getTypeFace(faceName): """Lazily construct known typefaces if not found""" try: return _typefaces[faceName] except KeyError: # not found, construct it if known if faceName in standardFonts: face = TypeFace(faceName) registerTypeFace(face) #print 'auto-constructing type face %s' % face.name return face else: #try a ... | 5,187 |
def drawInlineImage(self, 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""" self._currentPageHasImages = 1 | def drawInlineImage(self, 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""" self._currentPageHasImages = 1 | 5,188 |
def drawInlineImage(self, 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""" self._currentPageHasImages = 1 | def drawInlineImage(self, 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""" self._currentPageHasImages = 1 | 5,189 |
def drawInlineImage(self, 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""" self._currentPageHasImages = 1 | def drawInlineImage(self, 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""" self._currentPageHasImages = 1 | 5,190 |
def drawInlineImage(self, 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""" self._currentPageHasImages = 1 | def drawInlineImage(self, 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""" self._currentPageHasImages = 1 | 5,191 |
def drawInlineImage(self, 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""" self._currentPageHasImages = 1 | def drawInlineImage(self, 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""" self._currentPageHasImages = 1 | 5,192 |
def _makeLines(self,g,start,end,strokeColor,strokeWidth,strokeDashArray): for i in range(self._catCount + 1): y = self._y + i*self._barWidth L = Line(self._x+start, y, self._x+end, y) L.strokeColor = self.strokeColor L.strokeWidth = self.strokeWidth L.strokeDashArray = self.strokeDashArray g.add(L) | def _makeLines(self,g,start,end,strokeColor,strokeWidth,strokeDashArray): for i in range(self._catCount + 1): y = self._y + i*self._barWidth L = Line(self._x+start, y, self._x+end, y) L.strokeColor = strokeColor L.strokeWidth = strokeWidth L.strokeDashArray = strokeDashArray g.add(L) | 5,193 |
eg(""" def __init__(self,filename, pagesize=(595.27,841.89), bottomup = 1, pageCompression=0, encoding=rl_config.defaultEncoding, verbosity=0): """) | eg(""" def __init__(self,filename, pagesize=(595.27,841.89), bottomup = 1, pageCompression=0, encoding=rl_config.defaultEncoding, verbosity=0): """) | 5,194 |
def __call__(self, *args, **kwargs) : """The fake method is called, print it then call the real one.""" if not self._parent._parent._in : self._precomment() self._parent._parent._PyWrite(" %s.%s(%s)" % (self._parent._name, self._action, apply(buildargs, args, kwargs))) self._postcomment() self._parent._parent._in = ... | def __call__(self, *args, **kwargs) : """The fake method is called, print it then call the real one.""" if not self._parent._parent._in : self._precomment() self._parent._parent._PyWrite(" %s.%s(%s)" % (self._parent._name, self._action, apply(buildargs, args, kwargs))) self._postcomment() self._parent._parent._in = ... | 5,195 |
def _precomment(self) : """Outputs comments before the method call.""" if self._action == "showPage" : self._parent._PyWrite("\n # Ends page %i" % self._parent._pagenumber) elif self._action == "saveState" : state = {} d = self._parent._object.__dict__ for name in self._parent._object.STATE_ATTRIBUTES: state[name] =... | def _precomment(self) : """Outputs comments before the method call.""" if self._action == "showPage" : self._parent._PyWrite("\n # Ends page %i" % self._parent._pagenumber) elif self._action == "saveState" : state = {} d = self._parent._object.__dict__ for name in self._parent._object.STATE_ATTRIBUTES: state[name] =... | 5,196 |
def _postcomment(self) : """Outputs comments after the method call.""" if self._action == "showPage" : self._parent._pagenumber = self._parent._pagenumber + 1 self._parent._PyWrite("\n # Begins page %i" % self._parent._pagenumber) elif self._action == "endForm" : self._parent._PyWrite("") | def _postcomment(self) : """Outputs comments after the method call.""" if self._action == "showPage" : self._parent._pagenumber = self._parent._pagenumber + 1 self._parent._PyWrite("\n # Begins page %i" % self._parent._pagenumber) elif self._action in [ "endForm", "drawPath", "clipPath" ] : self._parent._PyWrite("") | 5,197 |
def _cr_0(self,n,cmds): for op, (sc, sr), (ec, er), weight, color in cmds: if sr>=n: continue if er>=n: er = n-1 self._addCommand((op, (sc, sr), (ec, er), weight, color)) | def _cr_0(self,n,cmds): for c in cmds: c = tuple(c) (sc,sr), (ec,er) = c[1:3] if sr>=n: continue if er>=n: er = n-1 self._addCommand((op, (sc, sr), (ec, er), weight, color)) | 5,198 |
def _cr_0(self,n,cmds): for op, (sc, sr), (ec, er), weight, color in cmds: if sr>=n: continue if er>=n: er = n-1 self._addCommand((op, (sc, sr), (ec, er), weight, color)) | def _cr_0(self,n,cmds): for op, (sc, sr), (ec, er), weight, color in cmds: if sr>=n: continue if er>=n: er = n-1 self._addCommand((op, (sc, sr), (ec, er), weight, color)) | 5,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.