rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
y = rowpos + cellstyle.bottomPadding+n*leading
y = rowpos + cellstyle.bottomPadding+n*leading-fontsize
def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): #print "cellstyle is ", repr(cellstyle), id(cellstyle) if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: #print "setting cell color to %s" % `cellstyle.color` self.canv.setFil...
05bfe223624d1df66401c7f78a6ac81f78006d39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/05bfe223624d1df66401c7f78a6ac81f78006d39/tables.py
y = rowpos + rowheight - cellstyle.topPadding - cellstyle.fontsize
y = rowpos + rowheight - cellstyle.topPadding - fontsize
def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): #print "cellstyle is ", repr(cellstyle), id(cellstyle) if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: #print "setting cell color to %s" % `cellstyle.color` self.canv.setFil...
05bfe223624d1df66401c7f78a6ac81f78006d39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/05bfe223624d1df66401c7f78a6ac81f78006d39/tables.py
y = rowpos + (cellstyle.bottomPadding + rowheight - cellstyle.topPadding+n*leading)/2.0
y = rowpos + (cellstyle.bottomPadding + rowheight-cellstyle.topPadding+(n-1)*leading)/2.0+leading-fontsize
def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): #print "cellstyle is ", repr(cellstyle), id(cellstyle) if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: #print "setting cell color to %s" % `cellstyle.color` self.canv.setFil...
05bfe223624d1df66401c7f78a6ac81f78006d39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/05bfe223624d1df66401c7f78a6ac81f78006d39/tables.py
'GRID', 'BOX', 'OUTLINE', 'INNERGRID', 'LINEBELOW', 'LINEABOVE', 'LINEBEFORE', 'LINEAFTER', )
'GRID', 'BOX', 'OUTLINE', 'INNERGRID', 'BOXGRID', 'LINEBELOW', 'LINEABOVE', 'LINEBEFORE', 'LINEAFTER', )
def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): #print "cellstyle is ", repr(cellstyle), id(cellstyle) if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: #print "setting cell color to %s" % `cellstyle.color` self.canv.setFil...
05bfe223624d1df66401c7f78a6ac81f78006d39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/05bfe223624d1df66401c7f78a6ac81f78006d39/tables.py
new.fontsize = values[1]
if n>1: new.fontsize = values[1] if n>2: new.leading = values[2] elif op in ('FONTNAME', 'FACE'): new.fontname = values[0] elif op in ('SIZE', 'FONTSIZE'): new.fontsize = values[0] elif op == 'LEADING': new.leading = values[0]
def _setCellStyle(cellStyles, i, j, op, values): new = CellStyle('<%d, %d>' % (i,j), cellStyles[i][j]) cellStyles[i][j] = new if op == 'FONT': new.fontname = values[0] new.fontsize = values[1] elif op == 'TEXTCOLOR': new.color = colors.toColor(values[0], colors.Color(0,0,0)) elif op in ('ALIGN', 'ALIGNMENT'): new.align...
05bfe223624d1df66401c7f78a6ac81f78006d39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/05bfe223624d1df66401c7f78a6ac81f78006d39/tables.py
data= [['X00y', 'X01y', 'X02y', 'X03y', 'X04y'],
XY = [['X00y', 'X01y', 'X02y', 'X03y', 'X04y'],
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,...
05bfe223624d1df66401c7f78a6ac81f78006d39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/05bfe223624d1df66401c7f78a6ac81f78006d39/tables.py
t=Table(data, 5*[0.4*inch], 4*[0.4*inch])
t=Table(XY, 5*[0.6*inch], 4*[0.6*inch])
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,...
05bfe223624d1df66401c7f78a6ac81f78006d39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/05bfe223624d1df66401c7f78a6ac81f78006d39/tables.py
exec l
exec l.strip()
def get_version(): #determine Version if __name__=='__main__': HERE=os.path.dirname(sys.argv[0]) else: HERE=os.path.dirname(__file__) #first try source FN = pjoin(HERE,'__init__') try: for l in open(pjoin(FN+'.py'),'r').readlines(): if l.startswith('Version'): exec l return Version except: pass #don't have source, tr...
a482c58cb8390df2edbbbf27c553ce7458a23016 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a482c58cb8390df2edbbbf27c553ce7458a23016/setup.py
if path=='None': path = [] if (isinstance (path, str)): path = [path]
if path=='None': path = [] if type(path) not in SeqTypes: path = [path]
def start_stylesheet(self, args): #makes it the current style sheet. path = self._arg('stylesheet',args,'path') if path=='None': path = [] if (isinstance (path, str)): path = [path] path.append('styles') path.append(os.getcwd()) modulename = self._arg('stylesheet', args, 'module') funcname = self._arg('stylesheet', arg...
fb695223da6edd6cfa5b2f5fbbf090bf46c38f49 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/fb695223da6edd6cfa5b2f5fbbf090bf46c38f49/stdparser.py
platypus.Image('file://'+gif.replace('\\','/'))])
platypus.Image(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)
2268c5c7ad194035cb61402c9f8b7a32bc1035c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2268c5c7ad194035cb61402c9f8b7a32bc1035c8/test_platypus_general.py
if sys.platform=='win32': S = ['c:\\Program Files\\Adobe\\Acrobat 4.0\\Resource\\Font'] elif sys.platform in ('linux2','freebsd4',): S = ['/usr/lib/Acrobat4/Resource/Font'] elif sys.platform=='mac': diskName = string.split(os.getcwd(), ':')[0] fontDir = diskName + ':Applications:Python %s:reportlab:fonts' % sys_version...
import reportlab D = {'REPORTLAB_DIR': os.path.dirname(reportlab.__file__), 'disk': string.split(os.getcwd(), ':')[0], 'sys_version': sys_version, }
def _setOpt(name, value, conv=None): '''set a module level value from environ/default''' from os import environ ename = 'RL_'+name if environ.has_key(ename): value = environ[ename] if conv: value = conv(value) globals()[name] = value
4eab5ff078e87c4c118f06540f8181f05ce375c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/4eab5ff078e87c4c118f06540f8181f05ce375c5/rl_config.py
for p in S: if os.path.isdir(p): P.append(p)
for p in T1SearchPath: d = apply(os.path.join,string.split(p % D,'/')) if os.path.isdir(d): P.append(d)
def _setOpt(name, value, conv=None): '''set a module level value from environ/default''' from os import environ ename = 'RL_'+name if environ.has_key(ename): value = environ[ename] if conv: value = conv(value) globals()[name] = value
4eab5ff078e87c4c118f06540f8181f05ce375c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/4eab5ff078e87c4c118f06540f8181f05ce375c5/rl_config.py
if type(cap) is not type(int):
if not isinstance(cap,int):
def _addCommand(self,cmd): if cmd[0] in ('BACKGROUND','ROWBACKGROUNDS','COLBACKGROUNDS'): self._bkgrndcmds.append(cmd) elif cmd[0] == 'SPAN': self._spanCmds.append(cmd) elif _isLineCommand(cmd): # we expect op, start, stop, weight, colour, cap, dashes, join cmd = tuple(cmd) if len(cmd)<5: raise ValueError('bad line com...
255ca0769f581869e21f0653db9d81fb66048941 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/255ca0769f581869e21f0653db9d81fb66048941/tables.py
ValueError('Bad cap value %s in %s'%(cap,str(cmd)))
raise ValueError('Bad cap value %s in %s'%(cap,str(cmd)))
def _addCommand(self,cmd): if cmd[0] in ('BACKGROUND','ROWBACKGROUNDS','COLBACKGROUNDS'): self._bkgrndcmds.append(cmd) elif cmd[0] == 'SPAN': self._spanCmds.append(cmd) elif _isLineCommand(cmd): # we expect op, start, stop, weight, colour, cap, dashes, join cmd = tuple(cmd) if len(cmd)<5: raise ValueError('bad line com...
255ca0769f581869e21f0653db9d81fb66048941 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/255ca0769f581869e21f0653db9d81fb66048941/tables.py
if len(cmd)<7: cmd = cmd+(None,)
if len(cmd)<7: cmd += (None,)
def _addCommand(self,cmd): if cmd[0] in ('BACKGROUND','ROWBACKGROUNDS','COLBACKGROUNDS'): self._bkgrndcmds.append(cmd) elif cmd[0] == 'SPAN': self._spanCmds.append(cmd) elif _isLineCommand(cmd): # we expect op, start, stop, weight, colour, cap, dashes, join cmd = tuple(cmd) if len(cmd)<5: raise ValueError('bad line com...
255ca0769f581869e21f0653db9d81fb66048941 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/255ca0769f581869e21f0653db9d81fb66048941/tables.py
if type(join) is not type(int):
if not isinstance(join,int):
def _addCommand(self,cmd): if cmd[0] in ('BACKGROUND','ROWBACKGROUNDS','COLBACKGROUNDS'): self._bkgrndcmds.append(cmd) elif cmd[0] == 'SPAN': self._spanCmds.append(cmd) elif _isLineCommand(cmd): # we expect op, start, stop, weight, colour, cap, dashes, join cmd = tuple(cmd) if len(cmd)<5: raise ValueError('bad line com...
255ca0769f581869e21f0653db9d81fb66048941 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/255ca0769f581869e21f0653db9d81fb66048941/tables.py
cmd = cmd + (lineCount,)
cmd += (lineCount,)
def _addCommand(self,cmd): if cmd[0] in ('BACKGROUND','ROWBACKGROUNDS','COLBACKGROUNDS'): self._bkgrndcmds.append(cmd) elif cmd[0] == 'SPAN': self._spanCmds.append(cmd) elif _isLineCommand(cmd): # we expect op, start, stop, weight, colour, cap, dashes, join cmd = tuple(cmd) if len(cmd)<5: raise ValueError('bad line com...
255ca0769f581869e21f0653db9d81fb66048941 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/255ca0769f581869e21f0653db9d81fb66048941/tables.py
if maxx>400 or maxyy>200: _,_,D = drawit(F,maxx,maxy)
if maxx>400 or maxy>200: _,_,D = drawit(F,maxx,maxy)
def drawit(F,w=400,h=200,fontSize=12,slack=2,gap=5): D = Drawing(w,h) th = 2*gap + fontSize*1.2 gh = gap + .2*fontSize y = h maxx = 0 for fontName in F: y -= th text = fontName+": I should be totally horizontal and enclosed in a box" textWidth = stringWidth(text, fontName, fontSize) maxx = max(maxx,textWidth+20) D.add(...
ffd6c439cc73c4d1b74b2cef92c3f17e52fa1fed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ffd6c439cc73c4d1b74b2cef92c3f17e52fa1fed/renderPM.py
do_exec(cvs+(' rtag %s' % release), 'the tag phase')
def cvs_checkout(d): os.chdir(d) recursive_rmdir(cvsdir) cvs = find_exe('cvs') if cvs is None: print "Can't find cvs anywhere on the path" os.exit(1) if release: print release os.environ['CVSROOT']=':ext:%s@cvs1:/cvsroot/reportlab' % USER #do_exec(cvs+(' rtag %s' % release), 'the tag phase') do_exec(cvs+(' co -r %s r...
94e1adbcb01afd92e6b1384bad8547579bd09de0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/94e1adbcb01afd92e6b1384bad8547579bd09de0/daily.py
self._x = x self._y = y self._x0 = x
self._x0 = self._x = x self._y0 = self._y = y
def setTextOrigin(self, x, y): if self._canvas.bottomup: self._code.append('1 0 0 1 %s Tm' % fp_str(x, y)) #bottom up else: self._code.append('1 0 0 -1 %s Tm' % fp_str(x, y)) #top down self._x = x self._y = y self._x0 = x #the margin
c8807bcce56d0da528e6e56ed9baa7e7f4382f44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c8807bcce56d0da528e6e56ed9baa7e7f4382f44/textobject.py
self._x = e self._y = f
self._x0 = self._x = e self._y0 = self._y = f
def setTextTransform(self, a, b, c, d, e, f): "Like setTextOrigin, but does rotation, scaling etc." if not self._canvas.bottomup: c = -c #reverse bottom row of the 2D Transform d = -d self._code.append('%s Tm' % fp_str(a, b, c, d, e, f)) #we only measure coords relative to present text matrix self._x = e self._y = f
c8807bcce56d0da528e6e56ed9baa7e7f4382f44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c8807bcce56d0da528e6e56ed9baa7e7f4382f44/textobject.py
"""Moves to a point dx, dy away from the start of the current line - NOT from the current point! So if you call it in mid-sentence, watch out."""
"""Starts a new line at an offset dx,dy from the start of the current line. This does not move the cursor relative to the current position, and it changes the current offset of every future line drawn (i.e. if you next do a textLine() call, it will move the cursor to a position one line lower than the position specifi...
def moveCursor(self, dx, dy): """Moves to a point dx, dy away from the start of the current line - NOT from the current point! So if you call it in mid-sentence, watch out.""" if self._code and self._code[-1][-3:]==' Td': L = string.split(self._code[-1]) if len(L)==3: del self._code[-1] else: self._code[-1] = string.jo...
c8807bcce56d0da528e6e56ed9baa7e7f4382f44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c8807bcce56d0da528e6e56ed9baa7e7f4382f44/textobject.py
dx = dx + float(L[-3]) dy = dy - float(L[-2])
lastDx = float(L[-3]) lastDy = float(L[-2]) dx += lastDx dy -= lastDy self._x0 -= lastDx self._y0 -= lastDy
def moveCursor(self, dx, dy): """Moves to a point dx, dy away from the start of the current line - NOT from the current point! So if you call it in mid-sentence, watch out.""" if self._code and self._code[-1][-3:]==' Td': L = string.split(self._code[-1]) if len(L)==3: del self._code[-1] else: self._code[-1] = string.jo...
c8807bcce56d0da528e6e56ed9baa7e7f4382f44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c8807bcce56d0da528e6e56ed9baa7e7f4382f44/textobject.py
"""Moves to a point dx away from the start of the
"""Starts a new line dx away from the start of the
def setXPos(self, dx): """Moves to a point dx away from the start of the current line - NOT from the current point! So if you call it in mid-sentence, watch out.""" self.moveCursor(dx,0)
c8807bcce56d0da528e6e56ed9baa7e7f4382f44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c8807bcce56d0da528e6e56ed9baa7e7f4382f44/textobject.py
self._code.append('%s T*' % self._formatText(line)) if self._canvas.bottomup: self._y = self._y - self._leading else: self._y = self._y + self._leading self._x = self._x0
self.textLine(line)
def textLines(self, stuff, trim=1): """prints multi-line or newlined strings, moving down. One comon use is to quote a multi-line block in your Python code; since this may be indented, by default it trims whitespace off each line and from the beginning; set trim=0 to preserve whitespace.""" if type(stuff) == StringTyp...
c8807bcce56d0da528e6e56ed9baa7e7f4382f44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c8807bcce56d0da528e6e56ed9baa7e7f4382f44/textobject.py
if sys.platform in ('linux2',) and ext='.pfb': ext = ''
if sys.platform in ('linux2',) and ext=='.pfb': ext = ''
def findT1File(fontName,ext='.pfb'): from reportlab.rl_config import T1SearchPath assert T1SearchPath!=[], "No Type-1 font search path" if sys.platform in ('linux2',) and ext='.pfb': ext = '' n = _findFNR(fontName)+ext for d in T1SearchPath: f = os.path.join(d,n) if os.path.isfile(f): return f return None
86c144f547aa52f5fce5ffe512be07f17692600b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/86c144f547aa52f5fce5ffe512be07f17692600b/_fontdata.py
direction = AttrMapValue( OneOf('clockwise', 'anticlockwise'), desc="'clockwise' or 'anticlockwise'"),
direction = AttrMapValue(OneOf('clockwise', 'anticlockwise'), desc="'clockwise' or 'anticlockwise'"),
def __init__(self): self.strokeWidth = 0 self.fillColor = None self.strokeColor = STATE_DEFAULTS["strokeColor"] self.strokeDashArray = STATE_DEFAULTS["strokeDashArray"] self.popout = 0 self.fontName = STATE_DEFAULTS["fontName"] self.fontSize = STATE_DEFAULTS["fontSize"] self.fontColor = STATE_DEFAULTS["fillColor"] self...
b438bde47b2309e20663aa3f63d5d6100ed6cbed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b438bde47b2309e20663aa3f63d5d6100ed6cbed/doughnut.py
theSector = Wedge(cx, cy, xradius, a1, a2, yradius=yradius, iradius=iradius)
theSector = Wedge(cx, cy, xradius, a1, a2, yradius=yradius, radius1=iradius)
def makeSectors(self): # normalize slice data if type(self.data) in (ListType, TupleType) and type(self.data[0]) in (ListType, TupleType): #it's a nested list, more than one sequence normData = [] for l in self.data: t = self.normalizeData(l) normData.append(t) else: normData = self.normalizeData(self.data) n = len(nor...
b438bde47b2309e20663aa3f63d5d6100ed6cbed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b438bde47b2309e20663aa3f63d5d6100ed6cbed/doughnut.py
if I and inname not in I: continue
if I and zipname not in I: continue
def buildup_test(cls=test_pyRXPU,I=[]): ''' Add test methods to the TestCase ''' cls.valid = [] cls.invalid = [] cls.notwf = [] testdir = os.path.dirname(__file__) try: zipf = zipfile.ZipFile(os.path.join(testdir,'xmltest.zip')) except: print >> sys.stderr, "Can't locate file xmltest.zip\nPerhaps it should be downloade...
0ce3ff81e6425eca835acd954b2c33a56a879644 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0ce3ff81e6425eca835acd954b2c33a56a879644/test_xmltestsuite.py
if type(f)==type(''):
if type(filename)==type(''):
def SaveToFile(self, filename,canvas): """Open a file, and ask each object in turn to write itself to the file. Keep track of the file position at each point for use in the index at the end"""
82bb606c4e39f4d24dcf58f52ac19fcdcdbe9df2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/82bb606c4e39f4d24dcf58f52ac19fcdcdbe9df2/pdfdoc.py
f = filename
f = filename
def SaveToFile(self, filename,canvas): """Open a file, and ask each object in turn to write itself to the file. Keep track of the file position at each point for use in the index at the end"""
82bb606c4e39f4d24dcf58f52ac19fcdcdbe9df2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/82bb606c4e39f4d24dcf58f52ac19fcdcdbe9df2/pdfdoc.py
def Reference(self, object, name=None): ### note references may "grow" during the final formatting pass: don't use d.keys()! # don't make references to other references, or non instances from types import InstanceType #print"object type is ", type(object) tob = type(object) if (tob is not InstanceType) or (tob is Insta...
569507e0d40372288ba9538f94ddbda68231d460 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/569507e0d40372288ba9538f94ddbda68231d460/pdfdoc.py
if (tob is not InstanceType) or (tob is InstanceType and object.__class__ is PDFObjectReference):
idToObject = self.idToObject if name is None and ( (tob is not InstanceType) or (tob is InstanceType and object.__class__ is PDFObjectReference)):
def Reference(self, object, name=None): ### note references may "grow" during the final formatting pass: don't use d.keys()! # don't make references to other references, or non instances from types import InstanceType #print"object type is ", type(object) tob = type(object) if (tob is not InstanceType) or (tob is Insta...
569507e0d40372288ba9538f94ddbda68231d460 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/569507e0d40372288ba9538f94ddbda68231d460/pdfdoc.py
idToObject = self.idToObject
def Reference(self, object, name=None): ### note references may "grow" during the final formatting pass: don't use d.keys()! # don't make references to other references, or non instances from types import InstanceType #print"object type is ", type(object) tob = type(object) if (tob is not InstanceType) or (tob is Insta...
569507e0d40372288ba9538f94ddbda68231d460 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/569507e0d40372288ba9538f94ddbda68231d460/pdfdoc.py
raise ValueError, "redefining named object: "+repr(name) object.__InternalName__ = name
other = idToObject[name] if other!=object: raise ValueError, "redefining named object: "+repr(name) return PDFObjectReference(name) if tob is InstanceType: object.__InternalName__ = name
def Reference(self, object, name=None): ### note references may "grow" during the final formatting pass: don't use d.keys()! # don't make references to other references, or non instances from types import InstanceType #print"object type is ", type(object) tob = type(object) if (tob is not InstanceType) or (tob is Insta...
569507e0d40372288ba9538f94ddbda68231d460 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/569507e0d40372288ba9538f94ddbda68231d460/pdfdoc.py
self._cellvalues = data
def __init__(self, data, colWidths=None, rowHeights=None, style=None, repeatRows=0, repeatCols=0, splitByRow=1, emptyTableAction=None): #print "colWidths", colWidths self.hAlign = 'CENTER' self.vAlign = 'MIDDLE' if type(data) not in _SeqTypes: raise ValueError, "%s invalid data type" % self.identity() self._nrows = nro...
8ed66da0ceaadd59ed327da835a49ed4dcb03b9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/8ed66da0ceaadd59ed327da835a49ed4dcb03b9d/tables.py
nr = self._nrows if not hasattr(self,'_ncols'): nc = 'unknown' else: nc = self._ncols cv = self._cellvalues
nr = getattr(self,'_nrows','unknown') nc = getattr(self,'_ncols','unknown') cv = self._cellvalues if cv and 'unknown' not in (nr,nc):
def identity(self, maxLen=30): '''Identify our selves as well as possible''' vx = None nr = self._nrows if not hasattr(self,'_ncols'): nc = 'unknown' else: nc = self._ncols cv = self._cellvalues b = 0 for i in xrange(nr): for j in xrange(nc): v = cv[i][j] t = type(v) if t in _SeqTypes or isinstance(v,Flowable): if not ...
8ed66da0ceaadd59ed327da835a49ed4dcb03b9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/8ed66da0ceaadd59ed327da835a49ed4dcb03b9d/tables.py
like the default verifiction strategy, or the way
like the default verification strategy, or the way
def checkMood(moodName): return (moodName in ('happy','sad','ok'))
480ddc7ee60644c7eb01e84635ac95a989b25e42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/480ddc7ee60644c7eb01e84635ac95a989b25e42/ch2_graphics.py
existence depends on other propereties' values :-)""")
existence depends on other properties' values :-)""")
def checkMood(moodName): return (moodName in ('happy','sad','ok'))
480ddc7ee60644c7eb01e84635ac95a989b25e42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/480ddc7ee60644c7eb01e84635ac95a989b25e42/ch2_graphics.py
people will experimate with push-down, pull-down and pattern-matching
people will experiment with push-down, pull-down and pattern-matching
def checkMood(moodName): return (moodName in ('happy','sad','ok'))
480ddc7ee60644c7eb01e84635ac95a989b25e42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/480ddc7ee60644c7eb01e84635ac95a989b25e42/ch2_graphics.py
This chapter presents a treament of the ideas behind our charting
This chapter presents a treatment of the ideas behind our charting
def checkMood(moodName): return (moodName in ('happy','sad','ok'))
480ddc7ee60644c7eb01e84635ac95a989b25e42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/480ddc7ee60644c7eb01e84635ac95a989b25e42/ch2_graphics.py
revious section; these are all optional and are there to let the end user configire the appearance. Things which must be set for a chart to
previous section; these are all optional and are there to let the end user configure the appearance. Things which must be set for a chart to
def checkMood(moodName): return (moodName in ('happy','sad','ok'))
480ddc7ee60644c7eb01e84635ac95a989b25e42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/480ddc7ee60644c7eb01e84635ac95a989b25e42/ch2_graphics.py
its positon relative to this origin and all of its formatting.""")
its position relative to this origin and all of its formatting.""")
def checkMood(moodName): return (moodName in ('happy','sad','ok'))
480ddc7ee60644c7eb01e84635ac95a989b25e42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/480ddc7ee60644c7eb01e84635ac95a989b25e42/ch2_graphics.py
def checkMood(moodName): return (moodName in ('happy','sad','ok'))
480ddc7ee60644c7eb01e84635ac95a989b25e42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/480ddc7ee60644c7eb01e84635ac95a989b25e42/ch2_graphics.py
rectangle' because it makes it vey easy to lay out multiple charts
rectangle' because it makes it very easy to lay out multiple charts
def checkMood(moodName): return (moodName in ('happy','sad','ok'))
480ddc7ee60644c7eb01e84635ac95a989b25e42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/480ddc7ee60644c7eb01e84635ac95a989b25e42/ch2_graphics.py
they are relative quantities and indicate the proprotional
they are relative quantities and indicate the proportional
def checkMood(moodName): return (moodName in ('happy','sad','ok'))
480ddc7ee60644c7eb01e84635ac95a989b25e42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/480ddc7ee60644c7eb01e84635ac95a989b25e42/ch2_graphics.py
def checkMood(moodName): return (moodName in ('happy','sad','ok'))
480ddc7ee60644c7eb01e84635ac95a989b25e42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/480ddc7ee60644c7eb01e84635ac95a989b25e42/ch2_graphics.py
def checkMood(moodName): return (moodName in ('happy','sad','ok'))
480ddc7ee60644c7eb01e84635ac95a989b25e42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/480ddc7ee60644c7eb01e84635ac95a989b25e42/ch2_graphics.py
def func(x): W, H = _listWrapOn(self._content,x*availWidth,self.canv) W /= x H /= x return W, H
df62114a66aabb69f0c57c86b5869b68d72705c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/df62114a66aabb69f0c57c86b5869b68d72705c2/flowables.py
if H<=maxHeight: self.width = W self.height = H
if H<=maxHeight+_FUZZ: self.width = W-_FUZZ self.height = H-_FUZZ
def func(x): W, H = _listWrapOn(self._content,x*availWidth,self.canv) W /= x H /= x return W, H
df62114a66aabb69f0c57c86b5869b68d72705c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/df62114a66aabb69f0c57c86b5869b68d72705c2/flowables.py
self.width = W self.height = H
self.width = W-_FUZZ self.height = H-_FUZZ
def func(x): W, H = _listWrapOn(self._content,x*availWidth,self.canv) W /= x H /= x return W, H
df62114a66aabb69f0c57c86b5869b68d72705c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/df62114a66aabb69f0c57c86b5869b68d72705c2/flowables.py
if H<min(0.95*maxHeight,maxHeight-10):
if H<min(0.95*maxHeight,maxHeight-10) or H>=maxHeight+_FUZZ:
def func(x): W, H = _listWrapOn(self._content,x*availWidth,self.canv) W /= x H /= x return W, H
df62114a66aabb69f0c57c86b5869b68d72705c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/df62114a66aabb69f0c57c86b5869b68d72705c2/flowables.py
if H<=maxHeight-_FUZZ: self.width = W self.height = H
if H<=maxHeight+_FUZZ and W<=maxWidth+_FUZZ: self.width = W-_FUZZ self.height = H-_FUZZ
def func(x): W, H = _listWrapOn(self._content,x*availWidth,self.canv) W /= x H /= x return W, H
df62114a66aabb69f0c57c86b5869b68d72705c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/df62114a66aabb69f0c57c86b5869b68d72705c2/flowables.py
for x in xrange(self.x + self.delta0, self.x + self.width, self.delta): line = Line(x, self.y, x, self.y + self.height)
for x in frange(self.x + self.delta0, self.x + w, self.delta): line = Line(x, self.y, x, self.y + h)
def makeInnerLines(self): # inner grid lines group = Group() if self.useLines == 1: if self.orientation == 'vertical': for x in xrange(self.x + self.delta0, self.x + self.width, self.delta): line = Line(x, self.y, x, self.y + self.height) line.strokeColor = self.strokeColor line.strokeWidth = self.strokeWidth group.ad...
2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab/grids.py
elif self.orientation == 'horizontal': for y in xrange(self.y + self.delta0, self.y + self.height, self.delta): line = Line(self.x, y, self.x + self.width, y)
if self.delta0 != 0: line = Line(self.x, self.y, self.x, self.y + h)
def makeInnerLines(self): # inner grid lines group = Group() if self.useLines == 1: if self.orientation == 'vertical': for x in xrange(self.x + self.delta0, self.x + self.width, self.delta): line = Line(x, self.y, x, self.y + self.height) line.strokeColor = self.strokeColor line.strokeWidth = self.strokeWidth group.ad...
2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab/grids.py
r = range(self.x + self.delta0, self.x + self.width, self.delta) for j in xrange(len(r)):
r = frange(self.x + self.delta0, self.x + w, self.delta) for j in frange(len(r)):
def makeInnerTiles(self): # inner grid lines group = Group()
2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab/grids.py
stripe = Rect(x, self.y, r[j+1]-x, self.height)
stripe = Rect(x, self.y, r[j+1]-x, h)
def makeInnerTiles(self): # inner grid lines group = Group()
2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab/grids.py
stripe = Rect(x, self.y, self.delta, self.height)
stripe = Rect(x, self.y, self.delta, h)
def makeInnerTiles(self): # inner grid lines group = Group()
2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab/grids.py
lmStripe = Rect(self.x, self.y, self.delta0, self.height)
lmStripe = Rect(self.x, self.y, self.delta0, h)
def makeInnerTiles(self): # inner grid lines group = Group()
2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab/grids.py
rmStripe = Rect(self.x + self.width - self.delta0, self.y, self.delta0, self.height)
rmStripe = Rect(self.x + w - self.delta0, self.y, self.delta0, h)
def makeInnerTiles(self): # inner grid lines group = Group()
2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab/grids.py
r = range(self.y + self.delta0, self.y + self.height, self.delta) for j in xrange(len(r)):
r = frange(self.y + self.delta0, self.y + h, self.delta) for j in frange(len(r)):
def makeInnerTiles(self): # inner grid lines group = Group()
2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab/grids.py
stripe = Rect(self.x, y, self.width, r[j+1]-y)
stripe = Rect(self.x, y, w, r[j+1]-y)
def makeInnerTiles(self): # inner grid lines group = Group()
2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab/grids.py
stripe = Rect(self.x, y, self.width, self.delta)
stripe = Rect(self.x, y, w, self.delta)
def makeInnerTiles(self): # inner grid lines group = Group()
2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab/grids.py
lmStripe = Rect(self.x, self.y, self.width, self.delta0)
lmStripe = Rect(self.x, self.y, w, self.delta0)
def makeInnerTiles(self): # inner grid lines group = Group()
2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab/grids.py
umStripe = Rect(self.x, self.y + self.width - self.delta0, self.width, self.delta0)
umStripe = Rect(self.x, self.y + w - self.delta0, w, self.delta0)
def makeInnerTiles(self): # inner grid lines group = Group()
2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab/grids.py
self.numShades = 20.0
self.numShades = 20
def __init__(self): self.x = 0 self.y = 0 self.width = 100 self.height = 100 self.orientation = 'vertical' self.numShades = 20.0 self.fillColorStart = colors.pink self.fillColorEnd = colors.black self.strokeColor = colors.black self.strokeWidth = 2
2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab/grids.py
rect = Rect(self.x, self.y, self.width, self.height)
w, h = self.width, self.height rect = Rect(self.x, self.y, w, h)
def draw(self): # general widget bits group = Group() rect = Rect(self.x, self.y, self.width, self.height) rect.strokeColor = self.strokeColor rect.strokeWidth = self.strokeWidth rect.fillColor = None group.add(rect)
2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab/grids.py
num = self.numShades
num = float(self.numShades)
def draw(self): # general widget bits group = Group() rect = Rect(self.x, self.y, self.width, self.height) rect.strokeColor = self.strokeColor rect.strokeWidth = self.strokeWidth rect.fillColor = None group.add(rect)
2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab/grids.py
for x in xrange(self.x, self.x + self.width, self.width/num): line = Rect(x, self.y, self.width/num, self.height)
if num == 1: xVals = [self.x] else: xVals = frange(self.x, self.x + w, w/num) for x in xVals: stripe = Rect(x, self.y, w/num, h)
def draw(self): # general widget bits group = Group() rect = Rect(self.x, self.y, self.width, self.height) rect.strokeColor = self.strokeColor rect.strokeWidth = self.strokeWidth rect.fillColor = None group.add(rect)
2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab/grids.py
line.fillColor = col line.strokeColor = None line.strokeWidth = 0 group.add(line) r = r + (c1.red - c0.red)/num g = g + (c1.green - c0.green)/num b = b + (c1.blue - c0.blue)/num
stripe.fillColor = col stripe.strokeColor = None stripe.strokeWidth = 0 group.add(stripe) if num > 1: r = r + (c1.red - c0.red) / (num-1) g = g + (c1.green - c0.green) / (num-1) b = b + (c1.blue - c0.blue) / (num-1)
def draw(self): # general widget bits group = Group() rect = Rect(self.x, self.y, self.width, self.height) rect.strokeColor = self.strokeColor rect.strokeWidth = self.strokeWidth rect.fillColor = None group.add(rect)
2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab/grids.py
for y in xrange(self.y, self.y + self.height, self.height/num): line = Rect(self.x, y, self.width, self.height/num)
if num == 1: yVals = [self.y] else: yVals = frange(self.y, self.y + h, h/num) for y in yVals: stripe = Rect(self.x, y, w, h/num)
def draw(self): # general widget bits group = Group() rect = Rect(self.x, self.y, self.width, self.height) rect.strokeColor = self.strokeColor rect.strokeWidth = self.strokeWidth rect.fillColor = None group.add(rect)
2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab/grids.py
line.fillColor = col line.strokeColor = None line.strokeWidth = 0 group.add(line) r = r + (c1.red - c0.red)/num g = g + (c1.green - c0.green)/num b = b + (c1.blue - c0.blue)/num
stripe.fillColor = col stripe.strokeColor = None stripe.strokeWidth = 0 group.add(stripe) if num > 1: r = r + (c1.red - c0.red) / (num-1) g = g + (c1.green - c0.green) / (num-1) b = b + (c1.blue - c0.blue) / (num-1)
def draw(self): # general widget bits group = Group() rect = Rect(self.x, self.y, self.width, self.height) rect.strokeColor = self.strokeColor rect.strokeWidth = self.strokeWidth rect.fillColor = None group.add(rect)
2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab/grids.py
g = Grid0() g.x = 20 g.y = 530 g.demo() D.add(g) g = Grid0() g.x = 140 g.y = 530 g.delta0 = 10 g.demo() D.add(g) g = Grid0() g.x = 260 g.y = 530 g.orientation = 'horizontal' g.demo() D.add(g) sr = ShadedRect0() sr.x = 20 sr.y = 390 sr.fillColorStart = colors.Color(0, 0, 0) sr.fillColorEnd = colors.Color(1, 1, 1) sr....
for row in range(5): y = 530 - row*120 if row == 0: for col in range(3): x = 20 + col*120 g = Grid0() g.x = x g.y = y g.useRects = 0 g.useLines = 1 if col == 0: pass elif col == 1: g.delta0 = 10 elif col == 2: g.orientation = 'horizontal' g.demo() D.add(g) elif row == 1: for col in range(3): x = 20 + col*120 g = Grid0(...
def test(): D = Drawing(450,650) g = Grid0() g.x = 20 g.y = 530 g.demo() D.add(g) g = Grid0() g.x = 140 g.y = 530 g.delta0 = 10 g.demo() D.add(g) g = Grid0() g.x = 260 g.y = 530 g.orientation = 'horizontal' g.demo() D.add(g) sr = ShadedRect0() sr.x = 20 sr.y = 390 sr.fillColorStart = colors.Color(0, 0, 0) sr.fillCo...
2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab/grids.py
self._rowHeghts = H
self._rowHeights = H
def _calc(self): H = self._rowHeights W = self._colWidths
2f6641518b448ba2f15dcaa4d1369f726c8704b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2f6641518b448ba2f15dcaa4d1369f726c8704b8/tables.py
('BOX', (0,0), (-1,-1), 0.25, colors.black),
('BOX', (0,0), (-1,-1), 0.25, colors.black),
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,...
2f6641518b448ba2f15dcaa4d1369f726c8704b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2f6641518b448ba2f15dcaa4d1369f726c8704b8/tables.py
if sys.argv.len()!=3 or sys.argv[1]!='-release':
if len(sys.argv)!=3 or sys.argv[1]!='-release':
def find_src_files(L,d,N): if string.upper(os.path.basename(d))=='CVS': return #ignore all CVS for n in N: fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): L.append(fn)
fb7fffa535194ba899ec911fe92a6cb29e2dbb7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/fb7fffa535194ba899ec911fe92a6cb29e2dbb7f/daily.py
c.drawInlineImage('pythonpowered.gif',2*inch, 7*inch)
gif = os.path.join(os.path.dirname(unittest.__file__),'pythonpowered.gif') c.drawInlineImage(gif,2*inch, 7*inch)
def makeDocument(filename, pageCallBack=None): #the extra arg is a hack added later, so other #tests can get hold of the canvas just before it is #saved global titlelist, closeit titlelist = [] closeit = 0 c = canvas.Canvas(filename) c.setPageCompression(0) c.setPageCallBack(pageCallBack) framePageForm(c) # define the...
b4dc02db9b5691ba384e69ee2eb2525c4c1d354f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b4dc02db9b5691ba384e69ee2eb2525c4c1d354f/test_pdfgen_general.py
c.drawInlineImage('pythonpowered.gif',2*inch, 5*inch, inch, inch)
c.drawInlineImage(gif,2*inch, 5*inch, inch, inch)
def makeDocument(filename, pageCallBack=None): #the extra arg is a hack added later, so other #tests can get hold of the canvas just before it is #saved global titlelist, closeit titlelist = [] closeit = 0 c = canvas.Canvas(filename) c.setPageCompression(0) c.setPageCallBack(pageCallBack) framePageForm(c) # define the...
b4dc02db9b5691ba384e69ee2eb2525c4c1d354f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b4dc02db9b5691ba384e69ee2eb2525c4c1d354f/test_pdfgen_general.py
(w, h) = c.drawImage('pythonpowered.gif', (1.5 + i)*inch, 3*inch)
(w, h) = c.drawImage(gif, (1.5 + i)*inch, 3*inch)
def makeDocument(filename, pageCallBack=None): #the extra arg is a hack added later, so other #tests can get hold of the canvas just before it is #saved global titlelist, closeit titlelist = [] closeit = 0 c = canvas.Canvas(filename) c.setPageCompression(0) c.setPageCallBack(pageCallBack) framePageForm(c) # define the...
b4dc02db9b5691ba384e69ee2eb2525c4c1d354f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b4dc02db9b5691ba384e69ee2eb2525c4c1d354f/test_pdfgen_general.py
c.drawImage('pythonpowered.gif', 3*inch, 1.2*inch, w, h, mask=myMask)
c.drawImage(gif, 3*inch, 1.2*inch, w, h, mask=myMask)
def makeDocument(filename, pageCallBack=None): #the extra arg is a hack added later, so other #tests can get hold of the canvas just before it is #saved global titlelist, closeit titlelist = [] closeit = 0 c = canvas.Canvas(filename) c.setPageCompression(0) c.setPageCallBack(pageCallBack) framePageForm(c) # define the...
b4dc02db9b5691ba384e69ee2eb2525c4c1d354f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b4dc02db9b5691ba384e69ee2eb2525c4c1d354f/test_pdfgen_general.py
"""This draws a right-angled triangle. possible attributes: 'x', 'y', 'size', 'color', 'strokeColor' """ def __init__(self): self.x = 0 self.y = 0 self.size = 100 self.color = colors.green self.strokeColor = None def demo(self): D = shapes.Drawing(200, 100) et = RTriangle0() et.x=50 et.y=0 et.draw() D.add(et) label...
"""This draws a right-angled triangle. possible attributes: 'x', 'y', 'size', 'color', 'strokeColor' """ def __init__(self): self.x = 0 self.y = 0 self.size = 100 self.color = colors.green self.strokeColor = None def draw(self): s = float(self.size) g = shapes.Group() ae = s*0.125 triangle = shapes.Polygon(point...
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group() # Triangle specific bits ae = s*0.125 #(ae = 'an eighth') triangle = shapes.Polygon(points = [ self.x, self.y, self.x+s, self.y, self.x+(s/2),self.y+s], fillColor = self.color, strokeColor = self.s...
a94ee8176f1eaa19b5cc320daa2067dbafd93acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a94ee8176f1eaa19b5cc320daa2067dbafd93acd/signsandsymbols.py
"""This widget draws an Octagon. possible attributes: 'x', 'y', 'size', 'color', 'strokeColor' """ def __init__(self): self.x = 0 self.y = 0 self.size = 100 self.color = colors.yellow self.strokeColor = None def demo(self): D = shapes.Drawing(200, 100) o = Octagon0() o.x=50 o.y=0 o.draw() D.add(o) labelFontSize = 1...
"""This widget draws an Octagon. possible attributes: 'x', 'y', 'size', 'color', 'strokeColor' """ def __init__(self): self.x = 0 self.y = 0 self.size = 100 self.color = colors.yellow self.strokeColor = None def draw(self): s = float(self.size) g = shapes.Group() athird=s/3 octagon = shapes.Polygon(points=[self...
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group() # Triangle specific bits ae = s*0.125 #(ae = 'an eighth') triangle = shapes.Polygon(points = [ self.x, self.y, self.x+s, self.y, self.x,self.y+s], fillColor = self.color, strokeColor = self.strokeC...
a94ee8176f1eaa19b5cc320daa2067dbafd93acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a94ee8176f1eaa19b5cc320daa2067dbafd93acd/signsandsymbols.py
"""This draws a black box with a red cross in it - a 'checkbox'. possible attributes: 'x', 'y', 'size', 'crossColor', 'boxColor', 'crosswidth' """ _attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor', 'color'), crossColor = AttrMapValue(isColorOrNone), boxColor = AttrMapValue(isColorOrNone), crosswidth = Attr...
"""This draws a black box with a red cross in it - a 'checkbox'. possible attributes: 'x', 'y', 'size', 'crossColor', 'boxColor', 'crosswidth' """ _attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor', 'color'), crossColor = AttrMapValue(isColorOrNone), boxColor = AttrMapValue(isColorOrNone), crosswidth = Attr...
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group() # Octagon specific bits athird=s/3
a94ee8176f1eaa19b5cc320daa2067dbafd93acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a94ee8176f1eaa19b5cc320daa2067dbafd93acd/signsandsymbols.py
"""This draws a black box with a red tick in it - another 'checkbox'. possible attributes: 'x', 'y', 'size', 'tickColor', 'boxColor', 'tickwidth' """ _attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor', 'color'), tickColor = AttrMapValue(isColorOrNone), boxColor = AttrMapValue(isColorOrNone), tickwidth = Att...
"""This draws a black box with a red tick in it - another 'checkbox'. possible attributes: 'x', 'y', 'size', 'tickColor', 'boxColor', 'tickwidth' """ _attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor', 'color'), tickColor = AttrMapValue(isColorOrNone), boxColor = AttrMapValue(isColorOrNone), tickwidth = Att...
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group() # crossbox specific bits box = shapes.Rect(self.x+1, self.y+1, s-2, s-2, fillColor = None, strokeColor = self.boxColor, strokeWidth=2) g.add(box) crossLine1 = shapes.Line(self.x+(s*0.15), self.y+(s*0.15), se...
a94ee8176f1eaa19b5cc320daa2067dbafd93acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a94ee8176f1eaa19b5cc320daa2067dbafd93acd/signsandsymbols.py
"""This draws a classic smiley face. possible attributes: 'x', 'y', 'size', 'color' """ _attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor',), ) def __init__(self): self.x = 0 self.y = 0 self.size = 100 self.color = colors.yellow def demo(self): D = shapes.Drawing(200, 100) sf = SmileyFace0() sf.x=50 sf.y=...
"""This draws a classic smiley face. possible attributes: 'x', 'y', 'size', 'color' """ _attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor',), ) def __init__(self): self.x = 0 self.y = 0 self.size = 100 self.color = colors.yellow def draw(self): s = float(self.size) g = shapes.Group() outerCircle = shap...
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group() # tickbox specific bits box = shapes.Rect(self.x+1, self.y+1, s-2, s-2, fillColor = None, strokeColor = self.boxColor, strokeWidth=2) g.add(box)
a94ee8176f1eaa19b5cc320daa2067dbafd93acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a94ee8176f1eaa19b5cc320daa2067dbafd93acd/signsandsymbols.py
"""This draws a (British) stop sign. possible attributes: 'x', 'y', 'size' """ _attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor', 'color'), ) def __init__(self): self.x = 0 self.y = 0 self.size = 100 def demo(self): D = shapes.Drawing(200, 100) ss = StopSign0() ss.x=50 ss.y=0 ss.draw() D.add(ss) labelFon...
"""This draws a (British) stop sign. possible attributes: 'x', 'y', 'size' """ _attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor', 'color'), ) def __init__(self): self.x = 0 self.y = 0 self.size = 100 def draw(self): s = float(self.size) g = shapes.Group() athird=s/3 outerOctagon = shapes.Polygon(point...
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group() # SmileyFace specific bits outerCircle = shapes.Circle(cx = (self.x+(s/2)), cy = (self.y+(s/2)), r = s/2, fillColor = self.color, strokeColor = colors.black, strokeWidth=s/38.) g.add(outerCircle)
a94ee8176f1eaa19b5cc320daa2067dbafd93acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a94ee8176f1eaa19b5cc320daa2067dbafd93acd/signsandsymbols.py
"""This draws a (British) No Entry sign - a red circle with a white line on it. possible attributes: 'x', 'y', 'size' """ _attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor', 'color'), ) def __init__(self): self.x = 0 self.y = 0 self.size = 100 def demo(self): D = shapes.Drawing(200, 100) ne = NoEntry0() n...
"""This draws a (British) No Entry sign - a red circle with a white line on it. possible attributes: 'x', 'y', 'size' """ _attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor', 'color'), ) def __init__(self): self.x = 0 self.y = 0 self.size = 100 def draw(self): s = float(self.size) g = shapes.Group() out...
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group() # stop-sign specific bits athird=s/3
a94ee8176f1eaa19b5cc320daa2067dbafd93acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a94ee8176f1eaa19b5cc320daa2067dbafd93acd/signsandsymbols.py
"""This draws a 'forbidden' roundel (as used in the no-smoking sign). possible attributes: 'x', 'y', 'size' """ _attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor', 'color'), ) def __init__(self): self.x = 0 self.y = 0 self.size = 100 def demo(self): D = shapes.Drawing(200, 100) na = NotAllowed0() na.x=50 ...
"""This draws a 'forbidden' roundel (as used in the no-smoking sign). possible attributes: 'x', 'y', 'size' """ _attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor', 'color'), ) def __init__(self): self.x = 0 self.y = 0 self.size = 100 def draw(self): s = float(self.size) g = shapes.Group() outerCircle =...
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group() # no-entry-sign specific bits outerCircle = shapes.Circle(cx = (self.x+(s/2)), cy = (self.y+(s/2)), r = s/2, fillColor = None, strokeColor = colors.black, strokeWidth=1) g.add(outerCircle)
a94ee8176f1eaa19b5cc320daa2067dbafd93acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a94ee8176f1eaa19b5cc320daa2067dbafd93acd/signsandsymbols.py
"""This draws a no-smoking sign. possible attributes: 'x', 'y', 'size' """ def __init__(self): self.x = 0 self.y = 0 self.size = 100 def demo(self): D = shapes.Drawing(200, 100) ns = NoSmoking0() ns.x=50 ns.y=0 ns.draw() D.add(ns) labelFontSize = 10 D.add(shapes.String(ns.x+(ns.size/2),(ns.y-(1.2*labelFontSize)), s...
"""This draws a no-smoking sign. possible attributes: 'x', 'y', 'size' """ def __init__(self): self.x = 0 self.y = 0 self.size = 100 def draw(self): s = float(self.size) g = shapes.Group() newx = self.x+(s/2)-(s/3.5) newy = self.y+(s/2)-(s/32) cigarrette1 = shapes.Rect(x = newx, y = newy, width = (s/2), height =...
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group() # not=allowed specific bits outerCircle = shapes.Circle(cx = (self.x+(s/2)), cy = (self.y+(s/2)), r = (s/2)-(s/10), fillColor = None, strokeColor = colors.red, strokeWidth=s/10.) g.add(outerCircle) centerx=s...
a94ee8176f1eaa19b5cc320daa2067dbafd93acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a94ee8176f1eaa19b5cc320daa2067dbafd93acd/signsandsymbols.py
"""This draws a 'danger' sign: a yellow box with a black exclamation point. possible attributes: 'x', 'y', 'size', 'exmarkColor', 'backColor', 'exmarkWidth' """ _attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor', 'color'), exmarkColor = AttrMapValue( isColorOrNone), backColor = AttrMapValue( isColorOrNone),...
"""This draws a 'danger' sign: a yellow box with a black exclamation point. possible attributes: 'x', 'y', 'size', 'exmarkColor', 'backColor', 'exmarkWidth' """ _attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor', 'color'), exmarkColor = AttrMapValue( isColorOrNone), backColor = AttrMapValue( isColorOrNone),...
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group() # no-smoking-sign specific bits newx = self.x+(s/2)-(s/3.5) newy = self.y+(s/2)-(s/32) cigarrette1 = shapes.Rect(x = newx, y = newy, width = (s/2), height =(s/16), fillColor = colors.ghostwhite, strokeColor =...
a94ee8176f1eaa19b5cc320daa2067dbafd93acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a94ee8176f1eaa19b5cc320daa2067dbafd93acd/signsandsymbols.py
"""This widget draw a tickbox or crossbox depending on 'testValue'. If this widget is supplied with a 'True' or 1 as a value for testValue, it will use the tickbox widget. Otherwise, it will produce a crossbox. possible attributes: 'x', 'y', 'size', 'tickcolor', 'crosscolor', 'testValue'
"""This widget draw a tickbox or crossbox depending on 'testValue'. If this widget is supplied with a 'True' or 1 as a value for testValue, it will use the tickbox widget. Otherwise, it will produce a crossbox. possible attributes: 'x', 'y', 'size', 'tickcolor', 'crosscolor', 'testValue'
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group() ew = self.exmarkWidth ae = s*0.125 #(ae = 'an eighth')
a94ee8176f1eaa19b5cc320daa2067dbafd93acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a94ee8176f1eaa19b5cc320daa2067dbafd93acd/signsandsymbols.py
_attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor', 'color'), tickcolor = AttrMapValue(isColor), crosscolor = AttrMapValue(isColor), testValue = AttrMapValue(isBoolean), ) def __init__(self): self.x = 0 self.y = 0 self.size = 100 self.tickcolor = colors.green self.crosscolor = colors.red self.testValue = 1 d...
_attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor', 'color'), tickcolor = AttrMapValue(isColor), crosscolor = AttrMapValue(isColor), testValue = AttrMapValue(isBoolean), ) def __init__(self): self.x = 0 self.y = 0 self.size = 100 self.tickcolor = colors.green self.crosscolor = colors.red self.testValue = 1 d...
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group() ew = self.exmarkWidth ae = s*0.125 #(ae = 'an eighth')
a94ee8176f1eaa19b5cc320daa2067dbafd93acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a94ee8176f1eaa19b5cc320daa2067dbafd93acd/signsandsymbols.py
"""This widget draws an icon of a floppy disk. possible attributes: 'x', 'y', 'size', 'diskcolor' """ _attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor', 'color'), diskColor = AttrMapValue(isColor), ) def __init__(self): self.x = 0 self.y = 0 self.size = 100 self.diskColor = colors.black def demo(self): D...
"""This widget draws an icon of a floppy disk. possible attributes: 'x', 'y', 'size', 'diskcolor' """ _attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor', 'color'), diskColor = AttrMapValue(isColor), ) def __init__(self): self.x = 0 self.y = 0 self.size = 100 self.diskColor = colors.black def draw(self): ...
def demo(self): D = shapes.Drawing(200, 100) yn = YesNo0() yn.x = 15 yn.y = 25 yn.size = 70 yn.testValue = 0 yn.draw() D.add(yn) yn2 = YesNo0() yn2.x = 120 yn2.y = 25 yn2.size = 70 yn2.testValue = 1 yn2.draw() D.add(yn2) labelFontSize = 8 D.add(shapes.String(yn.x+(yn.size/2),(yn.y-(1.2*labelFontSize)), 'testValue=0', f...
a94ee8176f1eaa19b5cc320daa2067dbafd93acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a94ee8176f1eaa19b5cc320daa2067dbafd93acd/signsandsymbols.py
"""This widget draws an arrow (style one). possible attributes: 'x', 'y', 'size', 'color' """ _attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor',), ) def __init__(self): self.x = 0 self.y = 0 self.size = 100 self.color = colors.red def demo(self): D = shapes.Drawing(200, 100) a1 = ArrowOne0() a1.x=50 a1.y...
"""This widget draws an arrow (style one). possible attributes: 'x', 'y', 'size', 'color' """ _attrMap = AttrMap(BASE=ETriangle0, UNWANTED=('strokeColor',), ) def __init__(self): self.x = 0 self.y = 0 self.size = 100 self.color = colors.red def draw(self): s = float(self.size) g = shapes.Group() body = shapes....
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group()
a94ee8176f1eaa19b5cc320daa2067dbafd93acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a94ee8176f1eaa19b5cc320daa2067dbafd93acd/signsandsymbols.py
"""This widget draws an arrow (style two). possible attributes: 'x', 'y', 'size', 'color' """ def __init__(self): self.x = 0 self.y = 0 self.size = 100 self.color = colors.blue def demo(self): D = shapes.Drawing(200, 100) a2 = ArrowTwo0() a2.x=50 a2.y=0 a2.draw() D.add(a2) labelFontSize = 10 D.add(shapes.String(a2....
"""This widget draws an arrow (style two). possible attributes: 'x', 'y', 'size', 'color' """ def __init__(self): self.x = 0 self.y = 0 self.size = 100 self.color = colors.blue def draw(self): s = float(self.size) g = shapes.Group() body = shapes.Rect(x=self.x, y=(self.y+(s/2))-(s/24), width=9*(s/10), height=(s...
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group()
a94ee8176f1eaa19b5cc320daa2067dbafd93acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a94ee8176f1eaa19b5cc320daa2067dbafd93acd/signsandsymbols.py
"""This function produces a pdf with examples of all the signs and symbols from this file. """ labelFontSize = 10 D = shapes.Drawing(450,650) cb = Crossbox0() cb.x = 20 cb.y = 530 cb.demo() D.add(cb) D.add(shapes.String(cb.x+(cb.size/2),(cb.y-(1.2*labelFontSize)), cb.__class__.__name__, fillColor=colors.black, textAnch...
"""This function produces a pdf with examples of all the signs and symbols from this file. """ labelFontSize = 10 D = shapes.Drawing(450,650) cb = Crossbox0() cb.x = 20 cb.y = 530 cb.demo() D.add(cb) D.add(shapes.String(cb.x+(cb.size/2),(cb.y-(1.2*labelFontSize)), cb.__class__.__name__, fillColor=colors.black, textAnch...
def test(): """This function produces a pdf with examples of all the signs and symbols from this file. """ labelFontSize = 10 D = shapes.Drawing(450,650) cb = Crossbox0() cb.x = 20 cb.y = 530 cb.demo() D.add(cb) D.add(shapes.String(cb.x+(cb.size/2),(cb.y-(1.2*labelFontSize)), cb.__class__.__name__, fillColor=colors.bla...
a94ee8176f1eaa19b5cc320daa2067dbafd93acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a94ee8176f1eaa19b5cc320daa2067dbafd93acd/signsandsymbols.py
test()
test()
def test(): """This function produces a pdf with examples of all the signs and symbols from this file. """ labelFontSize = 10 D = shapes.Drawing(450,650) cb = Crossbox0() cb.x = 20 cb.y = 530 cb.demo() D.add(cb) D.add(shapes.String(cb.x+(cb.size/2),(cb.y-(1.2*labelFontSize)), cb.__class__.__name__, fillColor=colors.bla...
a94ee8176f1eaa19b5cc320daa2067dbafd93acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a94ee8176f1eaa19b5cc320daa2067dbafd93acd/signsandsymbols.py
if self.vecttor[index]!=value:
if self.vector[index]!=value:
def __setitem__(self, index, value): if self.vecttor[index]!=value: L = list(self.vector) L[index] = value self.vector = tuple(L)
1fe5c2ca28f1a89e8758aa0785f65e7c5f62e022 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/1fe5c2ca28f1a89e8758aa0785f65e7c5f62e022/pdfmetrics.py
addWidths(fontName, font.getWidths())
def testMetrics(): # load the standard ones: for baseFontName in standardFonts: encoding = WinAnsiEncoding fontName = baseFontName + '-WinAnsi' font = Type1Font(fontName, baseFontName, encoding) addWidths(fontName, font.getWidths()) #test it msg = 'Hello World' w = stringWidth(msg, fontName, 10)# print 'width of "%s" i...
1fe5c2ca28f1a89e8758aa0785f65e7c5f62e022 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/1fe5c2ca28f1a89e8758aa0785f65e7c5f62e022/pdfmetrics.py
zenc = SingleByteEncoding('WinAnsiEncoding')
zenc = 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