rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
c.registerFont0(f)
c.addFont(f)
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...
1fe5c2ca28f1a89e8758aa0785f65e7c5f62e022 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/1fe5c2ca28f1a89e8758aa0785f65e7c5f62e022/pdfmetrics.py
c.registerFont0(Type1Font('Helvetica-WinAnsi', 'Helvetica-Oblique', WinAnsiEncoding))
c.addFont(Type1Font('Helvetica-WinAnsi', 'Helvetica-Oblique', WinAnsiEncoding))
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...
1fe5c2ca28f1a89e8758aa0785f65e7c5f62e022 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/1fe5c2ca28f1a89e8758aa0785f65e7c5f62e022/pdfmetrics.py
c.registerFont0(Type1Font('MacHelvNoEuro', 'Helvetica-Oblique', MacRomanEncoding))
c.addFont(Type1Font('MacHelvNoEuro', 'Helvetica-Oblique', MacRomanEncoding))
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...
1fe5c2ca28f1a89e8758aa0785f65e7c5f62e022 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/1fe5c2ca28f1a89e8758aa0785f65e7c5f62e022/pdfmetrics.py
euroMac = SingleByteEncoding('MacRomanEncoding')
euroMac = Encoding('MacRomanEncoding')
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...
1fe5c2ca28f1a89e8758aa0785f65e7c5f62e022 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/1fe5c2ca28f1a89e8758aa0785f65e7c5f62e022/pdfmetrics.py
c.registerFont0(Type1Font('MacHelvWithEuro', 'Helvetica-Oblique', euroMac))
c.addFont(Type1Font('MacHelvWithEuro', 'Helvetica-Oblique', euroMac))
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...
1fe5c2ca28f1a89e8758aa0785f65e7c5f62e022 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/1fe5c2ca28f1a89e8758aa0785f65e7c5f62e022/pdfmetrics.py
narrowEnc = SingleByteEncoding('WinAnsiEncoding')
narrowEnc = Encoding('WinAnsiEncoding')
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...
1fe5c2ca28f1a89e8758aa0785f65e7c5f62e022 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/1fe5c2ca28f1a89e8758aa0785f65e7c5f62e022/pdfmetrics.py
c.registerFont0(Type1Font('narrow', 'Helvetica-Oblique', narrowEnc))
c.addFont(Type1Font('narrow', 'Helvetica-Oblique', narrowEnc))
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...
1fe5c2ca28f1a89e8758aa0785f65e7c5f62e022 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/1fe5c2ca28f1a89e8758aa0785f65e7c5f62e022/pdfmetrics.py
"""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."""
"""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 version that watched the nesting leve...
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...
4ceb4d2a0f38ac2e44bb809a2be98f1573ec1ebb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/4ceb4d2a0f38ac2e44bb809a2be98f1573ec1ebb/graphdocpy.py
ind = indentLevel(line) if ind <= startingIndent: break
stripped = string.strip(line) if len(stripped) == 0: continue elif stripped[0] == ' continue
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...
4ceb4d2a0f38ac2e44bb809a2be98f1573ec1ebb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/4ceb4d2a0f38ac2e44bb809a2be98f1573ec1ebb/graphdocpy.py
extracted.append(line)
ind = indentLevel(line) if ind <= startingIndent: break else: extracted.append(line)
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...
4ceb4d2a0f38ac2e44bb809a2be98f1573ec1ebb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/4ceb4d2a0f38ac2e44bb809a2be98f1573ec1ebb/graphdocpy.py
usefulLines = lines[firstLineNo:lineNo+1] return string.join(usefulLines, '\n')
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...
4ceb4d2a0f38ac2e44bb809a2be98f1573ec1ebb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/4ceb4d2a0f38ac2e44bb809a2be98f1573ec1ebb/graphdocpy.py
if filters is not None and not dictionary.has_key("Filters"):
if filters is not None and not dictionary.dict.has_key("Filters"):
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...
dd5954a1604fc1f31f87513b6ab3082910c486d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/dd5954a1604fc1f31f87513b6ab3082910c486d4/pdfdoc.py
radius = self._radius = self._cx - 5
radius = self._radius = self._cx-self.x
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...
6231c6a4bfec70d1e8b5577eccd857a504ee7bda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6231c6a4bfec70d1e8b5577eccd857a504ee7bda/piecharts.py
if '.' in path:
while '.' in path: if debug: print 'removed . from path'
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...
116148472c2fdeac4e8dea6e3401cdb4bce70920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/116148472c2fdeac4e8dea6e3401cdb4bce70920/utils.py
if abspath in path:
while abspath in path: if debug: print 'removed "%s" from path' % abspath
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...
116148472c2fdeac4e8dea6e3401cdb4bce70920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/116148472c2fdeac4e8dea6e3401cdb4bce70920/utils.py
__version__ = '$Id: ttfonts.py,v 1.1 2002/05/28 15:33:57 rgbecker Exp $'
__version__ = '$Id: ttfonts.py,v 1.2 2002/07/02 21:28:29 dinu_gherman Exp $'
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.'''
dc9fc2a23ae8cc092d04aa76950652ec03fc6c00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/dc9fc2a23ae8cc092d04aa76950652ec03fc6c00/ttfonts.py
while length > 1:
while length > 0:
def extractInfo(self, charInfo=1): """Extract typographic information from the loaded font file.
dc9fc2a23ae8cc092d04aa76950652ec03fc6c00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/dc9fc2a23ae8cc092d04aa76950652ec03fc6c00/ttfonts.py
if char < 0x20 or char > 0x7E:
if char < 33 or char > 126 or chr(char) in \ ('[', ']', '(', ')', '{', '}', '<', '>', '/', '%'):
def extractInfo(self, charInfo=1): """Extract typographic information from the loaded font file.
dc9fc2a23ae8cc092d04aa76950652ec03fc6c00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/dc9fc2a23ae8cc092d04aa76950652ec03fc6c00/ttfonts.py
length = length - 2
length = length - 1 break elif platformId == 1 and encodingId == 0 and languageId == 0 \ and nameId == 6: psName = self.get_chunk(string_data_offset + offset, length) for char in psName: char = ord(char) if char < 33 or char > 126 or chr(char) in \ ('[', ']', '(', ')', '{', '}', '<', '>', '/', '%'): raise TTFError, ...
def extractInfo(self, charInfo=1): """Extract typographic information from the loaded font file.
dc9fc2a23ae8cc092d04aa76950652ec03fc6c00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/dc9fc2a23ae8cc092d04aa76950652ec03fc6c00/ttfonts.py
raise TTFError, 'Font does not have cmap for Unicode (platform 3, encoding 1, format 4)'
raise TTFError, 'Font does not have cmap for Unicode (platform 3, encoding 1, format 4 or platform 0 any encoding format 4)'
def extractInfo(self, charInfo=1): """Extract typographic information from the loaded font file.
dc9fc2a23ae8cc092d04aa76950652ec03fc6c00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/dc9fc2a23ae8cc092d04aa76950652ec03fc6c00/ttfonts.py
return lambda v, s=start, e=end, f=f: f(v,s,e,_3d_dx=_3d_dx,_3d_dy=_3d_dy)
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)
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...
842bea12fd6f610f6406985c79da84c4921f0bc2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/842bea12fd6f610f6406985c79da84c4921f0bc2/axes.py
if self.fillColor is not None:
if self._fillColor is not None:
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)
8a366f063aaff6cff478ee881451c0403b911ad2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/8a366f063aaff6cff478ee881451c0403b911ad2/renderPS.py
mask=mask,
mask=self._mask,
def draw(self): #center it self.canv.drawImage(self.filename, 0, 0, self.drawWidth, self.drawHeight, mask=mask, )
3836e7fad155f205445228a83252c2eb87c2fbe0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3836e7fad155f205445228a83252c2eb87c2fbe0/flowables.py
(groupX, groupWidth) = self.categoryAxis.scale(colNo) x = groupX + (0.5 * self.groupSpacing * normFactor) y = self.valueAxis.scale(0) height = self.valueAxis.scale(datum) - y lineRow.append((x, y+height))
if datum is not None: (groupX, groupWidth) = self.categoryAxis.scale(colNo) x = groupX + (0.5 * self.groupSpacing * normFactor) y = self.valueAxis.scale(0) height = self.valueAxis.scale(datum) - y lineRow.append((x, y+height))
def calcPositions(self): """Works out where they go.
f81a0e2ab01f1f1debe5719c9d72f4ac34b88a74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f81a0e2ab01f1f1debe5719c9d72f4ac34b88a74/linecharts.py
if callout: callout(self,g,thisx,y,colorNamePairs[count])
if callout: callout(self,g,thisx,y,(col,name))
def gAdd(t,g=g,fontName=fontName,fontSize=fontSize,fillColor=fillColor): t.fontName = fontName t.fontSize = fontSize t.fillColor = fillColor return g.add(t)
a3cb5bace045b38885c035998e20281066ff9a9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a3cb5bace045b38885c035998e20281066ff9a9e/legends.py
if S[-1]=='': del S[-1]
if S==[]: S = ['']
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...
bacf9da3f34fcc980069662749fea10714080f99 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bacf9da3f34fcc980069662749fea10714080f99/paragraph.py
if sys.platform=='win32' and ('install' in sys.argv or 'install_ext' in sys.argv):
if sys.hexversion<0x2030000 and sys.platform=='win32' and ('install' in sys.argv or 'install_ext' in sys.argv):
def raiseConfigError(msg): import exceptions class ConfigError(exceptions.Exception): pass raise ConfigError(msg)
78fc70c06d0c9e0d72d4389ab9f0b2666df8997e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/78fc70c06d0c9e0d72d4389ab9f0b2666df8997e/setup.py
def _addObjImport(obj,I):
def _addObjImport(obj,I,n=None):
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)
79d3a5b5f63d0b4c99d9cddf85c0854ebb240aa7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/79d3a5b5f63d0b4c99d9cddf85c0854ebb240aa7/shapes.py
cn = c.__name__
n = n or c.__name__
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)
79d3a5b5f63d0b4c99d9cddf85c0854ebb240aa7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/79d3a5b5f63d0b4c99d9cddf85c0854ebb240aa7/shapes.py
I[m] = [cn] elif cn not in I[m]: I[m].append(cn)
I[m] = [n] elif n not in I[m]: I[m].append(n)
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)
79d3a5b5f63d0b4c99d9cddf85c0854ebb240aa7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/79d3a5b5f63d0b4c99d9cddf85c0854ebb240aa7/shapes.py
P.extend(args)
P.extend(list(args))
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...
79d3a5b5f63d0b4c99d9cddf85c0854ebb240aa7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/79d3a5b5f63d0b4c99d9cddf85c0854ebb240aa7/shapes.py
else: self._syntax_error('<onDraw/> needs at least a name attribute')
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')
348618da9c231b4c66e4e222709ad5c1c1899b51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/348618da9c231b4c66e4e222709ad5c1c1899b51/paraparser.py
def end_onDraw(self): if hasattr(self,'text'): self._syntax_error('Only <onDraw/> tag allowed') else: self.handle_data('')
self.handle_data('')
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')
348618da9c231b4c66e4e222709ad5c1c1899b51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/348618da9c231b4c66e4e222709ad5c1c1899b51/paraparser.py
print l.fontName,l.fontSize,l.textColor,l.bold, l.rise, '|%s|'%l.text[:25]
print l.fontName,l.fontSize,l.textColor,l.bold, l.rise, '|%s|'%l.text[:25], if hasattr(l,'cbDefn'): print 'cbDefn',l.cbDefn.name,l.cbDefn.label,l.cbDefn.kind else: print
def check_text(text,p=_parser): print '##########' text = cleanBlockQuotedText(text) l,rv,bv = p.parse(text,style) if rv is None: for l in _parser.errors: print l else: print 'ParaStyle', l.fontName,l.fontSize,l.textColor for l in rv: print l.fontName,l.fontSize,l.textColor,l.bold, l.rise, '|%s|'%l.text[:25]
348618da9c231b4c66e4e222709ad5c1c1899b51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/348618da9c231b4c66e4e222709ad5c1c1899b51/paraparser.py
child.setProperties(Widget.getProperties(self))
for i in child._attrMap.keys(): del child.__dict__[i] child = TypedPropertyElementWrapper(self,child)
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
5e75a3723764d5b941659cdcd2dc7aefa0ad6c98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/5e75a3723764d5b941659cdcd2dc7aefa0ad6c98/widgetbase.py
def getModuleObjects(folder, rootName, typ): "Get a list of all function objects defined *somewhere* in a package." folders = [folder] + subFoldersOfFolder(folder) objects = [] for f in folders: sys.path.insert(0, f) os.chdir(f) pattern = os.path.join('*.py') prefix = f[string.find(f, rootName):] prefix = string.repl...
9d3eb3bed02bb6b9c7db798cb91bc83e0a8b21b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9d3eb3bed02bb6b9c7db798cb91bc83e0a8b21b3/test_docstrings.py
class DocstringTestCase(unittest.TestCase):
class DocstringTestCase(SecureTestCase):
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...
9d3eb3bed02bb6b9c7db798cb91bc83e0a8b21b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9d3eb3bed02bb6b9c7db798cb91bc83e0a8b21b3/test_docstrings.py
h = s/5 z = s/2 star = Polygon(points = [ h-z, 0-z, h*1.5-z, h*2.05-z, 0-z, h*3-z, h*1.95-z, h*3-z, z-z, s-z, h*3.25-z, h*3-z, s-z, h*3-z, s-h*1.5-z, h*2.05-z, s-h-z, 0-z, z-z, h-z, ],
star = Polygon(P,
def draw(self): s = float(self.size) #abbreviate as we will use this a lot g = Group()
ec9acd74860c916ac188fac39fcd8b4b8fb1c1f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ec9acd74860c916ac188fac39fcd8b4b8fb1c1f6/flags.py
"""This function produces two pdf files with examples of all the signs and symbols from this file.
"""This function produces three pdf files with examples of all the signs and symbols from this file.
def test(): """This function produces two pdf files with examples of all the signs and symbols from this file. """
ec9acd74860c916ac188fac39fcd8b4b8fb1c1f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ec9acd74860c916ac188fac39fcd8b4b8fb1c1f6/flags.py
rowCount = er - sr
rowCount = er - sr + 1
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)...
27e5291923a8a6f676a1948e2126f3b2337cb16a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/27e5291923a8a6f676a1948e2126f3b2337cb16a/tables.py
colCount = ec - sc
colCount = ec - sc + 1
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)...
27e5291923a8a6f676a1948e2126f3b2337cb16a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/27e5291923a8a6f676a1948e2126f3b2337cb16a/tables.py
group = transformNode(self.doc, "g", transform="") self.currGroup.appendChild(group)
currGroup, group = self.currGroup, transformNode(self.doc, "g", transform="") currGroup.appendChild(group)
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"
bdd3c784f062da948b8d9fcb8a343d179516359d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bdd3c784f062da948b8d9fcb8a343d179516359d/renderSVG.py
def endGroup(self):
return currGroup def endGroup(self,currGroup):
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"
bdd3c784f062da948b8d9fcb8a343d179516359d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bdd3c784f062da948b8d9fcb8a343d179516359d/renderSVG.py
if not self.currGroup.getAttribute("transform"): pass
self.currGroup = currGroup
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"
bdd3c784f062da948b8d9fcb8a343d179516359d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bdd3c784f062da948b8d9fcb8a343d179516359d/renderSVG.py
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...
bdd3c784f062da948b8d9fcb8a343d179516359d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bdd3c784f062da948b8d9fcb8a343d179516359d/renderSVG.py
self._canvas.startGroup()
currGroup = self._canvas.startGroup()
def drawGroup(self, group): if self.verbose: print "### begin _SVGRenderer.drawGroup"
bdd3c784f062da948b8d9fcb8a343d179516359d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bdd3c784f062da948b8d9fcb8a343d179516359d/renderSVG.py
self._canvas.endGroup()
def drawGroup(self, group): if self.verbose: print "### begin _SVGRenderer.drawGroup"
bdd3c784f062da948b8d9fcb8a343d179516359d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bdd3c784f062da948b8d9fcb8a343d179516359d/renderSVG.py
def applyStateChanges(self, delta, newState): """This takes a set of states, and outputs the operators needed to set those properties"""
bdd3c784f062da948b8d9fcb8a343d179516359d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bdd3c784f062da948b8d9fcb8a343d179516359d/renderSVG.py
valueStep = P[1]-P[0]
if len(P)>1: valueStep = P[1]-P[0] else: oVS = self.valueStep self.valueStep = None P = self._calcTickPositions() self.valueStep = oVS if len(P)>1: valueStep = P[1]-P[0] else: valueStep = self._valueStep
def _setRange(self, dataSeries): """Set minimum and maximum axis values.
0381bea6798e59b4b21874fd50ad46c7b13d4618 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0381bea6798e59b4b21874fd50ad46c7b13d4618/axes.py
for r in R: f = r[1][0]
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...
cd50818787943255f4fd36ac26d500bae6989957 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/cd50818787943255f4fd36ac26d500bae6989957/paragraph.py
for l in bfrag.lines[start:stop-1]:
lines = bfrag.lines[start:stop] for l in lines:
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...
cd50818787943255f4fd36ac26d500bae6989957 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/cd50818787943255f4fd36ac26d500bae6989957/paragraph.py
words[-1].text = w[1][1]
words[-1].text = nText
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...
cd50818787943255f4fd36ac26d500bae6989957 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/cd50818787943255f4fd36ac26d500bae6989957/paragraph.py
words[-1].text = words[-1].text+' '
if nText!='' and nText[0]!=' ': words[-1].text = words[-1].text + ' '
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...
cd50818787943255f4fd36ac26d500bae6989957 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/cd50818787943255f4fd36ac26d500bae6989957/paragraph.py
words[-1].text = w[1][1]
words[-1].text = nText
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...
cd50818787943255f4fd36ac26d500bae6989957 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/cd50818787943255f4fd36ac26d500bae6989957/paragraph.py
words[-1].text = words[-1].text + ' ' + w[1][1]
words[-1].text = words[-1].text + ' ' + nText
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...
cd50818787943255f4fd36ac26d500bae6989957 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/cd50818787943255f4fd36ac26d500bae6989957/paragraph.py
self.decimalPlaces = places self.decimalSeparator = decimalSep self.thousandSeparator = thousandSep
self.places = places self.dot = decimalSep self.comma = thousandSep
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
b4bda7469f194e7f4a4cebbbb96c86ddd2f5fba3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b4bda7469f194e7f4a4cebbbb96c86ddd2f5fba3/formatters.py
places, sep = self.decimalPlaces, self.decimalSeparator
places, sep = self.places, self.dot
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('.')
b4bda7469f194e7f4a4cebbbb96c86ddd2f5fba3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b4bda7469f194e7f4a4cebbbb96c86ddd2f5fba3/formatters.py
strInt, strFrac = (('%.' + str(places) + 'f') % num).split('.')
strInt = ('%.' + str(places) + 'f') % num if places: strInt, strFrac = strInt.split('.') strFrac = sep + strFrac if strip: while strFrac and strFrac[-1] in ['0',sep]: strFrac = strFrac[:-1] else: strFrac = ''
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('.')
b4bda7469f194e7f4a4cebbbb96c86ddd2f5fba3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b4bda7469f194e7f4a4cebbbb96c86ddd2f5fba3/formatters.py
if self.thousandSeparator is not None:
if self.comma is not None:
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('.')
b4bda7469f194e7f4a4cebbbb96c86ddd2f5fba3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b4bda7469f194e7f4a4cebbbb96c86ddd2f5fba3/formatters.py
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('.')
b4bda7469f194e7f4a4cebbbb96c86ddd2f5fba3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b4bda7469f194e7f4a4cebbbb96c86ddd2f5fba3/formatters.py
strNew = self.thousandSeparator + right + strNew
strNew = self.comma + right + strNew
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('.')
b4bda7469f194e7f4a4cebbbb96c86ddd2f5fba3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b4bda7469f194e7f4a4cebbbb96c86ddd2f5fba3/formatters.py
strFrac = sep + strFrac if strip: while strFrac and strFrac[-1] in ['0',sep]: strFrac = strFrac[:-1]
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('.')
b4bda7469f194e7f4a4cebbbb96c86ddd2f5fba3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b4bda7469f194e7f4a4cebbbb96c86ddd2f5fba3/formatters.py
return (NameString, AttDict, ContentList, ExtraStuff)
return (NameString, AttDict, ContentList, ExtraStuff), len(xmltext)
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...
d0e16f3dc613b527f024cc872e50a87b7cec1bca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d0e16f3dc613b527f024cc872e50a87b7cec1bca/rparsexml.py
filename = os.path.splitext(self.sourceFilename)[0] + '.pdf'
if self.sourceFilename: filename = os.path.splitext(self.sourceFilename)[0] + '.pdf'
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...
f1978dc295686f0bc28de276ebf41b91d67e5b87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f1978dc295686f0bc28de276ebf41b91d67e5b87/pythonpoint.py
canv = canvas.Canvas(filename, pagesize = pageSize)
outfile = cStringIO.StringIO() canv = canvas.Canvas(outfile, pagesize = pageSize)
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...
f1978dc295686f0bc28de276ebf41b91d67e5b87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f1978dc295686f0bc28de276ebf41b91d67e5b87/pythonpoint.py
filename = os.path.splitext(self.sourceFilename)[0] + '.pdf' doc = SimpleDocTemplate(filename, pagesize=rl_config.defaultPageSize, showBoundary=0)
if self.sourceFilename : filename = os.path.splitext(self.sourceFilename)[0] + '.pdf' outfile = cStringIO.StringIO() doc = SimpleDocTemplate(outfile, pagesize=rl_config.defaultPageSize, showBoundary=0)
def saveAsHandout(self): """Write the PDF document, multiple slides per page."""
f1978dc295686f0bc28de276ebf41b91d67e5b87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f1978dc295686f0bc28de276ebf41b91d67e5b87/pythonpoint.py
self.saveAsHandout()
return self.saveAsHandout()
def save(self): "Save the PDF document."
f1978dc295686f0bc28de276ebf41b91d67e5b87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f1978dc295686f0bc28de276ebf41b91d67e5b87/pythonpoint.py
self.saveAsPresentation()
return self.saveAsPresentation()
def save(self): "Save the PDF document."
f1978dc295686f0bc28de276ebf41b91d67e5b87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f1978dc295686f0bc28de276ebf41b91d67e5b87/pythonpoint.py
rawdata = open(datafilename).read()
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...
f1978dc295686f0bc28de276ebf41b91d67e5b87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f1978dc295686f0bc28de276ebf41b91d67e5b87/pythonpoint.py
pres.save()
pdfcontent = pres.save()
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...
f1978dc295686f0bc28de276ebf41b91d67e5b87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f1978dc295686f0bc28de276ebf41b91d67e5b87/pythonpoint.py
return pdfcontent
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...
f1978dc295686f0bc28de276ebf41b91d67e5b87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f1978dc295686f0bc28de276ebf41b91d67e5b87/pythonpoint.py
self.filename = filename
self._file = self.filename = filename
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...
1c036cda6a558fbdd3287a8f1333b70fa63f54b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/1c036cda6a558fbdd3287a8f1333b70fa63f54b2/flowables.py
self._img = ImageReader(self.filename)
self._img = ImageReader(self._file) del self._file
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)
1c036cda6a558fbdd3287a8f1333b70fa63f54b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/1c036cda6a558fbdd3287a8f1333b70fa63f54b2/flowables.py
do_exec('mv docs/reference/*.pdf %s'%dst) do_exec('mv docs/reference/*.pdf %s'%htmldir)
do_exec('cp docs/reference/*.pdf %s' % htmldir) do_exec('mv docs/reference/*.pdf %s' % dst)
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 -...
0695ee6796c745fa3c3027e83c103e4ff1c7e510 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0695ee6796c745fa3c3027e83c103e4ff1c7e510/daily.py
do_exec('mv docs/userguide/*.pdf %s'%dst) do_exec('mv docs/userguide/*.pdf %s'%htmldir)
do_exec('cp docs/userguide/*.pdf %s' % htmldir) do_exec('mv docs/userguide/*.pdf %s' % dst)
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 -...
0695ee6796c745fa3c3027e83c103e4ff1c7e510 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0695ee6796c745fa3c3027e83c103e4ff1c7e510/daily.py
folder = os.path.dirname(sys.argv[0])
folder = os.path.dirname(sys.argv[0]) or os.getcwd()
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())...
fcc4ff563440632ab267d623bc9bee53e6f3c379 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/fcc4ff563440632ab267d623bc9bee53e6f3c379/runAll.py
self.assertEquals(map(lambda x:x.text, fragList), [u'Hello ',u'\xc2\xa9',u' copyright'])
self.assertEquals(map(lambda x:x.text, fragList), [u'Hello ',u'\xa9',u' copyright'])
def testEntityUnicode(self): "Numeric entities should be unescaped by parser" txt = u"Hello &#169; copyright" fragList = ParaParser().parse(txt, self.style)[1] self.assertEquals(map(lambda x:x.text, fragList), [u'Hello ',u'\xc2\xa9',u' copyright'])
a6355d4910de1f9d166a541f09fce797104fd26c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a6355d4910de1f9d166a541f09fce797104fd26c/test_platypus_paraparser.py
story.append(FrameBreak())
def code(txt): story.append(Preformatted(txt,styleSheet['Code'])) code('''import reportlab.rl_config reportlab.rl_config.warnOnMissingFontGlyphs = 0 from reportlab.pdfbase import pdfmetrics fontDir = os.path.join(os.path.dirname(reportlab.__file__),'fonts') face = pdfmetrics.EmbeddedType1Face(os.path.join(fontDir,'LeE...
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...
70b47bdfe92e0dc0682ee7991557e3fa42af8d8f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/70b47bdfe92e0dc0682ee7991557e3fa42af8d8f/test_platypus_general.py
story.append(platypus.Preformatted(code, styleSheet['Code'], dedent=4))
story.append(Preformatted(code, styleSheet['Code'], dedent=4))
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)
70b47bdfe92e0dc0682ee7991557e3fa42af8d8f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/70b47bdfe92e0dc0682ee7991557e3fa42af8d8f/test_platypus_general.py
from reportlab.lib.utils import haveImages, _RL_DIR, rl_isfile, open_for_read if haveImages: gif = os.path.join(_RL_DIR,'test','pythonpowered.gif') if rl_isfile(gif): data = [] t = data.append furl = gif.replace(os.sep,'/') if sys.platform=='win32' and furl[1]==':': furl = furl[0]+'|'+furl[2:] if furl[0]!='/': furl = '...
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)
70b47bdfe92e0dc0682ee7991557e3fa42af8d8f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/70b47bdfe92e0dc0682ee7991557e3fa42af8d8f/test_platypus_general.py
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)
70b47bdfe92e0dc0682ee7991557e3fa42af8d8f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/70b47bdfe92e0dc0682ee7991557e3fa42af8d8f/test_platypus_general.py
"""Draw an ellipse with foci at (x1,y1) (x2,y2).
"""Draw an ellipse defined by an enclosing rectangle. Note that (x1,y1) and (x2,y2) are the corner points of the enclosing rectangle.
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) ...
28c63b6544ec14b179d0ad0fbb42915c9c143515 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/28c63b6544ec14b179d0ad0fbb42915c9c143515/canvas.py
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) ...
28c63b6544ec14b179d0ad0fbb42915c9c143515 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/28c63b6544ec14b179d0ad0fbb42915c9c143515/canvas.py
os.system("python genAll.py -s")
os.system("%s genAll.py -s" % sys.executable)
def test0(self): "Test if all manuals buildable from source."
ec709d8e14f2919a9757f988ede711d8583af5a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ec709d8e14f2919a9757f988ede711d8583af5a5/test_docs_build.py
unittest.TextTestRunner().run(makeSuite())
unittest.TextTestRunner().run(makeSuite())
def makeSuite(): suite = unittest.TestSuite() loader = unittest.TestLoader() if sys.platform[:4] != 'java': suite.addTest(loader.loadTestsFromTestCase(ManualTestCase)) return suite
ec709d8e14f2919a9757f988ede711d8583af5a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ec709d8e14f2919a9757f988ede711d8583af5a5/test_docs_build.py
r = os.path.splitext(self.pfbFileName)[0] + ext if os.path.isfile(r): return r
r_basename = os.path.splitext(self.pfbFileName)[0] for e in possible_exts: if os.path.isfile(r_basename + e): return r_basename + e
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)...
a49bc7d0c3410d4fa3628b3b6a7d025f24bd507a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a49bc7d0c3410d4fa3628b3b6a7d025f24bd507a/pdfmetrics.py
pfb = os.path.splitext(afm)[0] + 'pfb' if os.path.isfile(pfb): r = pfb else: r = None
for e in possible_exts: pfb = os.path.splitext(afm)[0] + e if os.path.isfile(pfb): r = pfb else: r = None
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)...
a49bc7d0c3410d4fa3628b3b6a7d025f24bd507a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a49bc7d0c3410d4fa3628b3b6a7d025f24bd507a/pdfmetrics.py
pfb = os.path.splitext(afm)[0] + '.pfb'
for e in ('.pfb', '.PFB'): pfb = os.path.splitext(afm)[0] + e if os.path.isfile(pfb): break
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 ...
a49bc7d0c3410d4fa3628b3b6a7d025f24bd507a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a49bc7d0c3410d4fa3628b3b6a7d025f24bd507a/pdfmetrics.py
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
30c753a6c7edabf444bd57d12dd1b4c3dcf01906 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/30c753a6c7edabf444bd57d12dd1b4c3dcf01906/canvas.py
imageFile.seek(0)
imageFile.seek(0)
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
30c753a6c7edabf444bd57d12dd1b4c3dcf01906 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/30c753a6c7edabf444bd57d12dd1b4c3dcf01906/canvas.py
imagedata.append('BI') imagedata.append('/Width %0.2f /Height %0.2f' %(info[0], info[1])) imagedata.append('/BitsPerComponent 8') imagedata.append('/ColorSpace /%s' % colorSpace) imagedata.append('/Filter [ /ASCII85Decode /DCTDecode]') imagedata.append('ID')
imagedata.append('BI /W %d /H %d /BPC 8 /CS /%s /F [/A85 /DCT] ID' % (info[0], info[1], colorSpace))
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
30c753a6c7edabf444bd57d12dd1b4c3dcf01906 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/30c753a6c7edabf444bd57d12dd1b4c3dcf01906/canvas.py
imagedata.append('BI')
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
30c753a6c7edabf444bd57d12dd1b4c3dcf01906 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/30c753a6c7edabf444bd57d12dd1b4c3dcf01906/canvas.py
imagedata.append('/W %0.2f /H %0.2f /BPC 8 /CS /RGB /F [/A85 /Fl]' % (imgwidth, imgheight)) imagedata.append('ID')
imagedata.append('BI /W %d /H %d /BPC 8 /CS /RGB /F [/A85 /Fl] ID' % (imgwidth, imgheight))
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
30c753a6c7edabf444bd57d12dd1b4c3dcf01906 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/30c753a6c7edabf444bd57d12dd1b4c3dcf01906/canvas.py
L.strokeColor = self.strokeColor L.strokeWidth = self.strokeWidth L.strokeDashArray = self.strokeDashArray
L.strokeColor = strokeColor L.strokeWidth = strokeWidth L.strokeDashArray = strokeDashArray
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)
2cf879d2e722e4f9186b7500687b1d7341dc3a5c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2cf879d2e722e4f9186b7500687b1d7341dc3a5c/axes.py
eg(""" def __init__(self,filename, pagesize=(595.27,841.89), bottomup = 1, pageCompression=0, encoding=rl_config.defaultEncoding, verbosity=0): """)
639e694d1db2c46d0d4ee812c772c39676c56229 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/639e694d1db2c46d0d4ee812c772c39676c56229/ch2_graphics.py
self._parent._parent._in -= 1
self._parent._parent._in = self._parent._parent._in - 1
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 = ...
3e44ba24f2b4f661de43f0c0594c1d83be0e9816 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3e44ba24f2b4f661de43f0c0594c1d83be0e9816/pycanvas.py
self._parent._contextlevel -= 1
self._parent._contextlevel = self._parent._contextlevel - 1
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] =...
3e44ba24f2b4f661de43f0c0594c1d83be0e9816 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3e44ba24f2b4f661de43f0c0594c1d83be0e9816/pycanvas.py
elif self._action == "endForm" :
elif self._action in [ "endForm", "drawPath", "clipPath" ] :
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("")
3e44ba24f2b4f661de43f0c0594c1d83be0e9816 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3e44ba24f2b4f661de43f0c0594c1d83be0e9816/pycanvas.py
for op, (sc, sr), (ec, er), weight, color in cmds:
for c in cmds: c = tuple(c) (sc,sr), (ec,er) = c[1:3]
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))
11eb40f3a3d8b8d0f34ebf418a68ac6839a1a3b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/11eb40f3a3d8b8d0f34ebf418a68ac6839a1a3b0/tables.py
self._addCommand((op, (sc, sr), (ec, er), weight, color))
self._addCommand((c[0],)+((sc, sr), (ec, er))+c[3:])
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))
11eb40f3a3d8b8d0f34ebf418a68ac6839a1a3b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/11eb40f3a3d8b8d0f34ebf418a68ac6839a1a3b0/tables.py