rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
outline = self.outline outline.prepare(self, canvas)
def SaveToFile(self, filename, canvas): from types import StringType # prepare outline outline = self.outline outline.prepare(self, canvas) if type(filename) is StringType: myfile = 1 f = open(filename, "wb") else: myfile = 0 f = filename # IT BETTER BE A FILE-LIKE OBJECT! txt = self.format() f.write(txt) if myfile: f....
0be23823f1a584548422e9894db4903c2cd17df8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0be23823f1a584548422e9894db4903c2cd17df8/pdfdoc.py
if next >= end:
if inc > 0 and next >= end: break elif inc < 0 and next <= end:
def frange(start, end=None, inc=None): "A range function, that does accept float increments..." if end == None: end = start + 0.0 start = 0.0 if inc == None: inc = 1.0 L = [] while 1: next = start + len(L) * inc if next >= end: break L.append(next) return L
ae070abb3e34a307bab61a8b403456383e9d6417 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ae070abb3e34a307bab61a8b403456383e9d6417/grids.py
FT_INC_DIR = ['/usr/local/include/freetype2']
FT_INC_DIR = ['/usr/local/include','/usr/local/include/freetype2']
def main(): cwd = os.getcwd() os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) MACROS=[('ROBIN_DEBUG',None)] MACROS=[] from glob import glob from distutils.core import setup, Extension pJoin=os.path.join LIBART_VERSION = libart_version() SOURCES=['_renderPM.c'] DEVEL_DIR=os.curdir LIBART_DIR=pJoin(DEVEL_DIR,'li...
f2354a2e6cfb6d352844995d552555bca57bead7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f2354a2e6cfb6d352844995d552555bca57bead7/setup.py
(file, pathname, description) = imp.find_module(name, parentModule.__path__)
(file, pathname, description) = imp.find_module(name, parentModule.__file__)
def recursiveImport(modulename, baseDir=None, noCWD=0): """Dynamically imports possible packagized module, or raises ImportError""" import imp parts = string.split(modulename, '.') part = parts[0] path = list(baseDir and (type(baseDir) not in SeqTypes and [baseDir] or filter(None,baseDir)) or None) if not noCWD and '.'...
4235ee5d02ae8d66505b546551cebd45936dd345 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/4235ee5d02ae8d66505b546551cebd45936dd345/utils.py
"""Draws a string right-aligned with the y coordinate"""
"""Draws a string right-aligned with the x coordinate"""
def drawRightString(self, x, y, text): """Draws a string right-aligned with the y coordinate""" width = self.stringWidth(text, self._fontname, self._fontsize) t = self.beginText(x - width, y) t.textLine(text) self.drawText(t)
0c83eb1fb49e65692475d218070d2adba8f94c37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0c83eb1fb49e65692475d218070d2adba8f94c37/canvas.py
"""Draws a string right-aligned with the y coordinate. I
"""Draws a string right-aligned with the x coordinate. I
def drawCentredString(self, x, y, text): """Draws a string right-aligned with the y coordinate. I am British so the spelling is correct, OK?""" width = self.stringWidth(text, self._fontname, self._fontsize) t = self.beginText(x - 0.5*width, y) t.textLine(text) self.drawText(t)
0c83eb1fb49e65692475d218070d2adba8f94c37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0c83eb1fb49e65692475d218070d2adba8f94c37/canvas.py
self.width = 200 self.height = 100
self.x = 20 self.y = 10 self.height = 85 self.width = 180
def __init__(self): self.debug = 0
564845562a7cc276b8976fa4ce5c4e13bfb485e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/564845562a7cc276b8976fa4ce5c4e13bfb485e5/barcharts.py
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))
D = [] for d in self.data: for e in d: if e is None: e = 0 D.append(e) return min(D), max(D)
def _findMinMaxValues(self): "Find the minimum and maximum value of the data we have." 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))
564845562a7cc276b8976fa4ce5c4e13bfb485e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/564845562a7cc276b8976fa4ce5c4e13bfb485e5/barcharts.py
g.add(Rect(self.x, self.y, self.width, self.height, strokeColor = self.strokeColor, fillColor= self.fillColor))
g.add(Rect(self.x, self.y, self.width, self.height, strokeColor = self.strokeColor, fillColor= self.fillColor))
def makeBackground(self): g = Group() #print 'BarChart.makeBackground(%s, %s, %s, %s)' % (self.x, self.y, self.width, self.height) g.add(Rect(self.x, self.y, self.width, self.height, strokeColor = self.strokeColor, fillColor= self.fillColor))
564845562a7cc276b8976fa4ce5c4e13bfb485e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/564845562a7cc276b8976fa4ce5c4e13bfb485e5/barcharts.py
def demo(self): """Shows basic use of a bar chart"""
564845562a7cc276b8976fa4ce5c4e13bfb485e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/564845562a7cc276b8976fa4ce5c4e13bfb485e5/barcharts.py
data = [ (13, 5, 20, 22, 37, 45, 19, 4), (14, 6, 21, 23, 38, 46, 20, 5) ]
def demo(self): """Shows basic use of a bar chart"""
564845562a7cc276b8976fa4ce5c4e13bfb485e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/564845562a7cc276b8976fa4ce5c4e13bfb485e5/barcharts.py
bc.x = 20 bc.y = 10 bc.height = 85 bc.width = 180 bc.data = data
def demo(self): """Shows basic use of a bar chart"""
564845562a7cc276b8976fa4ce5c4e13bfb485e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/564845562a7cc276b8976fa4ce5c4e13bfb485e5/barcharts.py
def demo(self): """Shows basic use of a bar chart"""
564845562a7cc276b8976fa4ce5c4e13bfb485e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/564845562a7cc276b8976fa4ce5c4e13bfb485e5/barcharts.py
if hasattr(self,saveLogger):
if hasattr(self,'saveLogger'):
def save(self, formats=None, verbose=None, fnRoot=None, outDir=None): from reportlab import rl_config "Saves copies of self in desired location and formats" ext = '' if not fnRoot: fnRoot = getattr(self,'fileNamePattern',(self.__class__.__name__+'%03d')) chartId = getattr(self,'chartId',0) if callable(fnRoot): fnRoot =...
af6c6dab559d71c5c08c6e5f46105c799fd65c94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/af6c6dab559d71c5c08c6e5f46105c799fd65c94/shapes.py
print >>sys.stderr, '\n
sys.stderr.write('\n
def makeSuite(folder, exclude=[],nonImportable=[]): "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] if modname not in exclude: try: module = ...
525c865aaca24c538bfd1f595572a12f917681ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/525c865aaca24c538bfd1f595572a12f917681ee/runAll.py
def _listCellGeom(V,w,s,W=None):
def _listCellGeom(V,w,s,W=None,H=None):
def _listCellGeom(V,w,s,W=None): aW = w-s.leftPadding-s.rightPadding t = 0 w = 0 for v in V: vw, vh = v.wrap(aW, 72000) if W is not None: W.append(vw) w = max(w,vw) t = t + vh + v.getSpaceBefore()+v.getSpaceAfter() return w, t - V[0].getSpaceBefore()-V[-1].getSpaceAfter()
6d688252f8c20ac7342f18cb770cd48a8cc16d36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d688252f8c20ac7342f18cb770cd48a8cc16d36/tables.py
if t in _SeqTypes:
if t in _SeqTypes or isinstance(v,Flowable): if not t in _SeqTypes: v = (v,)
def _calc(self): if hasattr(self,'_width'): return
6d688252f8c20ac7342f18cb770cd48a8cc16d36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d688252f8c20ac7342f18cb770cd48a8cc16d36/tables.py
if t is not _stringtype: v = str(v)
if t is not StringType: v = v is None and '' or str(v)
def _calc(self): if hasattr(self,'_width'): return
6d688252f8c20ac7342f18cb770cd48a8cc16d36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d688252f8c20ac7342f18cb770cd48a8cc16d36/tables.py
t = s.leading*len(v)+s.bottomPadding+s.topPadding
t = s.leading*len(v) t = t+s.bottomPadding+s.topPadding
def _calc(self): if hasattr(self,'_width'): return
6d688252f8c20ac7342f18cb770cd48a8cc16d36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d688252f8c20ac7342f18cb770cd48a8cc16d36/tables.py
if t in _SeqTypes:
if t in _SeqTypes or isinstance(v,Flowable):
def _calc(self): if hasattr(self,'_width'): return
6d688252f8c20ac7342f18cb770cd48a8cc16d36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d688252f8c20ac7342f18cb770cd48a8cc16d36/tables.py
elif t is not _stringtype: v = str(v)
elif t is not StringType: v = v is None and '' or str(v)
def _calc(self): if hasattr(self,'_width'): return
6d688252f8c20ac7342f18cb770cd48a8cc16d36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d688252f8c20ac7342f18cb770cd48a8cc16d36/tables.py
if sr<(n-1) and er>=n:
if sr<n and er>=(n-1):
def _splitRows(self,availHeight): h = 0 n = 0 lim = len(self._rowHeights) while n<lim: hn = h + self._rowHeights[n] if hn>availHeight: break h = hn n = n + 1
6d688252f8c20ac7342f18cb770cd48a8cc16d36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d688252f8c20ac7342f18cb770cd48a8cc16d36/tables.py
if n in _SeqTypes:
if n in _SeqTypes or isinstance(cellval,Flowable): if not n in _SeqTypes: cellval = (cellval,)
def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: self.canv.setFillColor(cellstyle.color) if cur is None or cellstyle.leading != cur.leading or cellstyle.fontname != cur.fontn...
6d688252f8c20ac7342f18cb770cd48a8cc16d36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d688252f8c20ac7342f18cb770cd48a8cc16d36/tables.py
if valign != 'BOTTOM' or just != 'LEFT': W = [] w, h = _listCellGeom(cellval,colwidth,cellstyle,W=W)
W = [] H = [] w, h = _listCellGeom(cellval,colwidth,cellstyle,W=W, H=H) if valign=='TOP': y = rowpos + rowheight - cellstyle.topPadding elif valign=='BOTTOM': y = rowpos+cellstyle.bottomPadding + h
def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: self.canv.setFillColor(cellstyle.color) if cur is None or cellstyle.leading != cur.leading or cellstyle.fontname != cur.fontn...
6d688252f8c20ac7342f18cb770cd48a8cc16d36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d688252f8c20ac7342f18cb770cd48a8cc16d36/tables.py
W = len(cellval)*[0] if valign=='TOP': y = rowpos + rowheight - cellstyle.topPadding+h elif valign=='BOTTOM': y = rowpos+cellstyle.bottomPadding else: y = rowpos+(rowheight+cellstyle.bottomPadding-cellstyle.topPadding-h)/2.0
y = rowpos+(rowheight+cellstyle.bottomPadding-cellstyle.topPadding+h)/2.0
def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: self.canv.setFillColor(cellstyle.color) if cur is None or cellstyle.leading != cur.leading or cellstyle.fontname != cur.fontn...
6d688252f8c20ac7342f18cb770cd48a8cc16d36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d688252f8c20ac7342f18cb770cd48a8cc16d36/tables.py
for v, w in map(None,cellval,W):
for v, w, h in map(None,cellval,W,H):
def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: self.canv.setFillColor(cellstyle.color) if cur is None or cellstyle.leading != cur.leading or cellstyle.fontname != cur.fontn...
6d688252f8c20ac7342f18cb770cd48a8cc16d36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d688252f8c20ac7342f18cb770cd48a8cc16d36/tables.py
else: x = colpos+(colwidth+cellstyle.leftPadding-cellstyle.rightPadding-w)/2.0
elif just in ('CENTRE', 'CENTER'): x = colpos+(colwidth+cellstyle.leftPadding-cellstyle.rightPadding-w)/2.0 else: raise ValueError, 'Invalid justification %s' % just
def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: self.canv.setFillColor(cellstyle.color) if cur is None or cellstyle.leading != cur.leading or cellstyle.fontname != cur.fontn...
6d688252f8c20ac7342f18cb770cd48a8cc16d36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d688252f8c20ac7342f18cb770cd48a8cc16d36/tables.py
if n is _stringtype: val = cellval
if n is StringType: val = cellval
def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: self.canv.setFillColor(cellstyle.color) if cur is None or cellstyle.leading != cur.leading or cellstyle.fontname != cur.fontn...
6d688252f8c20ac7342f18cb770cd48a8cc16d36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d688252f8c20ac7342f18cb770cd48a8cc16d36/tables.py
def test(): from reportlab.lib.units import inch rowheights = (24, 16, 16, 16, 16) rowheights2 = (24, 16, 16, 16, 30) colwidths = (50, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32) data = ( ('', 'Jan', 'Feb', 'Mar','Apr','May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'), ('Mugs', 0, 4, 17, 3, 21, 47, 12, 33, 2,...
6d688252f8c20ac7342f18cb770cd48a8cc16d36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d688252f8c20ac7342f18cb770cd48a8cc16d36/tables.py
t=Table(data,style=[('GRID',(1,1),(-2,-2),1,colors.green),
t=Table(data,style=[ ('GRID',(0,0),(-1,-1),0.5,colors.grey), ('GRID',(1,1),(-2,-2),1,colors.green),
def test(): from reportlab.lib.units import inch rowheights = (24, 16, 16, 16, 16) rowheights2 = (24, 16, 16, 16, 30) colwidths = (50, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32) data = ( ('', 'Jan', 'Feb', 'Mar','Apr','May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'), ('Mugs', 0, 4, 17, 3, 21, 47, 12, 33, 2,...
6d688252f8c20ac7342f18cb770cd48a8cc16d36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d688252f8c20ac7342f18cb770cd48a8cc16d36/tables.py
data= [['A', 'B', 'C', (Paragraph("<b>A paragraph</b>",styleSheet["BodyText"]),), 'D'], ['00', '01', '02', '03', '04'], ['10', '11', '12', '13', '14'],
import os, reportlab.platypus I = Image(os.path.join(os.path.dirname(reportlab.platypus.__file__),'..','demos','pythonpoint','leftlogo.gif')) I.drawHeight = 1.25*inch*I.drawHeight / I.drawWidth I.drawWidth = 1.25*inch I.noImageCaching = 1 P = Paragraph("<para align=center spaceb=3>The <b>ReportLab Left <font color=red>...
def test(): from reportlab.lib.units import inch rowheights = (24, 16, 16, 16, 16) rowheights2 = (24, 16, 16, 16, 30) colwidths = (50, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32) data = ( ('', 'Jan', 'Feb', 'Mar','Apr','May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'), ('Mugs', 0, 4, 17, 3, 21, 47, 12, 33, 2,...
6d688252f8c20ac7342f18cb770cd48a8cc16d36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6d688252f8c20ac7342f18cb770cd48a8cc16d36/tables.py
headerline = string.join(canvas.headerLine, ' \215 ')
headerline = string.join(canvas.headerLine, ' \215 ')
def mainPageFrame(canvas, doc): "The page frame used for all PDF documents." canvas.saveState() pageNumber = canvas.getPageNumber() canvas.line(2*cm, A4[1]-2*cm, A4[0]-2*cm, A4[1]-2*cm) canvas.line(2*cm, 2*cm, A4[0]-2*cm, 2*cm) if pageNumber > 1: canvas.setFont('Times-Roman', 12) canvas.drawString(4 * inch, cm, "%d" ...
d0ba459482027816509931b8917ee5896cba381f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d0ba459482027816509931b8917ee5896cba381f/docpy.py
if f.style.name[:8] == 'Heading0':
if name7 == 'Heading' and not hasattr(self.canv, 'headerLine'): self.canv.headerLine = [] if name8 == 'Heading0':
def afterFlowable(self, flowable): "Takes care of header line, TOC and outline entries." if flowable.__class__.__name__ == 'Paragraph': f = flowable
d0ba459482027816509931b8917ee5896cba381f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d0ba459482027816509931b8917ee5896cba381f/docpy.py
elif f.style.name[:8] == 'Heading1':
elif name8 == 'Heading1':
def afterFlowable(self, flowable): "Takes care of header line, TOC and outline entries." if flowable.__class__.__name__ == 'Paragraph': f = flowable
d0ba459482027816509931b8917ee5896cba381f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d0ba459482027816509931b8917ee5896cba381f/docpy.py
elif f.style.name[:8] == 'Heading2':
elif name8 == 'Heading2':
def afterFlowable(self, flowable): "Takes care of header line, TOC and outline entries." if flowable.__class__.__name__ == 'Paragraph': f = flowable
d0ba459482027816509931b8917ee5896cba381f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d0ba459482027816509931b8917ee5896cba381f/docpy.py
if f.style.name[:7] == 'Heading':
if name7 == 'Heading':
def afterFlowable(self, flowable): "Takes care of header line, TOC and outline entries." if flowable.__class__.__name__ == 'Paragraph': f = flowable
d0ba459482027816509931b8917ee5896cba381f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d0ba459482027816509931b8917ee5896cba381f/docpy.py
lev = int(f.style.name[7:])
def afterFlowable(self, flowable): "Takes care of header line, TOC and outline entries." if flowable.__class__.__name__ == 'Paragraph': f = flowable
d0ba459482027816509931b8917ee5896cba381f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d0ba459482027816509931b8917ee5896cba381f/docpy.py
if lev == 0:
if headLevel == 0:
def afterFlowable(self, flowable): "Takes care of header line, TOC and outline entries." if flowable.__class__.__name__ == 'Paragraph': f = flowable
d0ba459482027816509931b8917ee5896cba381f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d0ba459482027816509931b8917ee5896cba381f/docpy.py
c.addOutlineEntry(title, key, level=lev,
c.addOutlineEntry(title, key, level=headLevel,
def afterFlowable(self, flowable): "Takes care of header line, TOC and outline entries." if flowable.__class__.__name__ == 'Paragraph': f = flowable
d0ba459482027816509931b8917ee5896cba381f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d0ba459482027816509931b8917ee5896cba381f/docpy.py
except:
except ValueError:
def afterFlowable(self, flowable): "Takes care of header line, TOC and outline entries." if flowable.__class__.__name__ == 'Paragraph': f = flowable
d0ba459482027816509931b8917ee5896cba381f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d0ba459482027816509931b8917ee5896cba381f/docpy.py
def afterFlowable(self, flowable): "Takes care of header line, TOC and outline entries." if flowable.__class__.__name__ == 'Paragraph': f = flowable
d0ba459482027816509931b8917ee5896cba381f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d0ba459482027816509931b8917ee5896cba381f/docpy.py
"""
u """
def makeHtmlSection(text, bgcolor='#FFA0FF'): """Create HTML code for a section. This is usually a header for all classes or functions. """ text = htmlescape(expandtabs(text)) result = [] result.append("""<TABLE WIDTH="100\%" BORDER="0">""") result.append("""<TR><TD BGCOLOR="%s" VALIGN="CENTER">""" % bgcolor) result.a...
d0ba459482027816509931b8917ee5896cba381f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d0ba459482027816509931b8917ee5896cba381f/docpy.py
def begin(self):
def begin(self, name='', typ=''):
def begin(self): styleSheet = getSampleStyleSheet() self.h1 = styleSheet['Heading1'] self.h2 = styleSheet['Heading2'] self.h3 = styleSheet['Heading3'] self.code = styleSheet['Code'] self.bt = styleSheet['BodyText'] self.story = [] self.classCompartment = '' self.methodCompartment = []
d0ba459482027816509931b8917ee5896cba381f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d0ba459482027816509931b8917ee5896cba381f/docpy.py
story.append(Paragraph('Imported modules', h2))
story.append(Paragraph('Imported modules', self.makeHeadingStyle(self.indentLevel + 1)))
def beginModule(self, name, doc, imported): story = self.story h1, h2, h3, bt = self.h1, self.h2, self.h3, self.bt styleSheet = getSampleStyleSheet() bt1 = styleSheet['BodyText']
d0ba459482027816509931b8917ee5896cba381f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d0ba459482027816509931b8917ee5896cba381f/docpy.py
story.append(Paragraph(m, bt1))
p = Paragraph('<bullet>\201</bullet> %s' % m, bt1) p.style.bulletIndent = 10 p.style.leftIndent = 18 story.append(p)
def beginModule(self, name, doc, imported): story = self.story h1, h2, h3, bt = self.h1, self.h2, self.h3, self.bt styleSheet = getSampleStyleSheet() bt1 = styleSheet['BodyText']
d0ba459482027816509931b8917ee5896cba381f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d0ba459482027816509931b8917ee5896cba381f/docpy.py
else:
elif abs(width)>1e-7 and abs(height)>=1e-7 and (rowStyle.fillColor is not None or rowStyle.strokeColor is not None):
def makeBars(self): g = Group()
d258e0112c6e73e4fec31709b2067e11df7a222b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d258e0112c6e73e4fec31709b2067e11df7a222b/barcharts.py
r.strokeWidth = rowStyle.strokeWidth
r.strokeWidth = rowStyle.strokeWidth
def makeBars(self): g = Group()
d258e0112c6e73e4fec31709b2067e11df7a222b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d258e0112c6e73e4fec31709b2067e11df7a222b/barcharts.py
"Make sample legend." d = Drawing(200, 100) legend = Legend() legend.alignment = 'right' legend.x = 0 legend.y = 100 legend.dxTextSpace = 5 items = string.split('red green blue yellow pink black white', ' ') items = map(lambda i:(getattr(colors, i), i), items) legend.colorNamePairs = items d.add(legend, 'legend') r...
"Make sample legend." d = Drawing(200, 100) legend = Legend() legend.alignment = 'right' legend.x = 0 legend.y = 100 legend.dxTextSpace = 5 items = string.split('red green blue yellow pink black white', ' ') items = map(lambda i:(getattr(colors, i), i), items) legend.colorNamePairs = items d.add(legend, 'legend') r...
def sample1c(): "Make sample legend." d = Drawing(200, 100) legend = Legend() legend.alignment = 'right' legend.x = 0 legend.y = 100 legend.dxTextSpace = 5 items = string.split('red green blue yellow pink black white', ' ') items = map(lambda i:(getattr(colors, i), i), items) legend.colorNamePairs = items d.add(lege...
dcd9af9d00684cad7fecd011518808867894b24a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/dcd9af9d00684cad7fecd011518808867894b24a/legends.py
valueSteps = AttrMapValue(isListOfNumbers),
valueSteps = AttrMapValue(isListOfNumbersOrNone),
def makeTickLabels(self): g = Group()
f02b07be27e77cea10157abbb94d0a92d726f3f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f02b07be27e77cea10157abbb94d0a92d726f3f8/axes.py
if hasattr(self, 'valueSteps'):
if hasattr(self, 'valueSteps') and self.valueSteps:
def _calcTickmarkPositions(self): """Calculate a list of tick positions on the axis.
f02b07be27e77cea10157abbb94d0a92d726f3f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f02b07be27e77cea10157abbb94d0a92d726f3f8/axes.py
def afterFlowable(self, flowable): "Takes care of header line, TOC and outline entries." if flowable.__class__.__name__ == 'Paragraph': f = flowable
f760f58369f882d86b9c4f874a0989b83e418f95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f760f58369f882d86b9c4f874a0989b83e418f95/graphdocpy.py
if lev == 0:
if lev == 0 or title != 'Functions':
def afterFlowable(self, flowable): "Takes care of header line, TOC and outline entries." if flowable.__class__.__name__ == 'Paragraph': f = flowable
f760f58369f882d86b9c4f874a0989b83e418f95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f760f58369f882d86b9c4f874a0989b83e418f95/graphdocpy.py
c.addOutlineEntry(title, key, level=lev, closed=isClosed)
c.addOutlineEntry(title, key, level=lev, closed=isClosed) c.showOutline()
def afterFlowable(self, flowable): "Takes care of header line, TOC and outline entries." if flowable.__class__.__name__ == 'Paragraph': f = flowable
f760f58369f882d86b9c4f874a0989b83e418f95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f760f58369f882d86b9c4f874a0989b83e418f95/graphdocpy.py
def beginClass(self, name, doc, bases): "Append a graphic demo of a widget at the end of a class." aClass = eval('self.skeleton.moduleSpace.' + name) if issubclass(aClass, Widget): if self.shouldDisplayModule: modName, modDoc, imported = self.shouldDisplayModule self.story.append(Paragraph(modName, self.makeHeadingSty...
f760f58369f882d86b9c4f874a0989b83e418f95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f760f58369f882d86b9c4f874a0989b83e418f95/graphdocpy.py
def _showWidgetDemo(self, widget): """Show a graphical demo of the widget."""
f760f58369f882d86b9c4f874a0989b83e418f95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f760f58369f882d86b9c4f874a0989b83e418f95/graphdocpy.py
widget.verify()
def _showWidgetDemo(self, widget): """Show a graphical demo of the widget."""
f760f58369f882d86b9c4f874a0989b83e418f95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f760f58369f882d86b9c4f874a0989b83e418f95/graphdocpy.py
dept = self.EPS_info[0], company = self.EPS_info[1], preview = self.preview, showBorder=self.showBorder)
dept = getattr(self,'EPS_info',['Testing'])[0], company = getattr(self,'EPS_info',['','ReportLab'])[1], preview = getattr(self,'preview',1), showBorder=getattr(self,'showBorder',0))
def save(self, formats=None, verbose=None, fnRoot=None, outDir=None): "Saves copies of self in desired location and formats" ext = '' outDir = outDir or getattr(self,'outDir','.') if not os.path.isabs(outDir): outDir = os.path.join(os.path.dirname(sys.argv[0]),outDir) if not os.path.isdir(outDir): os.makedirs(outDir) f...
5b38073372627f878dc0f00863aadbb4fa49e973 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/5b38073372627f878dc0f00863aadbb4fa49e973/shapes.py
text = join(lines[i][1])
text = join(tx.lines[i][1])
def _do_under_lines(i, t_off, tx): y = tx.XtraState.cur_y - i*tx.XtraState.style.leading - tx.XtraState.f.fontSize/8.0 # 8.0 factor copied from para.py text = join(lines[i][1]) textlen = tx._canvas.stringWidth(text, tx._fontname, tx._fontsize) tx._canvas.line(t_off, y, t_off+textlen, y)
05006eb70065415d261e84f00ba1d2566c88a75c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/05006eb70065415d261e84f00ba1d2566c88a75c/paragraph.py
def polarToRect(self, r, theta): "Convert to rectangular based on current size" return (self._centerx + r * sin(theta),self._centery + r * cos(theta))
def polarToRect(self, r, theta): "Convert to rectangular based on current size" return (self._centerx + r * sin(theta),self._centery + r * cos(theta))
7560fdfa0895186c8f0183a636ad5504edbdd459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7560fdfa0895186c8f0183a636ad5504edbdd459/spider.py
self._centerx = centerx = self.x + xradius self._centery = centery = self.y + yradius
centerx = self.x + xradius centery = self.y + yradius
def draw(self): # normalize slice data g = self.makeBackground() or Group()
7560fdfa0895186c8f0183a636ad5504edbdd459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7560fdfa0895186c8f0183a636ad5504edbdd459/spider.py
n = len(self.data[0]) angleBetween = (2 * pi)/n angles = [] a = (self.startAngle * pi / 180) for i in range(n): angles.append(a) a = a + angleBetween if self.direction == "anticlockwise": whichWay = 1 else: whichWay = -1
n = len(data[0])
def draw(self): # normalize slice data g = self.makeBackground() or Group()
7560fdfa0895186c8f0183a636ad5504edbdd459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7560fdfa0895186c8f0183a636ad5504edbdd459/spider.py
i = 0 startAngle = self.startAngle
def draw(self): # normalize slice data g = self.makeBackground() or Group()
7560fdfa0895186c8f0183a636ad5504edbdd459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7560fdfa0895186c8f0183a636ad5504edbdd459/spider.py
for angle in angles: sa = sin(angle)*radius ca = cos(angle)*radius spoke = Line(centerx, centery, centerx + ca, centery + sa, strokeWidth = 0.5)
csa = [] angle = self.startAngle*pi/180 direction = self.direction == "clockwise" and -1 or 1 angleBetween = direction*(2 * pi)/n for i in xrange(n): car = cos(angle)*radius sar = sin(angle)*radius csa.append((car,sar,angle)) spoke = Line(centerx, centery, centerx + car, centery + sar, strokeWidth = 0.5)
def draw(self): # normalize slice data g = self.makeBackground() or Group()
7560fdfa0895186c8f0183a636ad5504edbdd459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7560fdfa0895186c8f0183a636ad5504edbdd459/spider.py
ex = centerx + labelRadius*ca ey = centery + labelRadius*sa
ex = centerx + labelRadius*car ey = centery + labelRadius*sar
def draw(self): # normalize slice data g = self.makeBackground() or Group()
7560fdfa0895186c8f0183a636ad5504edbdd459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7560fdfa0895186c8f0183a636ad5504edbdd459/spider.py
i = i + 1
angle = angle + angleBetween
def draw(self): # normalize slice data g = self.makeBackground() or Group()
7560fdfa0895186c8f0183a636ad5504edbdd459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7560fdfa0895186c8f0183a636ad5504edbdd459/spider.py
theta = angles[-1]
car, sar = csa[-1][:2]
def draw(self): # normalize slice data g = self.makeBackground() or Group()
7560fdfa0895186c8f0183a636ad5504edbdd459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7560fdfa0895186c8f0183a636ad5504edbdd459/spider.py
x0, y0 = self.polarToRect(r*radius, theta) points.append(x0) points.append(y0) for i in range(n): theta = angles[i]
points.append(centerx+car*r) points.append(centery+sar*r) for i in xrange(n): car, sar = csa[i][:2]
def draw(self): # normalize slice data g = self.makeBackground() or Group()
7560fdfa0895186c8f0183a636ad5504edbdd459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7560fdfa0895186c8f0183a636ad5504edbdd459/spider.py
x1, y1 = self.polarToRect(r*radius, theta) x0, y0 = x1, y1 points.append(x0) points.append(y0)
points.append(centerx+car*r) points.append(centery+sar*r)
def draw(self): # normalize slice data g = self.makeBackground() or Group()
7560fdfa0895186c8f0183a636ad5504edbdd459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7560fdfa0895186c8f0183a636ad5504edbdd459/spider.py
thisy = upperlefty = self.y - self.dx
thisy = upperlefty = self.y - self.dy
def draw(self): g = Group() colorNamePairs = self.colorNamePairs thisx = upperleftx = self.x thisy = upperlefty = self.y - self.dx dx, dy = self.dx, self.dy
d34ac22a27860fb0b1876030228683e7da0cb476 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d34ac22a27860fb0b1876030228683e7da0cb476/legends.py
G.add(Polygon(_ystrip_poly(x[0], x[1], y.y0, y.y1, xdepth, ydepth),
print 'Poly([%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f])'% tuple(_ystrip_poly(x[0], x[1], y.y0, y.y1, xdepth, -ydepth)) G.add(Polygon(_ystrip_poly(x[0], x[1], y.y0, y.y1, xdepth, -ydepth),
def F(x,i, slope=slope, y0=y0): return float((x-x0)*slope[i]+y0[i])
cf1d260e6e6e62494630abc50f1c00859d13ee7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/cf1d260e6e6e62494630abc50f1c00859d13ee7e/utils3d.py
if x is X[0]: G.add(Line(x[0], y.y1, x[0]+xdepth, y.y1+ydepth,strokeColor=c,strokeWidth=0.6*xdelta))
def F(x,i, slope=slope, y0=y0): return float((x-x0)*slope[i]+y0[i])
cf1d260e6e6e62494630abc50f1c00859d13ee7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/cf1d260e6e6e62494630abc50f1c00859d13ee7e/utils3d.py
return cmp(_rl_accel_dir_info(b),__rl_accel_dir_info(a))
return cmp(_rl_accel_dir_info(b),_rl_accel_dir_info(a))
def _cmp_rl_accel_dirs(a,b): return cmp(_rl_accel_dir_info(b),__rl_accel_dir_info(a))
51ebc39da3d313de76d2c9beda5f348d71f3dde0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/51ebc39da3d313de76d2c9beda5f348d71f3dde0/setup.py
text = escape(opcode) code.append('(%s) Tj' % text)
textobject.textOut(opcode)
def runOpCodes(self, program, canvas, textobject): "render the line(s)"
89cf707471f7b823e5e45312d8df8859c08a9762 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/89cf707471f7b823e5e45312d8df8859c08a9762/para.py
text = escape(text) code.append('(%s) Tj' % text)
textobject.textOut(text)
def draw(self): style = self.style lines = self.lines rightIndent = style.rightIndent leftIndent = style.leftIndent leading = style.leading font = style.fontName size = style.fontSize alignment = style.alignment firstindent = style.firstLineIndent c = self.canv escape = c._escape #if debug: # print "FAST", id(self),...
89cf707471f7b823e5e45312d8df8859c08a9762 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/89cf707471f7b823e5e45312d8df8859c08a9762/para.py
from paraparser import greeks, symenc
from paraparser import greeks
def handleSpecialCharacters(engine, text, program=None): from paraparser import greeks, symenc from string import whitespace, atoi, atoi_error standard={'lt':'<', 'gt':'>', 'amp':'&'} # add space prefix if space here if text[0:1] in whitespace: program.append(" ") #print "handling", repr(text) # shortcut if 0 and "&" n...
89cf707471f7b823e5e45312d8df8859c08a9762 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/89cf707471f7b823e5e45312d8df8859c08a9762/para.py
if 0<=n<=255: fragment = chr(n)+fragment[semi+1:] elif symenc.has_key(n): fragment = fragment[semi+1:] (f,b,i) = engine.shiftfont(program, face="symbol") program.append(symenc[n]) engine.shiftfont(program, face=f) if fragment and fragment[0] in whitespace: program.append(" ")
if n>=0: fragment = unichr(n).encode('utf8')+fragment[semi+1:]
def handleSpecialCharacters(engine, text, program=None): from paraparser import greeks, symenc from string import whitespace, atoi, atoi_error standard={'lt':'<', 'gt':'>', 'amp':'&'} # add space prefix if space here if text[0:1] in whitespace: program.append(" ") #print "handling", repr(text) # shortcut if 0 and "&" n...
89cf707471f7b823e5e45312d8df8859c08a9762 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/89cf707471f7b823e5e45312d8df8859c08a9762/para.py
fragment = fragment[semi+1:] greeksub = greeks[name] (f,b,i) = engine.shiftfont(program, face="symbol") program.append(greeksub) engine.shiftfont(program, face=f) if fragment and fragment[0] in whitespace: program.append(" ")
fragment = greeks[name]+fragment[semi+1:]
def handleSpecialCharacters(engine, text, program=None): from paraparser import greeks, symenc from string import whitespace, atoi, atoi_error standard={'lt':'<', 'gt':'>', 'amp':'&'} # add space prefix if space here if text[0:1] in whitespace: program.append(" ") #print "handling", repr(text) # shortcut if 0 and "&" n...
89cf707471f7b823e5e45312d8df8859c08a9762 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/89cf707471f7b823e5e45312d8df8859c08a9762/para.py
justified text paragraph example
justified text paragraph example with a pound sign \xc2\xa3
def splitspace(text): # split on spacing but include spaces at element ends stext = text.split() result = [] for e in stext: result.append(e+" ") return result
89cf707471f7b823e5e45312d8df8859c08a9762 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/89cf707471f7b823e5e45312d8df8859c08a9762/para.py
pagesize=(595.27,841.89),
pagesize=None,
def __init__(self,filename, pagesize=(595.27,841.89), bottomup = 1, pageCompression=None, encoding=rl_config.defaultEncoding, invariant=rl_config.invariant, verbosity=0): """Create a canvas of a given size. etc. Most of the attributes are private - we will use set/get methods as the preferred interface. Default page s...
0dfc32eaeaff74aae5d82442e8308a1c0f42c955 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0dfc32eaeaff74aae5d82442e8308a1c0f42c955/canvas.py
encoding=rl_config.defaultEncoding, invariant=rl_config.invariant,
encoding = None, invariant = None,
def __init__(self,filename, pagesize=(595.27,841.89), bottomup = 1, pageCompression=None, encoding=rl_config.defaultEncoding, invariant=rl_config.invariant, verbosity=0): """Create a canvas of a given size. etc. Most of the attributes are private - we will use set/get methods as the preferred interface. Default page s...
0dfc32eaeaff74aae5d82442e8308a1c0f42c955 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0dfc32eaeaff74aae5d82442e8308a1c0f42c955/canvas.py
do_exec(cvs+(' export -r %s reportlab' % tagname), 'the export phase')
do_exec(cvs+(' export -r %s %s' % (tagname,projdir)), 'the export phase')
def cvs_checkout(d): os.chdir(d) recursive_rmdir(cvsdir) cvs = find_exe('cvs') 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 -r %s reportlab' % tagname), 'the export phase') else: if py2pdf: do_exec(cvs+' co rep...
b44cd49e99d91cc912ae3ae1309819e6423841a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b44cd49e99d91cc912ae3ae1309819e6423841a9/daily.py
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: os.exit(1) os.environ['CVSROOT']=':pserver:%s@cvs.reportlab.sourceforge.net:/cvsroot/reportlab' % USER if release: do_exec(cvs+(' export -r %s reportlab' % tagname), 'the export phase') else: if py2pdf: do_exec(cvs+' co rep...
b44cd49e99d91cc912ae3ae1309819e6423841a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b44cd49e99d91cc912ae3ae1309819e6423841a9/daily.py
do_exec("mv reportlab %s" % dst)
do_exec("mv %s %s" % (projdir,dst), "moving %s to %s" %(projdir,py2pdf_dir))
def cvs_checkout(d): os.chdir(d) recursive_rmdir(cvsdir) cvs = find_exe('cvs') 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 -r %s reportlab' % tagname), 'the export phase') else: if py2pdf: do_exec(cvs+' co rep...
b44cd49e99d91cc912ae3ae1309819e6423841a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b44cd49e99d91cc912ae3ae1309819e6423841a9/daily.py
else: 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: os.exit(1) os.environ['CVSROOT']=':pserver:%s@cvs.reportlab.sourceforge.net:/cvsroot/reportlab' % USER if release: do_exec(cvs+(' export -r %s reportlab' % tagname), 'the export phase') else: if py2pdf: do_exec(cvs+' co rep...
b44cd49e99d91cc912ae3ae1309819e6423841a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b44cd49e99d91cc912ae3ae1309819e6423841a9/daily.py
This document is both the user guide and the output of the test script.
This document is both the user guide &amp; the output of the test script.
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...
eeeb9fd41a3015f142728d4cf5dd8885d32e502b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/eeeb9fd41a3015f142728d4cf5dd8885d32e502b/test_platypus_general.py
unittest.TextTestRunner().run(makeSuite)
unittest.TextTestRunner().run(makeSuite())
def makeSuite(): return makeSuiteForClasses(PlatypusTestCase)
eeeb9fd41a3015f142728d4cf5dd8885d32e502b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/eeeb9fd41a3015f142728d4cf5dd8885d32e502b/test_platypus_general.py
logger.debug("enter Frame.addFromlist() for frame %s" % self.id)
if self._debug: logger.debug("enter Frame.addFromlist() for frame %s" % self.id)
def addFromList(self, drawlist, canv): """Consumes objects from the front of the list until the frame is full. If it cannot fit one object, raises an exception."""
a78519cff3ac9dc2304b952d2d663145562644fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a78519cff3ac9dc2304b952d2d663145562644fe/frames.py
def drawOn(self, canv): if self.effectName: canv.setPageTransition( effectname=self.effectName, direction = self.effectDirection, dimension = self.effectDimension, motion = self.effectMotion, duration = self.effectDuration ) if self.outlineEntry: #gets an outline automatically self.showOutline = 1 #put an outline entry...
37a58cf6954c324d178af4eb2aaa2b76093473fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/37a58cf6954c324d178af4eb2aaa2b76093473fa/pythonpoint.py
def parseData(self): """Try to make sense of the table data!""" rawdata = string.strip(string.join(self.rawBlocks, '')) lines = string.split(rawdata, self.rowDelim) #clean up... lines = map(string.strip, lines) self.data = [] for line in lines: cells = string.split(line, self.fieldDelim) self.data.append(cells)
37a58cf6954c324d178af4eb2aaa2b76093473fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/37a58cf6954c324d178af4eb2aaa2b76093473fa/pythonpoint.py
if self.filename: canv.drawInlineImage( self.filename, self.x, self.y, self.width, self.height )
filename = self.filename if filename: internalname = canv._doc.hasForm(filename) if not internalname: canv.beginForm(filename) canv.saveState() x, y = self.x, self.y w, h = self.width, self.height canv.drawInlineImage(filename, x, y, w, h) canv.restoreState() canv.endForm() canv.doForm(filename) else: canv.doForm(filen...
def drawOn(self, canv): if self.filename: canv.drawInlineImage( self.filename, self.x, self.y, self.width, self.height )
37a58cf6954c324d178af4eb2aaa2b76093473fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/37a58cf6954c324d178af4eb2aaa2b76093473fa/pythonpoint.py
def __init__(self, x1, y1, x2, y2): self.x1 = x1 self.y1 = y1 self.x2 = x2 self.y2 = y2 self.fillColor = None self.strokeColor = (1,1,1) self.lineWidth=0
37a58cf6954c324d178af4eb2aaa2b76093473fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/37a58cf6954c324d178af4eb2aaa2b76093473fa/pythonpoint.py
def __init__(self, x1, y1, x2, y2): self.x1 = x1 self.y1 = y1 self.x2 = x2 self.y2 = y2 self.fillColor = None self.strokeColor = (1,1,1) self.lineWidth=0
37a58cf6954c324d178af4eb2aaa2b76093473fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/37a58cf6954c324d178af4eb2aaa2b76093473fa/pythonpoint.py
def __init__(self, pointlist): self.points = pointlist self.fillColor = None self.strokeColor = (1,1,1) self.lineWidth=0
37a58cf6954c324d178af4eb2aaa2b76093473fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/37a58cf6954c324d178af4eb2aaa2b76093473fa/pythonpoint.py
print """PythonPoint - copyright ReportLab Inc. 1999-2000
print """PythonPoint - copyright ReportLab Inc. 1999-2001
def process(datafilename, speakerNotes=0): parser = stdparser.PPMLParser() rawdata = open(datafilename).read() parser.feed(rawdata) pres = parser.getPresentation() pres.speakerNotes = speakerNotes pres.save() print 'saved presentation %s.pdf' % os.path.splitext(datafilename)[0] parser.close()
37a58cf6954c324d178af4eb2aaa2b76093473fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/37a58cf6954c324d178af4eb2aaa2b76093473fa/pythonpoint.py
return type(t) in SeqTypes
return type(v) in SeqTypes
def isSeqType(v): return type(t) in SeqTypes
09c05ef6c374a9918dca633cc3cfde05bbd0babf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/09c05ef6c374a9918dca633cc3cfde05bbd0babf/utils.py
print find_intersections([[(0,0.5),(1,0.5),(0.5,0),(0.5,1)],[(2666666667,0.4),(0.1,0.4),(0.1,0.2),(0,0),(1,1)],[(0,1),(0.4,0.1),(1,0.1)]])
print find_intersections([[(0,0.5),(1,0.5),(0.5,0),(0.5,1)],[(.2666666667,0.4),(0.1,0.4),(0.1,0.2),(0,0),(1,1)],[(0,1),(0.4,0.1),(1,0.1)]])
def find_intersections(data,small=0): ''' data is a sequence of series each series is a list of (x,y) coordinates where x & y are ints or floats find_intersections returns a sequence of 4-tuples i, j, x, y where i is a data index j is an insertion position for data[i] and x, y are coordinates of an intersection of se...
0992e0cec07925841eb0fc4c23981740c85d52b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0992e0cec07925841eb0fc4c23981740c85d52b7/utils3d.py
f = self.labelTextFormat and self._allIntTicks() and '%d' or str
f = self.labelTextFormat or (self._allIntTicks() and '%d' or str)
def makeTickLabels(self): g = Group()
c4a20834e65ae1e01472a47ce79888fd77bee387 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c4a20834e65ae1e01472a47ce79888fd77bee387/axes.py
if self.bottomup: self._preamble = '1 0 0 1 0 0 cm BT /F9 12 Tf 14.4 TL ET' else: self._preamble = '1 0 0 -1 0 %0.2f cm BT /F9 12 Tf 14.4 TL ET' % self._pagesize[1]
self._make_preamble()
def __init__(self,filename,pagesize=(595.27,841.89), bottomup = 1, pageCompression=0 ): """Most of the attributes are private - we will use set/get methods as the preferred interface. Default page size is A4.""" self._filename = filename self._doc = pdfdoc.PDFDocument() self._pagesize = pagesize self._currentPageHasIm...
c0956523058c8076c72d8def32a7c2d5841b1743 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c0956523058c8076c72d8def32a7c2d5841b1743/canvas.py
txt = open(filename, 'r').read()
txt = open_and_read(filename, 'r')
def checkFileForTabs(self, filename): txt = open(filename, 'r').read() chunks = string.split(txt, '\t') tabCount = len(chunks) - 1 if tabCount: #raise Exception, "File %s contains %d tab characters!" % (filename, tabCount) self.output.write("file %s contains %d tab characters!\n" % (filename, tabCount))
f709459e51a2085fda6903cbd288add39f9707e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f709459e51a2085fda6903cbd288add39f9707e6/test_source_chars.py
txt = open(filename, 'r').read()
txt = open_and_read(filename, 'r')
def checkFileForTrailingSpaces(self, filename): txt = open(filename, 'r').read() initSize = len(txt) badLines = 0 badChars = 0 for line in string.split(txt, '\n'): stripped = string.rstrip(line) spaces = len(line) - len(stripped) # OK, so they might be trailing tabs, who cares? if spaces: badLines = badLines + 1 badCh...
f709459e51a2085fda6903cbd288add39f9707e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f709459e51a2085fda6903cbd288add39f9707e6/test_source_chars.py