rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
elif ext == '.afm': | elif string.lower(ext) == '.afm': | def findT1File(self,ext='.pfb'): possible_exts = (string.lower(ext), string.upper(ext)) if hasattr(self,'pfbFileName'): r_basename = os.path.splitext(self.pfbFileName)[0] for e in possible_exts: if os.path.isfile(r_basename + e): return r_basename + e try: r = _fontdata.findT1File(self.name) except: afm = bruteForceSea... | 922c14bfb04eba279f5c9a4499839c1aa941eb81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/922c14bfb04eba279f5c9a4499839c1aa941eb81/pdfmetrics.py |
possibles = glob.glob(dirname + os.sep + '*.afm') | possibles = glob.glob(dirname + os.sep + '*.[aA][fF][mM]') | def bruteForceSearchForAFM(faceName): """Looks in all AFM files on path for face with given name. Returns AFM file name or None. Ouch!""" import glob from reportlab.rl_config import T1SearchPath for dirname in T1SearchPath: if not os.path.isdir(dirname): continue possibles = glob.glob(dirname + os.sep + '*.afm') for... | 922c14bfb04eba279f5c9a4499839c1aa941eb81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/922c14bfb04eba279f5c9a4499839c1aa941eb81/pdfmetrics.py |
codes = map(ord, text) | codes = map(ord, uText) | def stringWidth(self, text, size, encoding='utf-8'): "Calculate text width" width = self.face.getCharWidth w = 0 if type(text) is UnicodeType: codes = map(ord, text) else: uText = unicode(text, encoding) codes = map(ord, text) for code in codes: w = w + width(code) return 0.001 * w * size | f498eb71a4c4a88dbb02b3ef0fa619c3bfb03496 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f498eb71a4c4a88dbb02b3ef0fa619c3bfb03496/ttfonts.py |
fileSuffix = '-graph.pdf' | fileSuffix = '.pdf' | def getFunctionBody(f, linesInFile): """Pass in the function object and the lines in the file. Since we will typically grab several things out of the same file. it extracts a multiline text block. Works with methods too.""" if hasattr(f, 'im_func'): #it's a method, drill down and get its function f = f.im_func extr... | 55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py |
if name == 'demo': PdfDocBuilder0.beginMethod(self, name, doc, sig) | pass | def beginMethod(self, name, doc, sig): if name == 'demo': PdfDocBuilder0.beginMethod(self, name, doc, sig) | 55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py |
if name == 'demo': PdfDocBuilder0.endMethod(self, name, doc, sig) | pass | def endMethod(self, name, doc, sig): if name == 'demo': PdfDocBuilder0.endMethod(self, name, doc, sig) | 55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py |
self._showWidgetDemoCode(widget) | def endClass(self, name, doc, bases): "Append a graphic demo of a widget at the end of a class." PdfDocBuilder0.endClass(self, name, doc, bases) | 55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py | |
class UmlPdfDocBuilder0(PdfDocBuilder0): "Document the skeleton of a Python module with UML class diagrams." fileSuffix = '-uml.pdf' def begin(self): styleSheet = getSampleStyleSheet() self.h1 = styleSheet['Heading1'] self.h2 = styleSheet['Heading2'] self.h3 = styleSheet['Heading3'] self.code = styleSheet['Code'] s... | def beginFunction(self, name, doc, sig): bt = self.bt story = self.story story.append(Paragraph(name+sig, bt)) story.append(XPreformatted(doc, bt)) | 55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py | |
def documentModule0(path, builder=DocBuilder0()): | def documentModule0(path, builder=GraphPdfDocBuilder0()): | def documentModule0(path, builder=DocBuilder0()): """Generate documentation for one Python file in some format. This handles Python standard modules like string, custom modules on the Python search path like e.g. docpy as well as modules specified with their full path like C:/tmp/junk.py. The doc file will always be ... | 55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py |
"""A callback function used when waking over a package tree.""" | "A callback function used when waking over a package tree." | def _packageWalkCallback(builder, dirPath, files): """A callback function used when waking over a package tree.""" files = filter(lambda f:f != '__init__.py', files) files = filter(lambda f:f[-3:] == '.py', files) if files: for f in files: path = os.path.join(dirPath, f) print path builder.indentLevel = builder.indent... | 55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py |
def documentPackage0(path, builder=DocBuilder0()): | def documentPackage0(pathOrName, builder=GraphPdfDocBuilder0()): | def documentPackage0(path, builder=DocBuilder0()): """Generate documentation for one Python package in some format. Rigiht now, 'path' must be a filesystem path, later it will also be a package name whose path will be resolved by importing the top-level module. The doc file will always be saved in the current directo... | 55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py |
name = path if string.find(path, os.sep) > -1: name = os.path.splitext(os.path.basename(path))[0] | if string.find(pathOrName, os.sep) > -1: name = os.path.splitext(os.path.basename(pathOrName))[0] path = pathOrName | def documentPackage0(path, builder=DocBuilder0()): """Generate documentation for one Python package in some format. Rigiht now, 'path' must be a filesystem path, later it will also be a package name whose path will be resolved by importing the top-level module. The doc file will always be saved in the current directo... | 55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py |
package = __import__(name) name = path | package = __import__(pathOrName) if '.' in pathOrName: subname = 'package' + pathOrName[string.find(pathOrName, '.'):] package = eval(subname) name = pathOrName | def documentPackage0(path, builder=DocBuilder0()): """Generate documentation for one Python package in some format. Rigiht now, 'path' must be a filesystem path, later it will also be a package name whose path will be resolved by importing the top-level module. The doc file will always be saved in the current directo... | 55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py |
def documentPackage0(path, builder=DocBuilder0()): """Generate documentation for one Python package in some format. Rigiht now, 'path' must be a filesystem path, later it will also be a package name whose path will be resolved by importing the top-level module. The doc file will always be saved in the current directo... | 55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py | ||
"""Handle command-line options and trigger corresponding action. """ | "Handle command-line options and trigger corresponding action." | def main(): """Handle command-line options and trigger corresponding action. """ opts, args = getopt.getopt(sys.argv[1:], 'hf:m:p:') # On -h print usage and exit immediately. for o, a in opts: if o == '-h': print printUsage.__doc__ #printUsage() sys.exit(0) # On -f set the DocBuilder to use or a default one. builder... | 55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py |
def main(): """Handle command-line options and trigger corresponding action. """ opts, args = getopt.getopt(sys.argv[1:], 'hf:m:p:') # On -h print usage and exit immediately. for o, a in opts: if o == '-h': print printUsage.__doc__ #printUsage() sys.exit(0) # On -f set the DocBuilder to use or a default one. builder... | 55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py | ||
builder = DocBuilder0() | builder = GraphPdfDocBuilder0() | def main(): """Handle command-line options and trigger corresponding action. """ opts, args = getopt.getopt(sys.argv[1:], 'hf:m:p:') # On -h print usage and exit immediately. for o, a in opts: if o == '-h': print printUsage.__doc__ #printUsage() sys.exit(0) # On -f set the DocBuilder to use or a default one. builder... | 55005c7079d87799b39b50803338d97c2a77c532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/55005c7079d87799b39b50803338d97c2a77c532/graphicsdoc0.py |
'''This gets called by the template framework | """This gets called by the template framework | def checkPageSize(self,canv,doc): '''This gets called by the template framework If canv size != template size then the canv size is set to the template size or if that's not available to the doc size. ''' #### NEVER EVER EVER COMPARE FLOATS FOR EQUALITY #RGB converting pagesizes to ints means we are accurate to one poi... | 0c157aa95971569a44e319bd4679ef9038dd94f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0c157aa95971569a44e319bd4679ef9038dd94f3/doctemplate.py |
''' | """ | def checkPageSize(self,canv,doc): '''This gets called by the template framework If canv size != template size then the canv size is set to the template size or if that's not available to the doc size. ''' #### NEVER EVER EVER COMPARE FLOATS FOR EQUALITY #RGB converting pagesizes to ints means we are accurate to one poi... | 0c157aa95971569a44e319bd4679ef9038dd94f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0c157aa95971569a44e319bd4679ef9038dd94f3/doctemplate.py |
'''Perform actions required at beginning of page. shouldn't normally be called directly''' | """Perform actions required at beginning of page. shouldn't normally be called directly""" | def handle_pageBegin(self): '''Perform actions required at beginning of page. shouldn't normally be called directly''' self.page += 1 if self._debug: logger.debug("beginning page %d" % self.page) self.pageTemplate.beforeDrawPage(self.canv,self) self.pageTemplate.checkPageSize(self.canv,self) self.pageTemplate.onPage(se... | 0c157aa95971569a44e319bd4679ef9038dd94f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0c157aa95971569a44e319bd4679ef9038dd94f3/doctemplate.py |
""""Forward to any listeners""" | """Forward to any listeners""" | def notify(self, kind, stuff): """"Forward to any listeners""" for l in self._indexingFlowables: l.notify(kind, stuff) | 0c157aa95971569a44e319bd4679ef9038dd94f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0c157aa95971569a44e319bd4679ef9038dd94f3/doctemplate.py |
fn = pjoin(dir,'_rl_accel') return getVersionFromCCode(fn),os.stat(fn)[stat.ST_MTIME] | fn = pjoin(dir,'_rl_accel.c') try: return getVersionFromCCode(fn),os.stat(fn)[stat.ST_MTIME] except: return None | def _rl_accel_dir_info(dir): import stat fn = pjoin(dir,'_rl_accel') return getVersionFromCCode(fn),os.stat(fn)[stat.ST_MTIME] | 9579cfb78ea9f99f07b06674917bf59a39b28d5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9579cfb78ea9f99f07b06674917bf59a39b28d5b/setup.py |
if len(_)>1: _.sort(_cmp_rl_accel_dirs) return abspath(_[0]) | _ = filter(_rl_accel_dir_info,_) if len(_): _.sort(_cmp_rl_accel_dirs) return abspath(_[0]) | def _find_rl_accel(): '''locate where the accelerator code lives''' _ = [] for x in [ './rl_addons/rl_accel', '../rl_addons/rl_accel', '../../rl_addons/rl_accel', './rl_accel', '../rl_accel', '../../rl_accel', './lib'] \ + glob.glob('./rl_accel-*/rl_accel')\ + glob.glob('../rl_accel-*/rl_accel') \ + glob.glob('../../rl... | 9579cfb78ea9f99f07b06674917bf59a39b28d5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9579cfb78ea9f99f07b06674917bf59a39b28d5b/setup.py |
RL_ACCEL = _find_rl_accel() LIBS = [] DATA_FILES = {} if not RL_ACCEL: EXT_MODULES = [] print '***************************************************' print '*No rl_accel code found, you can obtain it at *' print '*http://www.reportlab.org/downloads.html print '***************************************************' | _yesV=('yes','y','1','true') _yesnoV=_yesV+('no','n','0','false') tra=[_ for _ in sys.argv if _.lower().startswith('--rl_accel=')] if not tra: tra = True | def run(): RL_ACCEL = _find_rl_accel() LIBS = [] DATA_FILES = {} if not RL_ACCEL: EXT_MODULES = [] print '***************************************************' print '*No rl_accel code found, you can obtain it at *' print '*http://www.reportlab.org/downloads.html#_rl_accel*' print '**********************************... | 9579cfb78ea9f99f07b06674917bf59a39b28d5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9579cfb78ea9f99f07b06674917bf59a39b28d5b/setup.py |
fn = pjoin(RL_ACCEL,'lib','hyphen.mashed') if isfile(fn): DATA_FILES[pjoin(package_path, 'lib')] = [fn] EXT_MODULES = [ Extension( '_rl_accel', [pjoin(RL_ACCEL,'_rl_accel.c')], | map(sys.argv.remove,tra) tra=tra[-1].split('=',1)[1].lower() assert tra in _yesnoV, 'bad argument --rl_accel='+tra tra = tra in _yesV if tra: RL_ACCEL = _find_rl_accel() LIBS = [] DATA_FILES = {} if not RL_ACCEL: EXT_MODULES = [] print '***************************************************' print '*No rl_accel code foun... | def run(): RL_ACCEL = _find_rl_accel() LIBS = [] DATA_FILES = {} if not RL_ACCEL: EXT_MODULES = [] print '***************************************************' print '*No rl_accel code found, you can obtain it at *' print '*http://www.reportlab.org/downloads.html#_rl_accel*' print '**********************************... | 9579cfb78ea9f99f07b06674917bf59a39b28d5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9579cfb78ea9f99f07b06674917bf59a39b28d5b/setup.py |
define_macros=[], library_dirs=[], libraries=LIBS, ), Extension( 'sgmlop', [pjoin(RL_ACCEL,'sgmlop.c')], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, ), Extension( 'pyHnj', [pjoin(RL_ACCEL,'pyHnjmodule.c'), pjoin(RL_ACCEL,'hyphen.c'), pjoin(RL_ACCEL,'hnjalloc.c')], include_dirs=[], define_macros=... | define_macros=[], library_dirs=[], libraries=LIBS, ), Extension( 'pyHnj', [pjoin(RL_ACCEL,'pyHnjmodule.c'), pjoin(RL_ACCEL,'hyphen.c'), pjoin(RL_ACCEL,'hnjalloc.c')], include_dirs=[], define_macros=[], library_dirs=[], libraries=LIBS, ), ] | def run(): RL_ACCEL = _find_rl_accel() LIBS = [] DATA_FILES = {} if not RL_ACCEL: EXT_MODULES = [] print '***************************************************' print '*No rl_accel code found, you can obtain it at *' print '*http://www.reportlab.org/downloads.html#_rl_accel*' print '**********************************... | 9579cfb78ea9f99f07b06674917bf59a39b28d5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9579cfb78ea9f99f07b06674917bf59a39b28d5b/setup.py |
if self._atTop: s = flowable.getSpaceBefore() | if not self._atTop: s = flowable.getSpaceBefore() | def _add(self, flowable, canv, trySplit=0): """ Draws the flowable at the current position. Returns 1 if successful, 0 if it would not fit. Raises a LayoutError if the object is too wide, or if it is too high for a totally empty frame, to avoid infinite loops""" y = self._y p = self._y1p s = 0 if self._atTop: s = flowa... | 2ed1c3bb46755c4ddda589067b71fe4e3f26ee06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2ed1c3bb46755c4ddda589067b71fe4e3f26ee06/frames.py |
c.bookmarkHorizontalAbsolute0(nameTag, pos) | c.bookmarkHorizontalAbsolute(nameTag, pos) | def addIdent(self, t): "Add an identifier." o = self.options # Make base font bold. fam, b, i = fonts.ps2tt(o.fontName) ps = fonts.tt2ps(fam, 1, i) font = (ps, o.fontSize) self.setFillColorAndFont(o.identCol, font) self.putText(t) # Bookmark certain identifiers (class and function names). if not o.noOutline and not... | 3af4ab144ce71602a6afba90cd8a295b9caad23b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3af4ab144ce71602a6afba90cd8a295b9caad23b/py2pdf.py |
raise "LayoutError", "Flowable (%sx%s points) too wide for frame (%sx* points)." % (dW,t,w) | raise "LayoutError", "Flowable (%sx%s points) too wide for cell (%sx* points)." % (dW,t,w) | def _calc(self): if hasattr(self,'_width'): return | cf311d761493b28d21997385815cf4c3b1178a65 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/cf311d761493b28d21997385815cf4c3b1178a65/tables.py |
self._canvas.ellipse(x1,y1,x2,y2,fill=1) | self._canvas.ellipse(x1,y1,x2,y2,fill=self._fill,stroke=self._stroke) | def drawEllipse(self, ellipse): #need to convert to pdfgen's bounding box representation x1 = ellipse.cx - ellipse.rx x2 = ellipse.cx + ellipse.rx y1 = ellipse.cy - ellipse.ry y2 = ellipse.cy + ellipse.ry self._canvas.ellipse(x1,y1,x2,y2,fill=1) | d1883bba63b6b6ed86e1fc66a30ac245bd7996a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d1883bba63b6b6ed86e1fc66a30ac245bd7996a2/renderPDF.py |
def __init__(self, name): self.name = name self.graphics = [] | c07fba1c56a17158d166b9143efa2d996a00f7fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c07fba1c56a17158d166b9143efa2d996a00f7fc/pythonpoint.py | ||
def drawOn(self, canv): for graphic in self.graphics: | c07fba1c56a17158d166b9143efa2d996a00f7fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c07fba1c56a17158d166b9143efa2d996a00f7fc/pythonpoint.py | ||
internalname = canv._doc.hasForm(name) canv.saveState() | if definedForms.has_key(name): internalname = 1 else: internalname = None definedForms[name] = 1 | def drawOn(self, canv): for graphic in self.graphics: | c07fba1c56a17158d166b9143efa2d996a00f7fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c07fba1c56a17158d166b9143efa2d996a00f7fc/pythonpoint.py |
canv.restoreState() | def drawOn(self, canv): for graphic in self.graphics: | c07fba1c56a17158d166b9143efa2d996a00f7fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c07fba1c56a17158d166b9143efa2d996a00f7fc/pythonpoint.py | |
if self._text == None: self._text = '' | _text = self._text self._text = _text or '' | def draw(self): if self._text == None: self._text = '' # hack, but it works for now... self.computeSize() g = Group() g.translate(self.x + self.dx, self.y + self.dy) g.rotate(self.angle) | 5a50494ad1a723e2888ffb1317c78627ddb4d483 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/5a50494ad1a723e2888ffb1317c78627ddb4d483/textlabels.py |
width x2,y2 +---------------------------------+ | l top padding r | h | e +-------------------------+ i | e | f | | g | i | t | | h | g | | | t | h | p | | | t | a | ... | width x2,y2 +---------------------------------+ | l top padding r | h | e +-------------------------+ i | e | f | | g | i | t | | h | g | | | t | h | p | | | t | a | ... | def draw(self): exec self.command in globals(), {'canvas':self.canv} | 517f0efaa04d678987da40d393b36356a93f71d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/517f0efaa04d678987da40d393b36356a93f71d0/layout.py |
def _add(self, flowable, canv, trySplit=0): """ Draws the flowable at the current position. Returns 1 if successful, 0 if it would not fit. Raises a LayoutError if the object is too wide, or if it is too high for a totally empty frame, to avoid infinite loops""" y = self.y p = self.y1 + self.bottomPadding w, h = flowab... | 517f0efaa04d678987da40d393b36356a93f71d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/517f0efaa04d678987da40d393b36356a93f71d0/layout.py | ||
def _add(self, flowable, canv, trySplit=0): """ Draws the flowable at the current position. Returns 1 if successful, 0 if it would not fit. Raises a LayoutError if the object is too wide, or if it is too high for a totally empty frame, to avoid infinite loops""" y = self.y p = self.y1 + self.bottomPadding w, h = flowab... | 517f0efaa04d678987da40d393b36356a93f71d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/517f0efaa04d678987da40d393b36356a93f71d0/layout.py | ||
def _doNothing(flowables, doc): "Dummy callback for onFirstPage and onNewPage" | def _doNothing(canvas, doc): "Dummy callback for onPage" | def _doNothing(flowables, doc): "Dummy callback for onFirstPage and onNewPage" pass | 517f0efaa04d678987da40d393b36356a93f71d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/517f0efaa04d678987da40d393b36356a93f71d0/layout.py |
def run(): objects_to_draw = [] from reportlab.lib.styles import ParagraphStyle from reportlab.platypus.paragraph import Paragraph #need a style normal = ParagraphStyle('normal') normal.firstLineIndent = 18 normal.spaceBefore = 6 import random for i in range(15): height = 0.5 + (2*random.random()) box = XBox(6 * inch,... | 517f0efaa04d678987da40d393b36356a93f71d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/517f0efaa04d678987da40d393b36356a93f71d0/layout.py | ||
def run(): objects_to_draw = [] from reportlab.lib.styles import ParagraphStyle from reportlab.platypus.paragraph import Paragraph #need a style normal = ParagraphStyle('normal') normal.firstLineIndent = 18 normal.spaceBefore = 6 import random for i in range(15): height = 0.5 + (2*random.random()) box = XBox(6 * inch,... | 517f0efaa04d678987da40d393b36356a93f71d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/517f0efaa04d678987da40d393b36356a93f71d0/layout.py | ||
self.canv.drawCentredString( | try: self.canv.drawCentredString( | def drawChars(self, charList): """Fills boxes in order. None means skip a box. Empty boxes at end get filled with gray""" extraNeeded = (self.rows * self.charsPerRow - len(charList)) for i in range(extraNeeded): charList.append(None) #charList.extend([None] * extraNeeded) row = 0 col = 0 self.canv.setFont(self.fontNam... | bbc5f626c757f0a667deb3cef8cebff1eb50eefa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bbc5f626c757f0a667deb3cef8cebff1eb50eefa/codecharts.py |
ch | ch, | def drawChars(self, charList): """Fills boxes in order. None means skip a box. Empty boxes at end get filled with gray""" extraNeeded = (self.rows * self.charsPerRow - len(charList)) for i in range(extraNeeded): charList.append(None) #charList.extend([None] * extraNeeded) row = 0 col = 0 self.canv.setFont(self.fontNam... | bbc5f626c757f0a667deb3cef8cebff1eb50eefa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bbc5f626c757f0a667deb3cef8cebff1eb50eefa/codecharts.py |
return makeSuiteForClasses(RlAccelTestCase) except ImportError: return None | Klass = RlAccelTestCase except: class Klass(unittest.TestCase): pass return makeSuiteForClasses(Klass) | def makeSuite(): # only run the tests if _rl_accel is present try: import _rl_accel return makeSuiteForClasses(RlAccelTestCase) except ImportError: return None | 75397dff48c9354f932b9fa26f36d352dd447296 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/75397dff48c9354f932b9fa26f36d352dd447296/test_rl_accel.py |
unittest.TextTestRunner().run(makeSuite()) | unittest.TextTestRunner().run(makeSuite()) | def makeSuite(): # only run the tests if _rl_accel is present try: import _rl_accel return makeSuiteForClasses(RlAccelTestCase) except ImportError: return None | 75397dff48c9354f932b9fa26f36d352dd447296 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/75397dff48c9354f932b9fa26f36d352dd447296/test_rl_accel.py |
def drawInlineImage(self, canvas): #, image, x,y, width=None,height=None): """Draw an Image into the specified rectangle. If width and height are omitted, they are calculated from the image size. Also allow file names as well as images. This allows a caching mechanism""" | 5fb9251a48f66d5629241f88f93f958a3406d66c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/5fb9251a48f66d5629241f88f93f958a3406d66c/pdfimages.py | ||
def drawInlineImage(self, canvas): #, image, x,y, width=None,height=None): """Draw an Image into the specified rectangle. If width and height are omitted, they are calculated from the image size. Also allow file names as well as images. This allows a caching mechanism""" | 5fb9251a48f66d5629241f88f93f958a3406d66c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/5fb9251a48f66d5629241f88f93f958a3406d66c/pdfimages.py | ||
radius = self._radius = self._cx-self.x self._radiusx = radiusx = radius self._radiusy = radiusy = (1.0 - self.perspective/100.0)*radius | radiusx = radiusy = self._cx-self.x if self.xradius: radiusx = self.xradius if self.yradius: radiusy = self.yradius self._radiusx = radiusx self._radiusy = (1.0 - self.perspective/100.0)*radiusy | def draw(self): slices = self.slices _3d_angle = self.angle_3d _3dva = self._3dva = _360(_3d_angle+90) a0 = _2rad(_3dva) self._xdepth_3d = cos(a0)*self.depth_3d self._ydepth_3d = sin(a0)*self.depth_3d self._cx = self.x+self.width/2.0 self._cy = self.y+(self.height - self._ydepth_3d)/2.0 radius = self._radius = self._cx... | 937d4a06deb5cce7c0c95e40de74ecdfdab0a6d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/937d4a06deb5cce7c0c95e40de74ecdfdab0a6d2/piecharts.py |
print "Can't find cvs anywhere on the path" | def cvs_checkout(d): os.chdir(d) recursive_rmdir(cvsdir) cvs = find_exe('cvs') if cvs is None: print "Can't find cvs anywhere on the path" os.exit(1) if release: os.environ['CVSROOT']=':pserver:%s@cvs:/cvsroot/reportlab' % USER do_exec(cvs+(' co -r %s reportlab'%release), 'the download phase') else: os.environ['CVSRO... | 9428867e35d04f48f018e2559da3c19fbeb25b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9428867e35d04f48f018e2559da3c19fbeb25b24/daily.py | |
os.environ['CVSROOT']=':pserver:%s@cvs:/cvsroot/reportlab' % USER do_exec(cvs+(' co -r %s reportlab'%release), 'the download phase') | do_exec(cvs+(' export -r %s reportlab'%release), 'the export phase') | def cvs_checkout(d): os.chdir(d) recursive_rmdir(cvsdir) cvs = find_exe('cvs') if cvs is None: print "Can't find cvs anywhere on the path" os.exit(1) if release: os.environ['CVSROOT']=':pserver:%s@cvs:/cvsroot/reportlab' % USER do_exec(cvs+(' co -r %s reportlab'%release), 'the download phase') else: os.environ['CVSRO... | 9428867e35d04f48f018e2559da3c19fbeb25b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9428867e35d04f48f018e2559da3c19fbeb25b24/daily.py |
os.environ['CVSROOT']=':pserver:%s@cvs:/cvsroot/reportlab' % USER do_exec(cvs+' co reportlab', 'the download phase') | do_exec(cvs+' co reportlab', 'the checkout phase') | def cvs_checkout(d): os.chdir(d) recursive_rmdir(cvsdir) cvs = find_exe('cvs') if cvs is None: print "Can't find cvs anywhere on the path" os.exit(1) if release: os.environ['CVSROOT']=':pserver:%s@cvs:/cvsroot/reportlab' % USER do_exec(cvs+(' co -r %s reportlab'%release), 'the download phase') else: os.environ['CVSRO... | 9428867e35d04f48f018e2559da3c19fbeb25b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9428867e35d04f48f018e2559da3c19fbeb25b24/daily.py |
def find_src_files(L,d,N): if string.upper(os.path.basename(d))=='CVS': return for n in N: fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn) | def find_src_files(L,d,N): if string.upper(os.path.basename(d))=='CVS': return #ignore all CVS for n in N: fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn) | 9428867e35d04f48f018e2559da3c19fbeb25b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9428867e35d04f48f018e2559da3c19fbeb25b24/daily.py | |
src_files = [] os.path.walk(projdir,find_src_files,src_files) | def find_src_files(L,d,N): if string.upper(os.path.basename(d))=='CVS': return #ignore all CVS for n in N: fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn) | 9428867e35d04f48f018e2559da3c19fbeb25b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9428867e35d04f48f018e2559da3c19fbeb25b24/daily.py | |
b = "%s" % release | b = release | def find_src_files(L,d,N): if string.upper(os.path.basename(d))=='CVS': return #ignore all CVS for n in N: fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn) | 9428867e35d04f48f018e2559da3c19fbeb25b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9428867e35d04f48f018e2559da3c19fbeb25b24/daily.py |
safe_remove(zipfile) safe_remove(tarfile) if src_files==[]: return src_files = string.join(src_files) | def find_src_files(L,d,N): if string.upper(os.path.basename(d))=='CVS': return #ignore all CVS for n in N: fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn) | 9428867e35d04f48f018e2559da3c19fbeb25b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9428867e35d04f48f018e2559da3c19fbeb25b24/daily.py | |
do_exec('%s czvf %s %s' % (tar, tarfile, src_files), 'tar creation') | if tar is not None: safe_remove(tarfile) do_exec('%s czvf %s %s' % (tar, tarfile, projdir), 'tar creation') | def find_src_files(L,d,N): if string.upper(os.path.basename(d))=='CVS': return #ignore all CVS for n in N: fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn) | 9428867e35d04f48f018e2559da3c19fbeb25b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9428867e35d04f48f018e2559da3c19fbeb25b24/daily.py |
do_exec('%s -u %s %s' % (zip, zipfile, src_files), 'zip creation') | if zip is not None: safe_remove(zipfile) do_exec('%s -ur %s %s' % (zip, zipfile, projdir), 'zip creation') | def find_src_files(L,d,N): if string.upper(os.path.basename(d))=='CVS': return #ignore all CVS for n in N: fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn) | 9428867e35d04f48f018e2559da3c19fbeb25b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9428867e35d04f48f018e2559da3c19fbeb25b24/daily.py |
data = self.data m, M = None, None for row in data: for val in row: if val is None: val = 0 if val is None: val = 0 if val < m: m = val if val > M: M = val return m, M | data = map(lambda x: map(lambda x: x is not None and x or 0,x), self.data) return min(min(data)), max(max(data)) | def _findMinMaxValues(self): "Find the minimum and maximum value of the data we have." | e29c3561dda6dff8e19c7869849618abce1bc863 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/e29c3561dda6dff8e19c7869849618abce1bc863/barcharts.py |
scale = self.valueAxis.scale vm, vM = self.valueAxis.valueMin, self.valueAxis.valueMax if None in (vm, vM): y = scale(self._findMinMaxValues()[0]) elif vm <= 0 <= vM: y = scale(0) elif 0 < vm: y = scale(vm) elif vM < 0: y = scale(vM) | def calcBarPositions(self): """Works out where they go. default vertical. | e29c3561dda6dff8e19c7869849618abce1bc863 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/e29c3561dda6dff8e19c7869849618abce1bc863/barcharts.py | |
return string.join(map(lambda x : "%0x" % ord(x), md5.md5(s).digest()), '') | return string.join(map(lambda x : "%02x" % ord(x), md5.md5(s).digest()), '') | def _digester(s): return string.join(map(lambda x : "%0x" % ord(x), md5.md5(s).digest()), '') | 33e5ec853fa7a38db78eff1f31319546b9516c37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/33e5ec853fa7a38db78eff1f31319546b9516c37/canvas.py |
if d not in sys.path: sys.path.insert(0,d) | def find_test_files(L,d,N): n = os.path.basename(d) if n!='test' : return for n in filter(lambda n: n[-3:]=='.py',N): fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn) | d144de574b55b6230e50ff50376a0264613d6725 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d144de574b55b6230e50ff50376a0264613d6725/runtests.py | |
os.chdir(os.path.dirname(fn)) | def find_test_files(L,d,N): n = os.path.basename(d) if n!='test' : return for n in filter(lambda n: n[-3:]=='.py',N): fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn) | d144de574b55b6230e50ff50376a0264613d6725 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d144de574b55b6230e50ff50376a0264613d6725/runtests.py | |
z.run(execfile,(fn,_globals.copy())) | z.run(execfile,(fn,g)) | def find_test_files(L,d,N): n = os.path.basename(d) if n!='test' : return for n in filter(lambda n: n[-3:]=='.py',N): fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn) | d144de574b55b6230e50ff50376a0264613d6725 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d144de574b55b6230e50ff50376a0264613d6725/runtests.py |
execfile(fn,_globals.copy()) | execfile(fn,g) | def find_test_files(L,d,N): n = os.path.basename(d) if n!='test' : return for n in filter(lambda n: n[-3:]=='.py',N): fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn) | d144de574b55b6230e50ff50376a0264613d6725 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d144de574b55b6230e50ff50376a0264613d6725/runtests.py |
self._strokeColorRGB = rgb | self._fillColorRGB = rgb | def setFillColor(self, aColor): """Takes a color object, allowing colors to be referred to by name""" if type(aColor) == ColorType: rgb = (aColor.red, aColor.green, aColor.blue) self._strokeColorRGB = rgb self._code.append('%0.2f %0.2f %0.2f rg' % rgb ) elif type(aColor) in _SeqTypes: l = len(aColor) if l==3: self._str... | 52621e679eaa5f8b99038efba297b834175fbeba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/52621e679eaa5f8b99038efba297b834175fbeba/canvas.py |
self._strokeColorRGB = aColor | self._fillColorRGB = aColor | def setFillColor(self, aColor): """Takes a color object, allowing colors to be referred to by name""" if type(aColor) == ColorType: rgb = (aColor.red, aColor.green, aColor.blue) self._strokeColorRGB = rgb self._code.append('%0.2f %0.2f %0.2f rg' % rgb ) elif type(aColor) in _SeqTypes: l = len(aColor) if l==3: self._str... | 52621e679eaa5f8b99038efba297b834175fbeba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/52621e679eaa5f8b99038efba297b834175fbeba/canvas.py |
R = String(upperleftx, upperlefty, text) R.textAnchor = anchor if self.color is not None: R.fillColor = self.color elif self.defaultColor is not None: R.fillColor = self.defaultColor if self.size is not None: R.fontSize = self.size if self.font is not None: R.fontName = self.font return [R] | textlist = string.split(text, "\n") result = [] for text1 in textlist: R = String(upperleftx, upperlefty, text1) upperlefty = upperlefty-self.size*1.1 R.textAnchor = anchor if self.color is not None: R.fillColor = self.color elif self.defaultColor is not None: R.fillColor = self.defaultColor if self.size is not None: R... | def materialize(self, text, length, xyorigin=(0,0), lengthoffset=0, widthoffset=0): "generate a drawables based on this template, with help of 'derived' parameters" # for purposes of generality return a *sequence* of drawables (x,y) = xyorigin orientation = self.orientation # semantics is flipped compared to bar groups... | 6d786e5e13d81898d3ab5797265018f2e864ef07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d786e5e13d81898d3ab5797265018f2e864ef07/barchart.py |
print "factor is", factor | def draw(self): orientation = self.orientation # this could be done cleverly using the other widgets, but what the .... x,y = self.x, self.y fmt = self.labelFormat (delta, startpoint) = scaleParameters(self.minimum, self.maximum, self.nLabels) G = Group() # orientation independent data (direct values for vertical case,... | 6d786e5e13d81898d3ab5797265018f2e864ef07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d786e5e13d81898d3ab5797265018f2e864ef07/barchart.py | |
print "lineposition, clineposition", lineposition, clineposition | def draw(self): orientation = self.orientation # this could be done cleverly using the other widgets, but what the .... x,y = self.x, self.y fmt = self.labelFormat (delta, startpoint) = scaleParameters(self.minimum, self.maximum, self.nLabels) G = Group() # orientation independent data (direct values for vertical case,... | 6d786e5e13d81898d3ab5797265018f2e864ef07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d786e5e13d81898d3ab5797265018f2e864ef07/barchart.py | |
print "done with lines" | def draw(self): orientation = self.orientation # this could be done cleverly using the other widgets, but what the .... x,y = self.x, self.y fmt = self.labelFormat (delta, startpoint) = scaleParameters(self.minimum, self.maximum, self.nLabels) G = Group() # orientation independent data (direct values for vertical case,... | 6d786e5e13d81898d3ab5797265018f2e864ef07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d786e5e13d81898d3ab5797265018f2e864ef07/barchart.py | |
def draw(self): self.valueAxis.configure(self.data) self.valueAxis.setPosition(self.x, self.y, self.height) xAxisCrossesAt = self.valueAxis.scale(0) if ((xAxisCrossesAt > self.y + self.height) or (xAxisCrossesAt < self.y)): self.categoryAxis.setPosition(self.x, self.y, self.width) else: self.categoryAxis.setPosition... | def makeBackground(self): | def draw(self): self.valueAxis.configure(self.data) self.valueAxis.setPosition(self.x, self.y, self.height) | 0df415dcb939a2513a321f75fdf136d8d6dd4fac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0df415dcb939a2513a321f75fdf136d8d6dd4fac/barcharts.py |
def draw(self): self.valueAxis.configure(self.data) self.valueAxis.setPosition(self.x, self.y, self.height) | 0df415dcb939a2513a321f75fdf136d8d6dd4fac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0df415dcb939a2513a321f75fdf136d8d6dd4fac/barcharts.py | ||
g.add(self.categoryAxis) g.add(self.valueAxis) | return g def makeBars(self): g = Group() | def draw(self): self.valueAxis.configure(self.data) self.valueAxis.setPosition(self.x, self.y, self.height) | 0df415dcb939a2513a321f75fdf136d8d6dd4fac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0df415dcb939a2513a321f75fdf136d8d6dd4fac/barcharts.py |
def draw(self): self.valueAxis.configure(self.data) self.valueAxis.setPosition(self.x, self.y, self.width) yAxisCrossesAt = self.valueAxis.scale(0) if ((yAxisCrossesAt > self.x + self.width) or (yAxisCrossesAt < self.x)): self.categoryAxis.setPosition(self.x, self.y, self.height) else: self.categoryAxis.setPosition(... | def makeBackground(self): | def draw(self): self.valueAxis.configure(self.data) self.valueAxis.setPosition(self.x, self.y, self.width) | 0df415dcb939a2513a321f75fdf136d8d6dd4fac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0df415dcb939a2513a321f75fdf136d8d6dd4fac/barcharts.py |
def draw(self): self.valueAxis.configure(self.data) self.valueAxis.setPosition(self.x, self.y, self.width) | 0df415dcb939a2513a321f75fdf136d8d6dd4fac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0df415dcb939a2513a321f75fdf136d8d6dd4fac/barcharts.py | ||
g.add(self.categoryAxis) g.add(self.valueAxis) | return g def makeBars(self): g = Group() | def draw(self): self.valueAxis.configure(self.data) self.valueAxis.setPosition(self.x, self.y, self.width) | 0df415dcb939a2513a321f75fdf136d8d6dd4fac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0df415dcb939a2513a321f75fdf136d8d6dd4fac/barcharts.py |
rectList2 = [] for elem in rectList: if elem == (0,0,0,0): print 'got an empty one' if elem is not None: rectList2.append(elem) xMin, yMin, xMax, yMax = rectList2[0] for (x1, y1, x2, y2) in rectList2[1:]: | L = filter(lambda x: x is not None, rectList) if not L: return None xMin, yMin, xMax, yMax = L[0] for (x1, y1, x2, y2) in L[1:]: | def getRectsBounds(rectList): # filter out any None objects, e.g. empty groups rectList2 = [] for elem in rectList: if elem == (0,0,0,0): print 'got an empty one' if elem is not None: rectList2.append(elem) xMin, yMin, xMax, yMax = rectList2[0] for (x1, y1, x2, y2) in rectList2[1:]: if x1 < xMin: xMin = x1 if x2 > xMa... | c829389599340aff92b329d736591e51c4a24a3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c829389599340aff92b329d736591e51c4a24a3c/shapes.py |
(x1, y1, x2, y2) = getRectsBounds(b) | x1 = getRectsBounds(b) if x1 is None: return None x1, y1, x2, y2 = x1 | def getBounds(self): if self.contents: b = [] for elem in self.contents: b.append(elem.getBounds()) (x1, y1, x2, y2) = getRectsBounds(b) trans = self.transform corners = [[x1,y1], [x1, y2], [x2, y1], [x2,y2]] newCorners = [] for corner in corners: newCorners.append(transformPoint(trans, corner)) return getPointsBounds(... | c829389599340aff92b329d736591e51c4a24a3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c829389599340aff92b329d736591e51c4a24a3c/shapes.py |
WedgeLabel3d._ydepth_3d = self._ydepth_3d | checkLabelOverlap = self.checkLabelOverlap | def _checkDXY(self,ba): if ba[0]=='n': if not hasattr(self,'_ody'): self._ody = self.dy self.dy = -self._ody + self._ydepth_3d | e79e0fad447462dc2f6790928f2cd07e6271fdb5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/e79e0fad447462dc2f6790928f2cd07e6271fdb5/piecharts.py |
_addWedgeLabel(self,text,L.append,mid,OX(i,mid,0),OY(i,mid,0),style,labelClass=WedgeLabel3d) | labelX = OX(i,mid,0) labelY = OY(i,mid,0) _addWedgeLabel(self,text,L.append,mid,labelX,labelY,style,labelClass=WedgeLabel3d) if checkLabelOverlap: l = L[-1] l._origdata = { 'x': labelX, 'y':labelY, 'angle': mid, 'rx': self._radiusx, 'ry':self._radiusy, 'cx':CX(i,0), 'cy':CY(i,0), 'bounds': l.getBounds(), } | def _checkDXY(self,ba): if ba[0]=='n': if not hasattr(self,'_ody'): self._ody = self.dy self.dy = -self._ody + self._ydepth_3d | e79e0fad447462dc2f6790928f2cd07e6271fdb5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/e79e0fad447462dc2f6790928f2cd07e6271fdb5/piecharts.py |
rlDir = os.path.dirname(reportlab.__file__) ppDir = os.path.join(rlDir, 'tools','pythonpoint') m1 = recursiveImport('stdparser', baseDir=ppDir) | D = os.path.join(os.path.dirname(reportlab.__file__), 'tools','pythonpoint') fn = os.path.join(D,'stdparser.py') if os.path.isfile(fn) or os.path.isfile(fn+'c') or os.path.isfile(fn+'o'): m1 = recursiveImport('stdparser', baseDir=D) | def test2(self): "try under a directory NOT on the path" rlDir = os.path.dirname(reportlab.__file__) ppDir = os.path.join(rlDir, 'tools','pythonpoint') m1 = recursiveImport('stdparser', baseDir=ppDir) | 153abc6259a5e5a886dbe294edae46c25b20613b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/153abc6259a5e5a886dbe294edae46c25b20613b/test_lib_utils.py |
unittest.TextTestRunner().run(makeSuite()) | unittest.TextTestRunner().run(makeSuite()) | def makeSuite(): return makeSuiteForClasses(ImporterTestCase) | 153abc6259a5e5a886dbe294edae46c25b20613b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/153abc6259a5e5a886dbe294edae46c25b20613b/test_lib_utils.py |
def open_for_read(name,mode='b'): | def open_for_read_by_name(name,mode='b'): if 'r' not in mode: mode = 'r'+mode try: return open(name,mode) except IOError: t, v = sys.exc_info()[:2] if _isFSD or __loader__ is None: raise try: name = _startswith_rl(name) s = __loader__.get_data(name) if 'b' not in mode and os.linesep!='\n': s = s.replace(os.linesep,'\... | def open_for_read(name,mode='b'): '''attempt to open a file or URL for reading''' if hasattr(name,'read'): return name import urllib try: t, o = urllib.splittype(name) if not t or t=='file': raise ValueError o = urllib.urlopen(name) return getStringIO(o.read()) except: if 'r' not in mode: mode = 'r'+mode try: return op... | cb904483bf49f44a457d420ce323d92f82163683 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/cb904483bf49f44a457d420ce323d92f82163683/utils.py |
import urllib try: t, o = urllib.splittype(name) if not t or t=='file': raise ValueError o = urllib.urlopen(name) return getStringIO(o.read()) | try: P = urlparse(name) if not P[0] or P[0]=='file': raise ValueError return getStringIO(urlopen(name).read()) | def open_for_read(name,mode='b'): '''attempt to open a file or URL for reading''' if hasattr(name,'read'): return name import urllib try: t, o = urllib.splittype(name) if not t or t=='file': raise ValueError o = urllib.urlopen(name) return getStringIO(o.read()) except: if 'r' not in mode: mode = 'r'+mode try: return op... | cb904483bf49f44a457d420ce323d92f82163683 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/cb904483bf49f44a457d420ce323d92f82163683/utils.py |
if 'r' not in mode: mode = 'r'+mode try: return open(name,mode) except IOError: t, v = sys.exc_info()[:2] if _isFSD or __loader__ is None: raise try: name = _startswith_rl(name) s = __loader__.get_data(name) if 'b' not in mode and os.linesep!='\n': s = s.replace(os.linesep,'\n') return getStringIO(s) except: raise t,... | return open_for_read_by_name(P[2],mode) del urllib, urlparse | def open_for_read(name,mode='b'): '''attempt to open a file or URL for reading''' if hasattr(name,'read'): return name import urllib try: t, o = urllib.splittype(name) if not t or t=='file': raise ValueError o = urllib.urlopen(name) return getStringIO(o.read()) except: if 'r' not in mode: mode = 'r'+mode try: return op... | cb904483bf49f44a457d420ce323d92f82163683 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/cb904483bf49f44a457d420ce323d92f82163683/utils.py |
s = sin(30*_toradians)*r | s = sin(c)*r | def _StarSix(self): r = float(self.size)/2 c = 30*_toradians s = sin(30*_toradians)*r c = cos(c)*r z = s/2 g = c/2 return self._doPolygon((0,r,-z,s,-c,s,-s,0,-c,-s,-z,-s,0,-r,z,-s,c,-s,s,0,c,s,z,s)) | 056c274f652ec39e3042a9cd21dffdbc067e5b9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/056c274f652ec39e3042a9cd21dffdbc067e5b9e/markers.py |
if self.angle: m.rotate(angle) | if self.angle: m.rotate(self.angle) | def draw(self): if self.kind: m = getattr(self,'_'+self.kind) if self.angle: _x, _dx, _y, _dy = self.x, self.dx, self.y, self.dy self.x, self.dx, self.y, self.dy = 0,0,0,0 try: m = m() finally: self.x, self.dx, self.y, self.dy = _x, _dx, _y, _dy if not isinstance(m,Group): _m, m = m, Group() m.add(_m) if self.angle: m.... | 056c274f652ec39e3042a9cd21dffdbc067e5b9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/056c274f652ec39e3042a9cd21dffdbc067e5b9e/markers.py |
D.save(fnRoot='Marker',formats=['pdf'], outDir='/tmp') | D.save(fnRoot='Marker',formats=['pdf'], outDir='/tmp') | def makeMarker(name,**kw): if Marker._attrMap['kind'].validate(name): m = apply(Marker,(),kw) m.kind = name elif name[-5:]=='_Flag' and Flag._attrMap['kind'].validate(name[:-5]): m = apply(Flag,(),kw) m.kind = name[:-5] m.size = 10 else: raise ValueError, "Invalid marker name %s" % name return m | 056c274f652ec39e3042a9cd21dffdbc067e5b9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/056c274f652ec39e3042a9cd21dffdbc067e5b9e/markers.py |
canvas.setFont('Times-Bold',16) canvas.drawString(108, layout.PAGE_HEIGHT-108, Title) canvas.setFont('Times-Roman',9) | def myFirstPage(canvas, doc): canvas.saveState() canvas.setFont('Times-Bold',16) canvas.drawString(108, layout.PAGE_HEIGHT-108, Title) canvas.setFont('Times-Roman',9) canvas.restoreState() | a4f41b2bc34b6dbf776d412796f45b7bd6a19152 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a4f41b2bc34b6dbf776d412796f45b7bd6a19152/fodyssey.py | |
ChapterStyle.fontsize = 14 | ChapterStyle.fontsize = 16 InitialStyle = copy.deepcopy(ChapterStyle) InitialStyle.fontsize = 16 PreStyle = styles["Code"] | def go(): doc = layout.SimpleFlowDocument('fodyssey.pdf',layout.DEFAULT_PAGE_SIZE,showBoundary=0) doc.onFirstPage = myFirstPage doc.onNewPage = myLaterPages doc.build(Elements) | a4f41b2bc34b6dbf776d412796f45b7bd6a19152 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a4f41b2bc34b6dbf776d412796f45b7bd6a19152/fodyssey.py |
Elements.append(layout.Spacer(0.2*inch, 0.1*inch)) | spacer(0.1) | def p(txt, style=ParaStyle): Elements.append(layout.Spacer(0.2*inch, 0.1*inch)) Elements.append(Paragraph(txt, style)) | a4f41b2bc34b6dbf776d412796f45b7bd6a19152 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a4f41b2bc34b6dbf776d412796f45b7bd6a19152/fodyssey.py |
PreStyle = styles["Code"] InitialStyle = copy.copy(PreStyle) InitialStyle.alignment = TA_CENTER InitialStyle.fontsize = 14 | def p(txt, style=ParaStyle): Elements.append(layout.Spacer(0.2*inch, 0.1*inch)) Elements.append(Paragraph(txt, style)) | a4f41b2bc34b6dbf776d412796f45b7bd6a19152 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a4f41b2bc34b6dbf776d412796f45b7bd6a19152/fodyssey.py | |
s = layout.Spacer(0.1*inch, 0.1*inch) Elements.append(s) p = layout.Preformatted(txt, PreStyle) | spacer(0.1) p = layout.Preformatted(txt, style) | def pre(txt, style=PreStyle): s = layout.Spacer(0.1*inch, 0.1*inch) Elements.append(s) p = layout.Preformatted(txt, PreStyle) Elements.append(p) | a4f41b2bc34b6dbf776d412796f45b7bd6a19152 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a4f41b2bc34b6dbf776d412796f45b7bd6a19152/fodyssey.py |
E.append([layout.Preformatted,'The Odyssey\n\nHomer\n', InitialStyle]) | E.append([spacer,2]) E.append([fTitle,'<font color=red>%s</font>' % Title, InitialStyle]) E.append([fTitle,'<font size=-4>by</font> <font color=green>%s</font>' % Author, InitialStyle]) | def findNext(L, i): while 1: if string.strip(L[i])=='': del L[i] kind = 1 if i<len(L): while string.strip(L[i])=='': del L[i] | a4f41b2bc34b6dbf776d412796f45b7bd6a19152 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a4f41b2bc34b6dbf776d412796f45b7bd6a19152/fodyssey.py |
self.x = self.y = self.angle = 0 | self.x = self.y = self.angle = self.skewY = self._dx = 0 self.skewX = 10 self._dy = 35.5 self.showPage = 1 | def __init__(self): self.fillColor = white self.strokeColor = None self.strokeWidth = 0.1 self.background = ReportLabBlue self.shadow = 0.5 self.height = 86 self.width = 129 self.x = self.y = self.angle = 0 | 52735650fe65e7b701c80dd27326b3086bdc15b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/52735650fe65e7b701c80dd27326b3086bdc15b9/corp.py |
g.add(definePath([ ('moveTo' ,15.7246,0 ), ('lineTo' ,9.49521,0 ), ('lineTo' ,6.64988,6.83711 ), ('curveTo' ,6.62224,6.95315 ,6.57391,7.10646 ,6.50485,7.29708 ), ('curveTo' ,6.43578,7.48767 ,6.35059,7.71559 ,6.24931,7.98079 ), ('lineTo' ,6.29074,6.71282 ), ('lineTo' ,6.29074,0 ), ('lineTo' ,0.55862,0 ), ('lineTo' ,0.55... | P = [ ('moveTo' ,15.7246,0 ), ('lineTo' ,9.49521,0 ), ('lineTo' ,6.64988,6.83711 ), ('curveTo' ,6.62224,6.95315 ,6.57391,7.10646 ,6.50485,7.29708 ), ('curveTo' ,6.43578,7.48767 ,6.35059,7.71559 ,6.24931,7.98079 ), ('lineTo' ,6.29074,6.71282 ), ('lineTo' ,6.29074,0 ), ('lineTo' ,0.55862,0 ), ('lineTo' ,0.55862,19.19365 ... | def _paintLogo(self, g, dx=0, dy=0, strokeColor=None, strokeWidth=0.1, fillColor=white): g.add(definePath([ ('moveTo' ,15.7246,0 ), ('lineTo' ,9.49521,0 ), ('lineTo' ,6.64988,6.83711 ), ('curveTo' ,6.62224,6.95315 ,6.57391,7.10646 ,6.50485,7.29708 ), ('curveTo' ,6.43578,7.48767 ,6.35059,7.71559 ,6.24931,7.98079 ), ('li... | 52735650fe65e7b701c80dd27326b3086bdc15b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/52735650fe65e7b701c80dd27326b3086bdc15b9/corp.py |
], strokeColor=strokeColor,strokeWidth=strokeWidth,fillColor=fillColor, dx=dx, dy=dy)) | ] or []) g.add(definePath(P,strokeColor=strokeColor,strokeWidth=strokeWidth,fillColor=fillColor, dx=dx, dy=dy)) | def _paintLogo(self, g, dx=0, dy=0, strokeColor=None, strokeWidth=0.1, fillColor=white): g.add(definePath([ ('moveTo' ,15.7246,0 ), ('lineTo' ,9.49521,0 ), ('lineTo' ,6.64988,6.83711 ), ('curveTo' ,6.62224,6.95315 ,6.57391,7.10646 ,6.50485,7.29708 ), ('curveTo' ,6.43578,7.48767 ,6.35059,7.71559 ,6.24931,7.98079 ), ('li... | 52735650fe65e7b701c80dd27326b3086bdc15b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/52735650fe65e7b701c80dd27326b3086bdc15b9/corp.py |
self._paintLogo(g,fillColor=fillColor) g.skew(kx=10, ky=0) g.shift(0,35.5) | self._paintLogo(g,fillColor=fillColor,strokeColor=strokeColor) g.skew(kx=self.skewX, ky=self.skewY) g.shift(self._dx,self._dy) | def draw(self): fillColor = self.fillColor strokeColor = self.strokeColor g = Group() bg = self.background shadow = self.shadow if bg: shadow = Color(bg.red*shadow,bg.green*shadow,bg.blue*shadow) self._paintLogo(g,dy=-2.5, dx=2,fillColor=shadow) self._paintLogo(g,fillColor=fillColor) g.skew(kx=10, ky=0) g.shift(0,35.5)... | 52735650fe65e7b701c80dd27326b3086bdc15b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/52735650fe65e7b701c80dd27326b3086bdc15b9/corp.py |
G.shift(self.x,self.y) | G.shift(x,y) | def draw(self): fillColor = self.fillColor strokeColor = self.strokeColor g = Group() bg = self.background shadow = self.shadow if bg: shadow = Color(bg.red*shadow,bg.green*shadow,bg.blue*shadow) self._paintLogo(g,dy=-2.5, dx=2,fillColor=shadow) self._paintLogo(g,fillColor=fillColor) g.skew(kx=10, ky=0) g.shift(0,35.5)... | 52735650fe65e7b701c80dd27326b3086bdc15b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/52735650fe65e7b701c80dd27326b3086bdc15b9/corp.py |
n = len(vals)-1 | n = len(vals) | def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): #print "cellstyle is ", repr(cellstyle), id(cellstyle) if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: #print "setting cell color to %s" % `cellstyle.color` self.canv.setFil... | 05bfe223624d1df66401c7f78a6ac81f78006d39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/05bfe223624d1df66401c7f78a6ac81f78006d39/tables.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.