rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
if fragment and fragment[0] in string.whitespace:
if fragment and fragment[0] in WHITESPACE:
def handleSpecialCharacters(engine, text, program=None, greeks=greeks): from string import whitespace # add space prefix if space here if text[0:1] in whitespace: program.append(" ") #print "handling", repr(text) # shortcut if 0 and "&" not in text: result = [] for x in text.split(): result.append(x+" ") if result: las...
a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py
if fragment[-1] in string.whitespace:
if fragment[-1] in WHITESPACE:
def handleSpecialCharacters(engine, text, program=None, greeks=greeks): from string import whitespace # add space prefix if space here if text[0:1] in whitespace: program.append(" ") #print "handling", repr(text) # shortcut if 0 and "&" not in text: result = [] for x in text.split(): result.append(x+" ") if result: las...
a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py
last = sfragment[-1].strip()
last = sfragment[-1].strip()
def handleSpecialCharacters(engine, text, program=None, greeks=greeks): from string import whitespace # add space prefix if space here if text[0:1] in whitespace: program.append(" ") #print "handling", repr(text) # shortcut if 0 and "&" not in text: result = [] for x in text.split(): result.append(x+" ") if result: las...
a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py
def Paragraph(text, style, bulletText=None, frags=None):
def Paragraph(text, style, bulletText=None, frags=None, context=None):
def Paragraph(text, style, bulletText=None, frags=None): """ Paragraph(text, style, bulletText=None) intended to be like a platypus Paragraph but better. """ # if there is no & or < in text then use the fast paragraph if "&" not in text and "<" not in text: return FastPara(style, simpletext=text) else: # use the fully ...
a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py
return Para(style, parsedText=parsedpara, bulletText=bulletText, state=None)
return Para(style, parsedText=parsedpara, bulletText=bulletText, state=None, context=context)
def Paragraph(text, style, bulletText=None, frags=None): """ Paragraph(text, style, bulletText=None) intended to be like a platypus Paragraph but better. """ # if there is no & or < in text then use the fast paragraph if "&" not in text and "<" not in text: return FastPara(style, simpletext=text) else: # use the fully ...
a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py
canvas.bookmarkHorizontal(destinationname, x,y1)
canvas.bookmarkHorizontal(destinationname, x, y1)
def link(self, rect, canvas): destinationname = self.url if not self.defined: [x, y, x1, y1] = rect canvas.bookmarkHorizontal(destinationname, x,y1) # use the upper y self.defined = 1
a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py
stext = string.split(text)
stext = text.split()
def splitspace(text): # split on spacing but include spaces at element ends stext = string.split(text) result = [] for e in stext: result.append(e+" ") return result
a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py
def findT1File(fontName,ext='.pfb'):
def _searchT1Dirs(n):
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
310be394f7c2a2b8843f5053515eb2cb0a21a047 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/310be394f7c2a2b8843f5053515eb2cb0a21a047/_fontdata.py
if sys.platform in ('linux2',) and ext=='.pfb': ext = '' n = _findFNR(fontName)+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
310be394f7c2a2b8843f5053515eb2cb0a21a047 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/310be394f7c2a2b8843f5053515eb2cb0a21a047/_fontdata.py
'space': 278}
'space': 278}
def __getitem__(self,x): y = string.lower(x) if y[-8:]=='encoding': y = y[:-8] y = self._XMap[y] return self.data[y]
310be394f7c2a2b8843f5053515eb2cb0a21a047 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/310be394f7c2a2b8843f5053515eb2cb0a21a047/_fontdata.py
tx.moveCursor(offset + 0.5 * extraspace, 0)
m = offset + 0.5 * extraspace tx.moveCursor(m, 0)
def cleanBlockQuotedText(text): """This is an internal utility which takes triple- quoted text form within the document and returns (hopefully) the paragraph the user intended originally.""" stripped = string.strip(text) lines = string.split(stripped, '\n') trimmed_lines = map(string.lstrip, lines) return string.join(t...
6b31b874861a338231612bc3e9fa165b59a293b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6b31b874861a338231612bc3e9fa165b59a293b1/paragraph.py
tx.moveCursor(-offset + 0.5 * extraspace, 0)
tx.moveCursor(-m, 0)
def cleanBlockQuotedText(text): """This is an internal utility which takes triple- quoted text form within the document and returns (hopefully) the paragraph the user intended originally.""" stripped = string.strip(text) lines = string.split(stripped, '\n') trimmed_lines = map(string.lstrip, lines) return string.join(t...
6b31b874861a338231612bc3e9fa165b59a293b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6b31b874861a338231612bc3e9fa165b59a293b1/paragraph.py
tx.moveCursor(offset + extraspace, 0)
m = offset + extraspace tx.moveCursor(m, 0)
def cleanBlockQuotedText(text): """This is an internal utility which takes triple- quoted text form within the document and returns (hopefully) the paragraph the user intended originally.""" stripped = string.strip(text) lines = string.split(stripped, '\n') trimmed_lines = map(string.lstrip, lines) return string.join(t...
6b31b874861a338231612bc3e9fa165b59a293b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6b31b874861a338231612bc3e9fa165b59a293b1/paragraph.py
tx.moveCursor(-offset + extraspace, 0)
tx.moveCursor(-m, 0)
def cleanBlockQuotedText(text): """This is an internal utility which takes triple- quoted text form within the document and returns (hopefully) the paragraph the user intended originally.""" stripped = string.strip(text) lines = string.split(stripped, '\n') trimmed_lines = map(string.lstrip, lines) return string.join(t...
6b31b874861a338231612bc3e9fa165b59a293b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6b31b874861a338231612bc3e9fa165b59a293b1/paragraph.py
tx.moveCursor(offset + 0.5 * line.extraSpace, 0)
m = offset+0.5*line.extraSpace tx.moveCursor(m, 0)
def cleanBlockQuotedText(text): """This is an internal utility which takes triple- quoted text form within the document and returns (hopefully) the paragraph the user intended originally.""" stripped = string.strip(text) lines = string.split(stripped, '\n') trimmed_lines = map(string.lstrip, lines) return string.join(t...
6b31b874861a338231612bc3e9fa165b59a293b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6b31b874861a338231612bc3e9fa165b59a293b1/paragraph.py
tx.moveCursor(-offset + 0.5 * line.extraSpace, 0)
tx.moveCursor(-m, 0)
def cleanBlockQuotedText(text): """This is an internal utility which takes triple- quoted text form within the document and returns (hopefully) the paragraph the user intended originally.""" stripped = string.strip(text) lines = string.split(stripped, '\n') trimmed_lines = map(string.lstrip, lines) return string.join(t...
6b31b874861a338231612bc3e9fa165b59a293b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6b31b874861a338231612bc3e9fa165b59a293b1/paragraph.py
tx.moveCursor(offset + line.extraSpace, 0)
m = offset+line.extraSpace tx.moveCursor(m, 0)
def cleanBlockQuotedText(text): """This is an internal utility which takes triple- quoted text form within the document and returns (hopefully) the paragraph the user intended originally.""" stripped = string.strip(text) lines = string.split(stripped, '\n') trimmed_lines = map(string.lstrip, lines) return string.join(t...
6b31b874861a338231612bc3e9fa165b59a293b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6b31b874861a338231612bc3e9fa165b59a293b1/paragraph.py
tx.moveCursor(-offset + line.extraSpace, 0)
tx.moveCursor(-m, 0)
def cleanBlockQuotedText(text): """This is an internal utility which takes triple- quoted text form within the document and returns (hopefully) the paragraph the user intended originally.""" stripped = string.strip(text) lines = string.split(stripped, '\n') trimmed_lines = map(string.lstrip, lines) return string.join(t...
6b31b874861a338231612bc3e9fa165b59a293b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6b31b874861a338231612bc3e9fa165b59a293b1/paragraph.py
return setps, labels
return steps, labels
def _getStepsAndLabels(self,xVals): if self.dailyFreq: xEOM = [] pm = 0 px = xVals[0] for x in xVals: m = x.month() if pm!=m: if pm: xEOM.append(px) pm = m px = x px = xVals[-1] if xEOM[-1]!=x: xEOM.append(px) steps, labels = self._xAxisTicker(xEOM) else: steps, labels = self._xAxisTicker(xVals) return setps, labels
bc2c286d877fb5bf68fb8eaf23cee3d449ef33a4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bc2c286d877fb5bf68fb8eaf23cee3d449ef33a4/axes.py
strokeWidth=strokeWidth, strokeColor=strokeColor, fillColor=fillColor))
strokeWidth=strokeWidth, strokeColor=strokeColor, fillColor=fillColor,strokeLineJoin=1))
def _add_3d_bar(x1, x2, y1, y2, xoff, yoff, G=G,strokeColor=strokeColor, strokeWidth=strokeWidth, fillColor=fillColor): G.add(Polygon((x1,y1,x1+xoff, y1+yoff,x2+xoff, y2+yoff,x2,y2), strokeWidth=strokeWidth, strokeColor=strokeColor, fillColor=fillColor))
907b163f924c5c1154361a004198806ae6a904ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/907b163f924c5c1154361a004198806ae6a904ab/utils3d.py
strokeColor=strokeColor, strokeWidth=strokeWidth, fillColor=fillColor))
strokeColor=strokeColor, strokeWidth=strokeWidth, fillColor=fillColor,strokeLineJoin=1))
def _add_3d_bar(x1, x2, y1, y2, xoff, yoff, G=G,strokeColor=strokeColor, strokeWidth=strokeWidth, fillColor=fillColor): G.add(Polygon((x1,y1,x1+xoff, y1+yoff,x2+xoff, y2+yoff,x2,y2), strokeWidth=strokeWidth, strokeColor=strokeColor, fillColor=fillColor))
907b163f924c5c1154361a004198806ae6a904ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/907b163f924c5c1154361a004198806ae6a904ab/utils3d.py
print 'Poly([%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f])'% tuple(_ystrip_poly(x[0], x[1], y.y0, y.y1, xdepth, -ydepth))
def F(x,i, slope=slope, y0=y0, x0=x0): return float((x-x0)*slope[i]+y0[i])
907b163f924c5c1154361a004198806ae6a904ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/907b163f924c5c1154361a004198806ae6a904ab/utils3d.py
self.valueAxis.setPosition(self.x, self.y, length)
vA = self.valueAxis vA.setPosition(self.x, self.y, length)
def _drawBegin(self,org,length): '''Position and configure value axis, return crossing value''' self.valueAxis.setPosition(self.x, self.y, length) self._getConfigureData() self.valueAxis.configure(self._configureData)
dab89a47383bb6aee59389d66b8987d61a86c32c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/dab89a47383bb6aee59389d66b8987d61a86c32c/barcharts.py
self.valueAxis.configure(self._configureData) crossesAt = self.valueAxis.scale(0)
vA.configure(self._configureData) crossesAt = vA.scale(0)
def _drawBegin(self,org,length): '''Position and configure value axis, return crossing value''' self.valueAxis.setPosition(self.x, self.y, length) self._getConfigureData() self.valueAxis.configure(self._configureData)
dab89a47383bb6aee59389d66b8987d61a86c32c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/dab89a47383bb6aee59389d66b8987d61a86c32c/barcharts.py
def _drawBegin(self,org,length): '''Position and configure value axis, return crossing value''' self.valueAxis.setPosition(self.x, self.y, length) self._getConfigureData() self.valueAxis.configure(self._configureData)
dab89a47383bb6aee59389d66b8987d61a86c32c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/dab89a47383bb6aee59389d66b8987d61a86c32c/barcharts.py
try: if self._flipXY: cA.setPosition(self._drawBegin(self.x,self.width), self.y, self.height) else: cA.setPosition(self.x, self._drawBegin(self.y,self.height), self.width) return self._drawFinish() finally: if vA: vA.joinAxis = ovAjA if cA: cA.joinAxis = ocAjA
if self._flipXY: cA.setPosition(self._drawBegin(self.x,self.width), self.y, self.height) else: cA.setPosition(self.x, self._drawBegin(self.y,self.height), self.width) return self._drawFinish()
def draw(self): cA, vA = self.categoryAxis, self.valueAxis if vA: ovAjA, vA.joinAxis = vA.joinAxis, cA if cA: ocAjA, cA.joinAxis = cA.joinAxis, vA try: if self._flipXY: cA.setPosition(self._drawBegin(self.x,self.width), self.y, self.height) else: cA.setPosition(self.x, self._drawBegin(self.y,self.height), self.width) r...
dab89a47383bb6aee59389d66b8987d61a86c32c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/dab89a47383bb6aee59389d66b8987d61a86c32c/barcharts.py
_renderPM.makeT1Font(fontName,f.face.findT1File(),f.encoding.vector,open_and_read)
if _renderPM._version<='0.98': _renderPM.makeT1Font(fontName,f.face.findT1File(),f.encoding.vector) else: _renderPM.makeT1Font(fontName,f.face.findT1File(),f.encoding.vector,open_and_read)
def _setFont(gs,fontName,fontSize): try: gs.setFont(fontName,fontSize) except _renderPM.Error, errMsg: if errMsg.args[0]!="Can't find font!": raise #here's where we try to add a font to the canvas try: f = getFont(fontName) _renderPM.makeT1Font(fontName,f.face.findT1File(),f.encoding.vector,open_and_read) except: s1, s...
fea39fce604e9ba7690698049ef22651eabcf532 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/fea39fce604e9ba7690698049ef22651eabcf532/renderPM.py
if theme.lower()=='chomsky': return chomsky(sentences)
if type(theme)==type(''): if theme.lower()=='chomsky': return chomsky(sentences) elif theme.upper() in ('STARTUP','COMPUTERS','BLAH','BUZZWORD','STARTREK','PRINTING','PYTHON'): theme = globals()[theme] else: raise ValueError('Unknown theme "%s"' % theme)
def randomText(theme=STARTUP, sentences=5): #this may or may not be appropriate in your company if theme.lower()=='chomsky': return chomsky(sentences) from random import randint, choice RANDOMWORDS = theme #sentences = 5 output = "" for sentenceno in range(randint(1,sentences)): output = output + 'Blah' for wordno in...
8f8a04163ae8782b62ab963340af3f7ce524613a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/8f8a04163ae8782b62ab963340af3f7ce524613a/randomtext.py
if dx<>0 or dy<>0: self._code.append('%s Td' % fp_str(dx, -dy))
dx = dx + float(L[-3]) dy = dy - float(L[-2]) self._code.append('%s Td' % fp_str(dx, -dy))
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...
dd7631e8c2e435f149b5e3e59af58e8d8606eef2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/dd7631e8c2e435f149b5e3e59af58e8d8606eef2/textobject.py
if self._code[-1][-3:]==' Td': L = string.split(self._code[-1]) if len(L)==3: del self._code[-1] else: self._code[-1] = string.join(L[:-4]) if dx<>0: self._code.append('%s 0 Td' % fp_str(dx))
self.moveCursor(dx,0)
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.""" if self._code[-1][-3:]==' Td': L = string.split(self._code[-1]) if len(L)==3: del self._code[-1] else: self._code[-1] = string.join(L[:-4]) if dx<>0: self....
dd7631e8c2e435f149b5e3e59af58e8d8606eef2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/dd7631e8c2e435f149b5e3e59af58e8d8606eef2/textobject.py
def _AsciiBase85Encode(input): """This is a compact encoding used for binary data within a PDF file. Four bytes of binary data become five bytes of ASCII. This is the default method used for encoding images.""" outstream = cStringIO.StringIO() whole_word_count, remainder_size = divmod(len(input), 4) cut = 4 * whole_...
try: import _streams _AsciiBase85Encode = _streams.ASCII85Encode except ImportError: def _AsciiBase85Encode(input): """This is a compact encoding used for binary data within a PDF file. Four bytes of binary data become five bytes of ASCII. This is the default method used for encoding images.""" outstream = cStringIO....
def _AsciiBase85Encode(input): """This is a compact encoding used for binary data within a PDF file. Four bytes of binary data become five bytes of ASCII. This is the default method used for encoding images.""" outstream = cStringIO.StringIO() # special rules apply if not a multiple of four bytes. whole_word_count, r...
1274fbab4fe32c35694cb4fba3b81a0b7cd20196 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/1274fbab4fe32c35694cb4fba3b81a0b7cd20196/pdfutils.py
assert ((85**4) * c1) + ((85**3) * c2) + ((85**2) * c3) + (85*c4) + c5 == num, 'dodgy code!' outstream.write(chr(c1+33)) outstream.write(chr(c2+33)) outstream.write(chr(c3+33)) outstream.write(chr(c4+33)) outstream.write(chr(c5+33)) if remainder_size > 0: while len(lastbit) < 4: lastbit = lastbit + '\000' b1 = or...
lastword = chr(c1+33) + chr(c2+33) + chr(c3+33) + chr(c4+33) + chr(c5+33) outstream.write(lastword[0:remainder_size + 1]) outstream.write('~>') outstream.reset() return outstream.read()
def _AsciiBase85Encode(input): """This is a compact encoding used for binary data within a PDF file. Four bytes of binary data become five bytes of ASCII. This is the default method used for encoding images.""" outstream = cStringIO.StringIO() # special rules apply if not a multiple of four bytes. whole_word_count, r...
1274fbab4fe32c35694cb4fba3b81a0b7cd20196 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/1274fbab4fe32c35694cb4fba3b81a0b7cd20196/pdfutils.py
num = ((85**4) * c1) + ((85**3) * c2) + ((85**2) * c3) + (85*c4) + c5
num = ((85L**4) * c1) + ((85**3) * c2) + ((85**2) * c3) + (85*c4) + c5
def _AsciiBase85Decode(input): """This is not used - Acrobat Reader decodes for you - but a round trip is essential for testing.""" outstream = cStringIO.StringIO() #strip all whitespace stripped = string.join(string.split(input),'') #check end assert stripped[-2:] == '~>', 'Invalid terminator for Ascii Base 85 Stream'...
1274fbab4fe32c35694cb4fba3b81a0b7cd20196 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/1274fbab4fe32c35694cb4fba3b81a0b7cd20196/pdfutils.py
num = ((85**4) * c1) + ((85**3) * c2) + ((85**2) * c3) + (85*c4) + c5
num = ((85L**4) * c1) + ((85**3) * c2) + ((85**2) * c3) + (85*c4) + c5
def _AsciiBase85Decode(input): """This is not used - Acrobat Reader decodes for you - but a round trip is essential for testing.""" outstream = cStringIO.StringIO() #strip all whitespace stripped = string.join(string.split(input),'') #check end assert stripped[-2:] == '~>', 'Invalid terminator for Ascii Base 85 Stream'...
1274fbab4fe32c35694cb4fba3b81a0b7cd20196 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/1274fbab4fe32c35694cb4fba3b81a0b7cd20196/pdfutils.py
return self.variColumn and [max(M[r:r+3]) for r in range(0,len(M),self.columnMaximum)] or max(M)
if not M: return 0 if self.variColumn: columnMaximum = self.columnMaximum return [max(M[r:r+columnMaximum]) for r in range(0,len(M),self.columnMaximum)] else: return max(M)
def _calculateMaxWidth(self, colorNamePairs): "Calculate the maximum width of some given strings." M = [] a = M.append for t in self._getTexts(colorNamePairs): m = [stringWidth(s, self.fontName, self.fontSize) for s in t.split('\n')] M.append(m and max(m) or 0) return self.variColumn and [max(M[r:r+3]) for r in range(0...
c53b125c5704bb025193860fd42f634f16941934 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c53b125c5704bb025193860fd42f634f16941934/legends.py
def bookmarkPage(self, key, fitType="Fit", left=None, top=None, bottom=None, right=None, zoom=None ): """ This creates a bookmark to the current page which can be referred to with the given key elsewhere.
60f52e5ef18896e2f4e75f2977dfeb9e704c9da0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/60f52e5ef18896e2f4e75f2977dfeb9e704c9da0/canvas.py
def bookmarkPage(self, key, fitType="Fit", left=None, top=None, bottom=None, right=None, zoom=None ): """ This creates a bookmark to the current page which can be referred to with the given key elsewhere.
60f52e5ef18896e2f4e75f2977dfeb9e704c9da0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/60f52e5ef18896e2f4e75f2977dfeb9e704c9da0/canvas.py
def bookmarkPage(self, key, fitType="Fit", left=None, top=None, bottom=None, right=None, zoom=None ): """ This creates a bookmark to the current page which can be referred to with the given key elsewhere.
60f52e5ef18896e2f4e75f2977dfeb9e704c9da0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/60f52e5ef18896e2f4e75f2977dfeb9e704c9da0/canvas.py
def bookmarkPage(self, key, fitType="Fit", left=None, top=None, bottom=None, right=None, zoom=None ): """ This creates a bookmark to the current page which can be referred to with the given key elsewhere.
60f52e5ef18896e2f4e75f2977dfeb9e704c9da0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/60f52e5ef18896e2f4e75f2977dfeb9e704c9da0/canvas.py
raise "Unknown Fit type %s" % (fitType,)
raise "Unknown Fit type %s" % (fitType,)
def bookmarkPage(self, key, fitType="Fit", left=None, top=None, bottom=None, right=None, zoom=None ): """ This creates a bookmark to the current page which can be referred to with the given key elsewhere.
60f52e5ef18896e2f4e75f2977dfeb9e704c9da0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/60f52e5ef18896e2f4e75f2977dfeb9e704c9da0/canvas.py
def bookmarkHorizontalAbsolute(self, key, yhorizontal): """Bind a bookmark (destination) to the current page at a horizontal position. Note that the yhorizontal of the book mark is with respect to the default user space (where the origin is at the lower left corner of the page) and completely ignores any transform (tra...
60f52e5ef18896e2f4e75f2977dfeb9e704c9da0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/60f52e5ef18896e2f4e75f2977dfeb9e704c9da0/canvas.py
def setPageRotation(self, rot): """Instruct display device that this page is to be rotated""" assert rot % 90.0 == 0.0, "Rotation must be a multiple of 90 degrees" self._pageRotation = rot
60f52e5ef18896e2f4e75f2977dfeb9e704c9da0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/60f52e5ef18896e2f4e75f2977dfeb9e704c9da0/canvas.py
self.onProgress('PASS', passes)
self._onProgress('PASS', passes)
def multiBuild(self, story, filename=None, canvasmaker=canvas.Canvas, maxPasses = 10): """Makes multiple passes until all indexing flowables are happy.""" self._indexingFlowables = [] #scan the story and keep a copy for thing in story: if thing.isIndexing(): self._indexingFlowables.append(thing) #print 'scanned story, ...
c59384708af152deb8f5b0589bdb19845b0dc893 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c59384708af152deb8f5b0589bdb19845b0dc893/doctemplate.py
print "file %s contains %d tab characters!" % (filename, tabCount)
self.output.write("file %s contains %d tab characters!\n" % (filename, tabCount))
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) print "file %s contains %d tab characters!" % (filename, tabCount)
0ede53a71e6045f9dc344ec382ef46d1239b6762 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0ede53a71e6045f9dc344ec382ef46d1239b6762/test_source_chars.py
print "file %s contains %d trailing spaces, or %0.2f%% wastage" % (filename, badChars, 100.0*badChars/initSize)
self.output.write("file %s contains %d trailing spaces, or %0.2f%% wastage" % (filename, badChars, 100.0*badChars/initSize))
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...
0ede53a71e6045f9dc344ec382ef46d1239b6762 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0ede53a71e6045f9dc344ec382ef46d1239b6762/test_source_chars.py
unittest.TextTestRunner().run(makeSuite())
unittest.TextTestRunner().run(makeSuite())
def makeSuite(): return makeSuiteForClasses(SourceTester)
0ede53a71e6045f9dc344ec382ef46d1239b6762 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0ede53a71e6045f9dc344ec382ef46d1239b6762/test_source_chars.py
if canv._pagesize != self.pagesize: if self.pagesize:
cp = None dp = None sp = None if canv._pagesize: cp = map(int, canv._pagesize) if self.pagesize: sp = map(int, self.pagesize) if doc.pagesize: dp = map(int, doc.pagesize) if cp != dp: if sp:
def checkPageSize(self,canv,doc): '''This gets called by the template framework''' if canv._pagesize != self.pagesize: if self.pagesize: canv.setPageSize(self.pagesize) elif canv._pagesize != doc.pagesize: canv.setPageSize(doc.pagesize)
5768eee302fd8f69f45f55735f45656ba2302bb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/5768eee302fd8f69f45f55735f45656ba2302bb8/doctemplate.py
elif canv._pagesize != doc.pagesize:
elif cp != dp:
def checkPageSize(self,canv,doc): '''This gets called by the template framework''' if canv._pagesize != self.pagesize: if self.pagesize: canv.setPageSize(self.pagesize) elif canv._pagesize != doc.pagesize: canv.setPageSize(doc.pagesize)
5768eee302fd8f69f45f55735f45656ba2302bb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/5768eee302fd8f69f45f55735f45656ba2302bb8/doctemplate.py
return ((enc.name == other.name) and (enc.vector == other.vector))
return ((self.name == other.name) and (self.vector == other.vector))
def isEqual(self, other): return ((enc.name == other.name) and (enc.vector == other.vector))
87bd4b5e0e2ed740fa9ce21945bf1d33ba07f10e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/87bd4b5e0e2ed740fa9ce21945bf1d33ba07f10e/pdfmetrics.py
print 'Attempting to register', fontName
def _SWRecover(text, fontName, fontSize, encoding): '''This is called when _rl_accel's database doesn't know about a font. Currently encoding is always a dummy. ''' try: print 'Attempting to register', fontName font = getFont(fontName) registerFont(font) print 'registered font %s' % fontName dumpFontData() return _stri...
30582afd1e049d9bcc9832e795804a48f8efc275 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/30582afd1e049d9bcc9832e795804a48f8efc275/pdfmetrics.py
print 'registered font %s' % fontName dumpFontData()
def _SWRecover(text, fontName, fontSize, encoding): '''This is called when _rl_accel's database doesn't know about a font. Currently encoding is always a dummy. ''' try: print 'Attempting to register', fontName font = getFont(fontName) registerFont(font) print 'registered font %s' % fontName dumpFontData() return _stri...
30582afd1e049d9bcc9832e795804a48f8efc275 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/30582afd1e049d9bcc9832e795804a48f8efc275/pdfmetrics.py
assert len(dataSeries[0]) > 2, msg
assert len(dataSeries[0]) >= 2, msg
def configure(self, dataSeries): """Let the axis configure its scale and range based on the data. Called after setPosition.Let it look at a list of lists of numbers determine the tick mark intervals. If valueMin, valueMax and valueStep are configured then it will use them; if any of them are set to Auto it will look ...
87dfae31e89526e461384da1a65816fe7635f09d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/87dfae31e89526e461384da1a65816fe7635f09d/axes0.py
assert len(dataSeries[0]) > 2, msg
assert len(dataSeries[0]) >= 2, msg
def configure(self, dataSeries): """Let the axis configure its scale and range based on the data. Called after setPosition.Let it look at a list of lists of numbers determine the tick mark intervals. If valueMin, valueMax and valueStep are configured then it will use them; if any of them are set to Auto it will look ...
87dfae31e89526e461384da1a65816fe7635f09d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/87dfae31e89526e461384da1a65816fe7635f09d/axes0.py
captionFont="Times-Italic", captionSize=12, background=None):
captionFont="Times-Italic", captionSize=12, background=None, captionTextColor=toColor('black'), captionBackColor=None):
def __init__(self, width, height, caption="", captionFont="Times-Italic", captionSize=12, background=None): Flowable.__init__(self) self.width = width self.figureHeight = height self.caption = caption self.background = background if self.caption: self.captionHeight = 0 # work out later self.captionStyle = ParagraphSty...
91379a97faec128ff30ff4b023e8144a370f7aca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/91379a97faec128ff30ff4b023e8144a370f7aca/figures.py
if self.caption: self.captionHeight = 0
self.spaceBefore = 12 self.spaceAfter = 12 def _getCaptionPara(self): caption = self.caption captionFont = self.captionFont captionSize = self.captionSize captionTextColor = self.captionTextColor captionBackColor = self.captionBackColor if self._captionData!=(caption,captionFont,captionSize,captionTextColor,captionBa...
def __init__(self, width, height, caption="", captionFont="Times-Italic", captionSize=12, background=None): Flowable.__init__(self) self.width = width self.figureHeight = height self.caption = caption self.background = background if self.caption: self.captionHeight = 0 # work out later self.captionStyle = ParagraphSty...
91379a97faec128ff30ff4b023e8144a370f7aca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/91379a97faec128ff30ff4b023e8144a370f7aca/figures.py
self.spaceBefore = 12 self.spaceAfter = 12
def __init__(self, width, height, caption="", captionFont="Times-Italic", captionSize=12, background=None): Flowable.__init__(self) self.width = width self.figureHeight = height self.caption = caption self.background = background if self.caption: self.captionHeight = 0 # work out later self.captionStyle = ParagraphSty...
91379a97faec128ff30ff4b023e8144a370f7aca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/91379a97faec128ff30ff4b023e8144a370f7aca/figures.py
def wrap(self, availWidth, availHeight):
def _scale(self,availWidth,availHeight):
def wrap(self, availWidth, availHeight): "Rescale to fit according to the rules, but only once" if self._scaleFactor is None or self.width>availWidth or self.height>availHeight: w, h = Figure.wrap(self, availWidth, availHeight) captionHeight = h - self.figureHeight if self.scaleFactor is None: #scale factor None means ...
91379a97faec128ff30ff4b023e8144a370f7aca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/91379a97faec128ff30ff4b023e8144a370f7aca/figures.py
Marius Gedminas $<mgedmin@codeworks.lt>$ with the help of Viktorija Zaksien $<viktorija@codeworks.lt>$
Marius Gedminas $mgedmin@codeworks.lt$ with the help of Viktorija Zaksien $viktorija@codeworks.lt$
def findFontName(path): "Extract a font name from an AFM file." f = open(path) found = 0 while not found: line = f.readline()[:-1] if not found and line[:16] == 'StartCharMetrics': raise FontNameNotFoundError, path if line[:8] == 'FontName': fontName = line[9:] found = 1 return fontName
b48ceb5929db5fdc6fd2f218e1dac0543a2d3b85 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b48ceb5929db5fdc6fd2f218e1dac0543a2d3b85/ch2a_fonts.py
disc("""Simple things are done simply; we use <b>$reportlab.pdfbase.ttfonts.TTFont<$</b> to create a true type
disc("""Simple things are done simply; we use <b>$reportlab.pdfbase.ttfonts.TTFont$</b> to create a true type
def findFontName(path): "Extract a font name from an AFM file." f = open(path) found = 0 while not found: line = f.readline()[:-1] if not found and line[:16] == 'StartCharMetrics': raise FontNameNotFoundError, path if line[:8] == 'FontName': fontName = line[9:] found = 1 return fontName
b48ceb5929db5fdc6fd2f218e1dac0543a2d3b85 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b48ceb5929db5fdc6fd2f218e1dac0543a2d3b85/ch2a_fonts.py
elif sys.platform in ('linux2',):
elif sys.platform in ('linux2','freebsd4',):
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
e1674f25178cd1fc3a685436f47cf30bd98aaf43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/e1674f25178cd1fc3a685436f47cf30bd98aaf43/rl_config.py
fontDir = diskName + ':Applications:Python 2.1:reportlab:fonts'
fontDir = diskName + ':Applications:Python %s:reportlab:fonts' % 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
e1674f25178cd1fc3a685436f47cf30bd98aaf43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/e1674f25178cd1fc3a685436f47cf30bd98aaf43/rl_config.py
else:
else:
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
e1674f25178cd1fc3a685436f47cf30bd98aaf43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/e1674f25178cd1fc3a685436f47cf30bd98aaf43/rl_config.py
sys_version = string.split(sys.version)[0]
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
e1674f25178cd1fc3a685436f47cf30bd98aaf43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/e1674f25178cd1fc3a685436f47cf30bd98aaf43/rl_config.py
tx.setTextWordSpacing(1.0 * extraspace / len(words))
tx.setWordSpace(extraspace / float(len(words)-1))
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite."""
f2c13bbc51f73592f40ce2429a8af7f1e78a655f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f2c13bbc51f73592f40ce2429a8af7f1e78a655f/layout.py
tx.setTextWordSpacing()
tx.setWordSpace(0.0)
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite."""
f2c13bbc51f73592f40ce2429a8af7f1e78a655f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f2c13bbc51f73592f40ce2429a8af7f1e78a655f/layout.py
elif style.alignment == TA_RIGHT:
elif self.style.alignment == TA_RIGHT:
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite."""
f2c13bbc51f73592f40ce2429a8af7f1e78a655f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f2c13bbc51f73592f40ce2429a8af7f1e78a655f/layout.py
elif style.alignment == TA_JUSTIFY: if lineno == len(lines) - 1:
elif self.style.alignment == TA_JUSTIFY: if lineno == len(self.lines) - 1:
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite."""
f2c13bbc51f73592f40ce2429a8af7f1e78a655f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f2c13bbc51f73592f40ce2429a8af7f1e78a655f/layout.py
tx.setTextWordSpacing(1.0 * extraspace / len(words))
tx.setWordSpace(extraspace / float(len(words)-1))
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite."""
f2c13bbc51f73592f40ce2429a8af7f1e78a655f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f2c13bbc51f73592f40ce2429a8af7f1e78a655f/layout.py
tx.setTextWordSpacing()
tx.setWordSpace(0.0)
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite."""
f2c13bbc51f73592f40ce2429a8af7f1e78a655f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f2c13bbc51f73592f40ce2429a8af7f1e78a655f/layout.py
def calcBarPositions0(self):
def calcBarPositions(self):
def calcBarPositions0(self): """Works out where they go.
40c058808accb2ea1c7dbd9e07048bb60043efa2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/40c058808accb2ea1c7dbd9e07048bb60043efa2/barchart1.py
def calcBarPositions0(self): """Works out where they go.
40c058808accb2ea1c7dbd9e07048bb60043efa2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/40c058808accb2ea1c7dbd9e07048bb60043efa2/barchart1.py
(groupX, groupWidth) = self.categoryAxis.scale(colNo) x = (groupX + (0.5 * self.groupSpacing * normFactor) + (rowNo * self.barWidth * normFactor) + (rowNo * self.barSpacing * normFactor) )
if self.useAbsolute: groupX = len(self.data) * self.barWidth + \ len(self.data) * self.barSpacing + \ self.groupSpacing groupX = groupX * colNo + 0.5 * self.groupSpacing + self.x x = groupX + rowNo * (self.barWidth + self.barSpacing) else: (groupX, groupWidth) = self.categoryAxis.scale(colNo) x = groupX + normFactor *...
def calcBarPositions0(self): """Works out where they go.
40c058808accb2ea1c7dbd9e07048bb60043efa2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/40c058808accb2ea1c7dbd9e07048bb60043efa2/barchart1.py
y = self.valueAxis.scale(0) height = self.valueAxis.scale(datum) - y barRow.append((x, y, width, height)) if self.debug: print "x, y, width, height:", x, y, width, height print "self.valueAxis.scale(10)", self.valueAxis.scale(self.valueAxis.valueMin) self._barPositions.append(barRow) def calcBarPositions(self): """...
def calcBarPositions0(self): """Works out where they go.
40c058808accb2ea1c7dbd9e07048bb60043efa2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/40c058808accb2ea1c7dbd9e07048bb60043efa2/barchart1.py
if Auto in (self.valueAxis.valueMin, self.valueAxis.valueMax): y = self.valueAxis.scale(self._findMinMaxValues()[0]) elif self.valueAxis.valueMin <= 0 <= self.valueAxis.valueMax: y = self.valueAxis.scale(0) elif 0 < self.valueAxis.valueMin: y = self.valueAxis.scale(self.valueAxis.valueMin) elif self.valueAxis.valueMax ...
scale = self.valueAxis.scale vm, vM = self.valueAxis.valueMin, self.valueAxis.valueMax if Auto in (vm, vM): y = scale(self._findMinMaxValues()[0]) elif vm <= 0 <= vM: y = scale(0) elif 0 < vm: y = scale(vm) elif vM < 0: y = scale(vM)
def calcBarPositions(self): """Works out where they go.
40c058808accb2ea1c7dbd9e07048bb60043efa2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/40c058808accb2ea1c7dbd9e07048bb60043efa2/barchart1.py
def calcBarPositions(self): """Works out where they go.
40c058808accb2ea1c7dbd9e07048bb60043efa2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/40c058808accb2ea1c7dbd9e07048bb60043efa2/barchart1.py
def draw(self): self.valueAxis.configure(self.data) self.valueAxis.setPosition(self.x, self.y, self.height)
40c058808accb2ea1c7dbd9e07048bb60043efa2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/40c058808accb2ea1c7dbd9e07048bb60043efa2/barchart1.py
dataSample5 = [(10, 20), (20, 30), (30, 40), (40, 50), (50, 60)]
dataSample5 = [(10, 60), (20, 50), (30, 40), (40, 30)]
def sample4d(): "Make a bar chart showing value axis region entirely *below* zero." drawing = Drawing(400, 200) data = [(-13, -20)] bc = VerticalBarChart() bc.x = 50 bc.y = 50 bc.height = 125 bc.width = 300 bc.data = data bc.strokeColor = colors.black bc.valueAxis.valueMin = -30 bc.valueAxis.valueMax = -10 bc.valu...
40c058808accb2ea1c7dbd9e07048bb60043efa2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/40c058808accb2ea1c7dbd9e07048bb60043efa2/barchart1.py
assert not filter(lambda x: isinstance(x,LCActionFlowable),V),'LCActionFlowables not allowed in sublists'
assert not [x for x in V if isinstance(x,LCActionFlowable)],'LCActionFlowables not allowed in sublists'
def _flowableSublist(V): "if it isn't a list or tuple, wrap it in a list" if type(V) not in (ListType, TupleType): V = V is not None and [V] or [] from doctemplate import LCActionFlowable assert not filter(lambda x: isinstance(x,LCActionFlowable),V),'LCActionFlowables not allowed in sublists' return V
7b054323c16657bdb4240e0ad1aca230f9dda915 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7b054323c16657bdb4240e0ad1aca230f9dda915/flowables.py
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...
ed9b89c7e69c64a7ae0be13947d06bddc187b424 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ed9b89c7e69c64a7ae0be13947d06bddc187b424/tables.py
if getattr(self,'_width_calculated_once',None): return
def _calc_width(self,availWidth,W=None): #comments added by Andy to Robin's slightly #terse variable names if not W: W = _calc_pc(self._argW,availWidth) #widths array #print 'widths array = %s' % str(self._colWidths) canv = getattr(self,'canv',None) saved = None
ed9b89c7e69c64a7ae0be13947d06bddc187b424 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ed9b89c7e69c64a7ae0be13947d06bddc187b424/tables.py
canv = getattr(self,'canv',None) saved = None
def _calc_width(self,availWidth,W=None): #comments added by Andy to Robin's slightly #terse variable names if not W: W = _calc_pc(self._argW,availWidth) #widths array #print 'widths array = %s' % str(self._colWidths) canv = getattr(self,'canv',None) saved = None
ed9b89c7e69c64a7ae0be13947d06bddc187b424 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ed9b89c7e69c64a7ae0be13947d06bddc187b424/tables.py
if self._spanCmds: colspans = self._colSpannedCells else: colspans = {}
canv = getattr(self,'canv',None) saved = None colSpanCells = self._spanCmds and self._colSpanCells or ()
def _calc_width(self,availWidth,W=None): #comments added by Andy to Robin's slightly #terse variable names if not W: W = _calc_pc(self._argW,availWidth) #widths array #print 'widths array = %s' % str(self._colWidths) canv = getattr(self,'canv',None) saved = None
ed9b89c7e69c64a7ae0be13947d06bddc187b424 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ed9b89c7e69c64a7ae0be13947d06bddc187b424/tables.py
if colspans.has_key((j, i)):
if (j, i) in colSpanCells:
def _calc_width(self,availWidth,W=None): #comments added by Andy to Robin's slightly #terse variable names if not W: W = _calc_pc(self._argW,availWidth) #widths array #print 'widths array = %s' % str(self._colWidths) canv = getattr(self,'canv',None) saved = None
ed9b89c7e69c64a7ae0be13947d06bddc187b424 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ed9b89c7e69c64a7ae0be13947d06bddc187b424/tables.py
def _calc_width(self,availWidth,W=None): #comments added by Andy to Robin's slightly #terse variable names if not W: W = _calc_pc(self._argW,availWidth) #widths array #print 'widths array = %s' % str(self._colWidths) canv = getattr(self,'canv',None) saved = None
ed9b89c7e69c64a7ae0be13947d06bddc187b424 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ed9b89c7e69c64a7ae0be13947d06bddc187b424/tables.py
def _calc_width(self,availWidth,W=None): #comments added by Andy to Robin's slightly #terse variable names if not W: W = _calc_pc(self._argW,availWidth) #widths array #print 'widths array = %s' % str(self._colWidths) canv = getattr(self,'canv',None) saved = None
ed9b89c7e69c64a7ae0be13947d06bddc187b424 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ed9b89c7e69c64a7ae0be13947d06bddc187b424/tables.py
def _calc_width(self,availWidth,W=None): #comments added by Andy to Robin's slightly #terse variable names if not W: W = _calc_pc(self._argW,availWidth) #widths array #print 'widths array = %s' % str(self._colWidths) canv = getattr(self,'canv',None) saved = None
ed9b89c7e69c64a7ae0be13947d06bddc187b424 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ed9b89c7e69c64a7ae0be13947d06bddc187b424/tables.py
canv = getattr(self,'canv',None) saved = None if self._spanCmds: spans = self._rowSpannedCells else: spans = {}
def _calc_height(self, availHeight, availWidth, H=None, W=None):
ed9b89c7e69c64a7ae0be13947d06bddc187b424 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ed9b89c7e69c64a7ae0be13947d06bddc187b424/tables.py
if spans.has_key((j, i)):
ji = j,i if ji in rowSpanCells:
def _calc_height(self, availHeight, availWidth, H=None, W=None):
ed9b89c7e69c64a7ae0be13947d06bddc187b424 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ed9b89c7e69c64a7ae0be13947d06bddc187b424/tables.py
def _calc_height(self, availHeight, availWidth, H=None, W=None):
ed9b89c7e69c64a7ae0be13947d06bddc187b424 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ed9b89c7e69c64a7ae0be13947d06bddc187b424/tables.py
def _calc_height(self, availHeight, availWidth, H=None, W=None):
ed9b89c7e69c64a7ae0be13947d06bddc187b424 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ed9b89c7e69c64a7ae0be13947d06bddc187b424/tables.py
def _calc(self, availWidth, availHeight): #if hasattr(self,'_width'): return
ed9b89c7e69c64a7ae0be13947d06bddc187b424 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ed9b89c7e69c64a7ae0be13947d06bddc187b424/tables.py
if hasattr(self,'_width_calculated_once'): return self._width_calculated_once = 1
def _calc(self, availWidth, availHeight): #if hasattr(self,'_width'): return
ed9b89c7e69c64a7ae0be13947d06bddc187b424 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ed9b89c7e69c64a7ae0be13947d06bddc187b424/tables.py
def _calc(self, availWidth, availHeight): #if hasattr(self,'_width'): return
ed9b89c7e69c64a7ae0be13947d06bddc187b424 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ed9b89c7e69c64a7ae0be13947d06bddc187b424/tables.py
spanRanges = {} for row in range(self._nrows): for col in range(self._ncols): spanRanges[(col, row)] = (col, row, col, row)
self._spanRanges = spanRanges = {} for x in xrange(self._ncols): for y in xrange(self._nrows): spanRanges[x,y] = (x, y, x, y) self._colSpanCells = [] self._rowSpanCells = [] csa = self._colSpanCells.append rsa = self._rowSpanCells.append
def _calcSpanRanges(self): """Work out rects for tables which do row and column spanning.
ed9b89c7e69c64a7ae0be13947d06bddc187b424 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ed9b89c7e69c64a7ae0be13947d06bddc187b424/tables.py
if x0 > x1: x0, x1 = x1, x0 if y0 > y1: y0, y1 = y1, y0 for y in xrange(y0, y1+1): for x in xrange(x0, x1+1): spanRanges[x, y] = None spanRanges[x0,y0] = (x0, y0, x1, y1) self._spanRanges = spanRanges colSpannedCells = {} for (key, value) in spanRanges.items(): if value is None: colSpannedCells[key] = 1 elif...
if x0 > x1: x0, x1 = x1, x0 if y0 > y1: y0, y1 = y1, y0 if x0!=x1 or y0!=y1: if x0!=x1: for y in xrange(y0, y1+1): for x in xrange(x0,x1+1): csa((x,y)) if y0!=y1: for y in xrange(y0, y1+1): for x in xrange(x0,x1+1): rsa((x,y)) for y in xrange(y0, y1+1): for x in xrange(x0,x1+1): spanRanges[x,y] = None spanRanges[x...
def _calcSpanRanges(self): """Work out rects for tables which do row and column spanning.
ed9b89c7e69c64a7ae0be13947d06bddc187b424 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ed9b89c7e69c64a7ae0be13947d06bddc187b424/tables.py
def _calcSpanRects(self): """Work out rects for tables which do row and column spanning.
ed9b89c7e69c64a7ae0be13947d06bddc187b424 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ed9b89c7e69c64a7ae0be13947d06bddc187b424/tables.py
import logger
from reportlab.lib import logger
def stringWidth(self, text, fontName, fontSize, encoding=None): "gets width of a string in the given font and size" if encoding is not None: import logger logger.warnOnce('encoding argument to Canvas.stringWidth is deprecated and has no effect!') #if encoding is None: encoding = self._doc.encoding return pdfmetrics.str...
fd55d5c6b9e402b9f549dbf6d6908f4f4c356031 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/fd55d5c6b9e402b9f549dbf6d6908f4f4c356031/canvas.py
'''shouldn't normally be called directly'''
'''Perform actions required at beginning of page. shouldn't normally be called directly'''
def handle_pageBegin(self): '''shouldn't normally be called directly''' self.page = self.page + 1 self.pageTemplate.drawPage(self.canv,self) self.pageTemplate.onPage(self.canv,self) if hasattr(self,'_nextFrameIndex'): del self._nextFrameIndex self.frame = self.pageTemplate.frames[0] self.handle_frameBegin()
2308046a6bba89b2245e9e88a7b7491f6ed0d2d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2308046a6bba89b2245e9e88a7b7491f6ed0d2d7/doctemplate.py
val = string.atoi(val,16)
b = 16 elif string.lower(val[:2]) == '0x': b = 16 val = val[2:] val = string.atoi(val,b)
def HexColor(val): """This class converts a hex string, or an actual integer number, into the corresponding color. E.g., in "AABBCC" or 0xAABBCC, AA is the red, BB is the green, and CC is the blue (00-FF). HTML uses a hex string with a preceding hash; if this is present, it is stripped off. (AR, 3-3-2000) """ if ty...
0b27b1794376ae69f5568d27adffe3d64cca6730 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0b27b1794376ae69f5568d27adffe3d64cca6730/colors.py
namedColors = {}
__namedColors = {}
def getAllNamedColors(): #returns a dictionary of all the named ones in the module # uses a singleton for efficiency import colors namedColors = {} for (name, value) in colors.__dict__.items(): if isinstance(value, Color): namedColors[name] = value return namedColors
0b27b1794376ae69f5568d27adffe3d64cca6730 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0b27b1794376ae69f5568d27adffe3d64cca6730/colors.py