rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
print 'dumpXPreforemattedLines(%s)' % str(P)
print '\n
def dumpXPreformattedLines(P): print 'dumpXPreforemattedLines(%s)' % str(P) lines = P.bfrags.lines n =len(lines) for l in range(n): line = lines[l] words = line.words nwords = len(words) print 'line%d: %d(%d)\n ' % (l,nwords,line.wordCount), for w in range(nwords): print "%d:'%s'"%(w,words[w].text), print
a36e673fba04517a1c94d01a71ca1aa8aa7ba1f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a36e673fba04517a1c94d01a71ca1aa8aa7ba1f8/xpreformatted.py
print 'dumpXPreforemattedFrags(%s)' % str(P)
print '\n
def dumpXPreformattedFrags(P): print 'dumpXPreforemattedFrags(%s)' % str(P) frags = P.frags n =len(frags) for l in range(n): print "frag%d: '%s'" % (l, frags[l].text) l = 0 for L in _getFragLines(frags): n=0 for W in _getFragWords(L): print "frag%d.%d: size=%d" % (l, n, W[0]), n = n + 1 for w in W[1:]: print "'%s'" % w[1], print l = l + 1
a36e673fba04517a1c94d01a71ca1aa8aa7ba1f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a36e673fba04517a1c94d01a71ca1aa8aa7ba1f8/xpreformatted.py
def try_it(text,style,dedent):
def try_it(text,style,dedent,aW,aH):
def try_it(text,style,dedent): P=XPreformatted(text,style,dedent=dedent) dumpXPreformattedFrags(P) aW, aH = 456.0, 42.8 w,h = P.wrap(aW, aH) dumpXPreformattedLines(P) S = P.split(aW,aH) for s in S: s.wrap(aW,aH) dumpXPreformattedLines(s) aH = 500
a36e673fba04517a1c94d01a71ca1aa8aa7ba1f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a36e673fba04517a1c94d01a71ca1aa8aa7ba1f8/xpreformatted.py
aW, aH = 456.0, 42.8
def try_it(text,style,dedent): P=XPreformatted(text,style,dedent=dedent) dumpXPreformattedFrags(P) aW, aH = 456.0, 42.8 w,h = P.wrap(aW, aH) dumpXPreformattedLines(P) S = P.split(aW,aH) for s in S: s.wrap(aW,aH) dumpXPreformattedLines(s) aH = 500
a36e673fba04517a1c94d01a71ca1aa8aa7ba1f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a36e673fba04517a1c94d01a71ca1aa8aa7ba1f8/xpreformatted.py
for (text,dedent,style) in [('''
for (text,dedent,style, aW, aH, active) in [('''
def try_it(text,style,dedent): P=XPreformatted(text,style,dedent=dedent) dumpXPreformattedFrags(P) aW, aH = 456.0, 42.8 w,h = P.wrap(aW, aH) dumpXPreformattedLines(P) S = P.split(aW,aH) for s in S: s.wrap(aW,aH) dumpXPreformattedLines(s) aH = 500
a36e673fba04517a1c94d01a71ca1aa8aa7ba1f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a36e673fba04517a1c94d01a71ca1aa8aa7ba1f8/xpreformatted.py
''',0,DTstyle),
''',0,DTstyle, 456.0, 42.8, 0),
def try_it(text,style,dedent): P=XPreformatted(text,style,dedent=dedent) dumpXPreformattedFrags(P) aW, aH = 456.0, 42.8 w,h = P.wrap(aW, aH) dumpXPreformattedLines(P) S = P.split(aW,aH) for s in S: s.wrap(aW,aH) dumpXPreformattedLines(s) aH = 500
a36e673fba04517a1c94d01a71ca1aa8aa7ba1f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a36e673fba04517a1c94d01a71ca1aa8aa7ba1f8/xpreformatted.py
''',3,DTstyle),
''',3, DTstyle, 456.0, 42.8, 0), ("""\ <font color=blue>class </font><font color=red>FastXMLParser</font>: def nonsense(self): self.foo = 'bar' """,0, styleSheet['Code'], 456.0, 4.8, 1),
def try_it(text,style,dedent): P=XPreformatted(text,style,dedent=dedent) dumpXPreformattedFrags(P) aW, aH = 456.0, 42.8 w,h = P.wrap(aW, aH) dumpXPreformattedLines(P) S = P.split(aW,aH) for s in S: s.wrap(aW,aH) dumpXPreformattedLines(s) aH = 500
a36e673fba04517a1c94d01a71ca1aa8aa7ba1f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a36e673fba04517a1c94d01a71ca1aa8aa7ba1f8/xpreformatted.py
try_it(text,style,dedent)
if active: try_it(text,style,dedent,aW,aH)
def try_it(text,style,dedent): P=XPreformatted(text,style,dedent=dedent) dumpXPreformattedFrags(P) aW, aH = 456.0, 42.8 w,h = P.wrap(aW, aH) dumpXPreformattedLines(P) S = P.split(aW,aH) for s in S: s.wrap(aW,aH) dumpXPreformattedLines(s) aH = 500
a36e673fba04517a1c94d01a71ca1aa8aa7ba1f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a36e673fba04517a1c94d01a71ca1aa8aa7ba1f8/xpreformatted.py
def try_it(text,style,dedent): P=XPreformatted(text,style,dedent=dedent) dumpXPreformattedFrags(P) aW, aH = 456.0, 42.8 w,h = P.wrap(aW, aH) dumpXPreformattedLines(P) S = P.split(aW,aH) for s in S: s.wrap(aW,aH) dumpXPreformattedLines(s) aH = 500
a36e673fba04517a1c94d01a71ca1aa8aa7ba1f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a36e673fba04517a1c94d01a71ca1aa8aa7ba1f8/xpreformatted.py
msg = "Missing attribute %s from %s" % (key, self)
msg = "Missing attribute %s from %s" % (attr, self)
def verify(self): """If the _attrMap attribute is not None, this checks all expected attributes are present; no unwanted attributes are present; and (if a checking function is found) checks each attribute has a valid value. Either succeeds or raises an informative exception. """
815d4e1cddc874b4209fc5d769aec5f8a5518372 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/815d4e1cddc874b4209fc5d769aec5f8a5518372/widgetbase.py
def verify(self): """If the _attrMap attribute is not None, this checks all expected attributes are present; no unwanted attributes are present; and (if a checking function is found) checks each attribute has a valid value. Either succeeds or raises an informative exception. """
815d4e1cddc874b4209fc5d769aec5f8a5518372 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/815d4e1cddc874b4209fc5d769aec5f8a5518372/widgetbase.py
print 'saved', self._filename
if type(self._filename)==StringType: name = self._filename else: if hasattr(self._filename,'name'): name = self._filename.name else: name = '<Unknown>' print 'saved', name
def save(self): """Saves the file. If holding data, do a showPage() to save them having to.""" if len(self._code): self.showPage()
7e33cd84b066a5228a25cefa7293d48058fe10c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7e33cd84b066a5228a25cefa7293d48058fe10c4/canvas.py
def __init__(self, name): self.name = name self.glyphNames = [] self.glyphWidths = {} self.ascent = 0 self.descent = 0 if name == 'ZapfDingbats': self.requiredEncoding = 'ZapfDingbatsEncoding' elif name == 'Symbol': self.requiredEncoding = 'SymbolEncoding' else: self.requiredEncoding = None
b3b647c0d8246cc94a374dc168c8dd3a2479362d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b3b647c0d8246cc94a374dc168c8dd3a2479362d/pdfmetrics.py
def _loadBuiltInData(self, name): """Called for the built in 14 fonts. Gets their glyph data.
b3b647c0d8246cc94a374dc168c8dd3a2479362d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b3b647c0d8246cc94a374dc168c8dd3a2479362d/pdfmetrics.py
self.fileName = im.fileName
self.fileName = fileName
def __init__(self, fileName): if isinstance(fileName,ImageReader): self.__dict__ = fileName.__dict__ #borgize return if not haveImages: raise RuntimeError('Imaging Library not available, unable to import bitmaps') #start wih lots of null private fields, to be populated by #the relevant engine. self.fileName = fileName self._image = None self._width = None self._height = None self._transparent = None self._data = None if _isPILImage(fileName): self._image = fileName self.fp = fileName.fp try: self.fileName = im.fileName except AttributeError: self.fileName = 'PILIMAGE_%d' % id(self) else: try: self.fp = open_for_read(fileName,'b') #detect which library we are using and open the image if sys.platform[0:4] == 'java': from javax.imageio import ImageIO self._image = ImageIO.read(self.fp) else: import PIL.Image self._image = PIL.Image.open(self.fp) if self._image=='JPEG': self.jpeg_fh = self._jpeg_fp except: et,ev,tb = sys.exc_info() if hasattr(ev,'args'): a = str(ev.args[-1])+(' fileName='+fileName) ev.args= ev.args[:-1]+(a,) raise et,ev,tb else: raise
dad851f9ce2c556b826d97a1d9122fe80e130dfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/dad851f9ce2c556b826d97a1d9122fe80e130dfb/utils.py
self.data = [1]
self.data = [1,1]
def __init__(self): self.x = 0 self.y = 0 self.width = 100 self.height = 100 self.data = [1] self.labels = None # or list of strings self.startAngle = 90 self.direction = "clockwise"
2d57ef3fa5f6f2cc84d02f85f0b434b83c665873 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2d57ef3fa5f6f2cc84d02f85f0b434b83c665873/doughnut.py
n = len(normData)
n = len(normData)
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(normData)
2d57ef3fa5f6f2cc84d02f85f0b434b83c665873 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2d57ef3fa5f6f2cc84d02f85f0b434b83c665873/doughnut.py
labels = [''] * n
labels = [] if type(n) not in (ListType,TupleType): labels = [''] * n else: for m in n: labels = labels + [''] * m
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(normData)
2d57ef3fa5f6f2cc84d02f85f0b434b83c665873 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2d57ef3fa5f6f2cc84d02f85f0b434b83c665873/doughnut.py
i = n-len(labels) if i>0: labels = labels + ['']*i
if type(n) not in (ListType,TupleType): i = n-len(labels) if i>0: labels = labels + ['']*i else: tlab = 0 for m in n: tlab = tlab+m i = tlab-len(labels) if i>0: labels = labels + ['']*i
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(normData)
2d57ef3fa5f6f2cc84d02f85f0b434b83c665873 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2d57ef3fa5f6f2cc84d02f85f0b434b83c665873/doughnut.py
styleCount = len(self.slices)
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(normData)
2d57ef3fa5f6f2cc84d02f85f0b434b83c665873 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2d57ef3fa5f6f2cc84d02f85f0b434b83c665873/doughnut.py
if n > 1:
if type(n) in (ListType,TupleType):
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(normData)
2d57ef3fa5f6f2cc84d02f85f0b434b83c665873 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2d57ef3fa5f6f2cc84d02f85f0b434b83c665873/doughnut.py
elif n==1:
else:
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(normData)
2d57ef3fa5f6f2cc84d02f85f0b434b83c665873 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2d57ef3fa5f6f2cc84d02f85f0b434b83c665873/doughnut.py
i = i + 1
if labels[i] != "": averageAngle = (a1+a2)/2.0 aveAngleRadians = averageAngle*pi/180.0 labelRadius = sectorStyle.labelRadius labelX = centerx + (0.5 * self.width * cos(aveAngleRadians) * labelRadius) labelY = centery + (0.5 * self.height * sin(aveAngleRadians) * labelRadius) theLabel = String(labelX, labelY, labels[i]) theLabel.textAnchor = "middle" theLabel.fontSize = sectorStyle.fontSize theLabel.fontName = sectorStyle.fontName theLabel.fillColor = sectorStyle.fontColor g.add(theLabel) i = i + 1
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(normData)
2d57ef3fa5f6f2cc84d02f85f0b434b83c665873 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2d57ef3fa5f6f2cc84d02f85f0b434b83c665873/doughnut.py
i = 0 if labels[i] != "": averageAngle = (a1+a2)/2.0 aveAngleRadians = averageAngle*pi/180.0 labelRadius = sectorStyle.labelRadius labelX = centerx + (0.5 * self.width * cos(aveAngleRadians) * labelRadius) labelY = centery + (0.5 * self.height * sin(aveAngleRadians) * labelRadius) theLabel = String(labelX, labelY, labels[i]) theLabel.textAnchor = "middle" theLabel.fontSize = sectorStyle.fontSize theLabel.fontName = sectorStyle.fontName theLabel.fillColor = sectorStyle.fontColor g.add(theLabel) i = i + 1
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(normData)
2d57ef3fa5f6f2cc84d02f85f0b434b83c665873 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2d57ef3fa5f6f2cc84d02f85f0b434b83c665873/doughnut.py
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(normData)
2d57ef3fa5f6f2cc84d02f85f0b434b83c665873 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2d57ef3fa5f6f2cc84d02f85f0b434b83c665873/doughnut.py
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(normData)
2d57ef3fa5f6f2cc84d02f85f0b434b83c665873 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2d57ef3fa5f6f2cc84d02f85f0b434b83c665873/doughnut.py
join = LINEJOINS[cap]
join = LINEJOINS[join]
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 command '+str(cmd))
d3da3b3403d1f67955a3d3fe0e6323a885262bba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d3da3b3403d1f67955a3d3fe0e6323a885262bba/tables.py
cmd = cmd[:7]+(join,)
cmd = cmd[:7]+(join,)+cmd[8:]
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 command '+str(cmd))
d3da3b3403d1f67955a3d3fe0e6323a885262bba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d3da3b3403d1f67955a3d3fe0e6323a885262bba/tables.py
fonts.addMapping(ttname, 0, 0, face.name)
if not face.name in standardFonts: fonts.addMapping(ttname, 0, 0, face.name)
def registerTypeFace(face): assert isinstance(face, TypeFace), 'Not a TypeFace: %s' % face _typefaces[face.name] = face # HACK - bold/italic do not apply for type 1, so egister # all combinations of mappings. from reportlab.lib import fonts ttname = string.lower(face.name) fonts.addMapping(ttname, 0, 0, face.name) fonts.addMapping(ttname, 1, 0, face.name) fonts.addMapping(ttname, 0, 1, face.name) fonts.addMapping(ttname, 1, 1, face.name)
0cbd135e4b0f4043222ecc8cddd8c26900fe2ab4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0cbd135e4b0f4043222ecc8cddd8c26900fe2ab4/pdfmetrics.py
f = self.labelTextFormat or (self._allIntTicks() and '%d' or str) elif f is str and self._allIntTicks(): f = '%d'
f = self.labelTextFormat or (self._allIntTicks() and '%.0f' or str) elif f is str and self._allIntTicks(): f = '%.0f'
def makeTickLabels(self): g = Group() if not self.visibleLabels: return g
f335901fd1273acca0b41a6ff8b4baeb3da1767d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f335901fd1273acca0b41a6ff8b4baeb3da1767d/axes.py
pn = os_path_normpath(pn)
pn = _startswith_rl(os_path_normpath(pn)) if not pn.endswith(os.sep): pn += os.sep
def rl_isdir(pn,os_path_isdir=os.path.isdir,os_path_normpath=os.path.normpath): if os_path_isdir(pn): return True if _isFSD or __loader__ is None: return False pn = os_path_normpath(pn) return len(filter(lambda x,pn=pn: x.startswith(pn),__loader__._files.keys()))>0
b09e1776eafba5ce413ee350d5cc2c0b9e6a2198 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b09e1776eafba5ce413ee350d5cc2c0b9e6a2198/utils.py
obj = self.__class__()
obj = isinstance(self,Drawing) and Drawing(self.width,self.height) or Group()
def expandUserNodes(self): """Return a new object which only contains primitive shapes."""
8a93038335ec60b8d5cce24677311ef0b3e129e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/8a93038335ec60b8d5cce24677311ef0b3e129e6/shapes.py
a = abs(valueMax) valueMax = valueMax + a valueMin = valueMin - a
if valueMax>0: valueMax = 1.2*valueMax valueMin = 0.0 else: valueMax = 0.0 valueMin = 1.2*valueMin
def _setRange(self, dataSeries): """Set minimum and maximum axis values.
d36d24e07e9a3464b1a7187a9e19fe650b40cbf7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d36d24e07e9a3464b1a7187a9e19fe650b40cbf7/axes.py
dir = dir and os.path.join(_archive,dir.replace('/',os.sep)) or _archive
dir = (dir=='.' or not dir) and _archive or os.path.join(_archive,dir.replace('/',os.sep))
def rl_get_module(name,dir): if sys.modules.has_key(name): om = sys.modules[name] del sys.modules[name] else: om = None try: f = None try: f, p, desc= imp.find_module(name,[dir]) return imp.load_module(name,f,p,desc) except: if isCompactDistro(): #attempt a load from inside the zip archive import zipimport dir = _startswith_rl(dir) dir = dir and os.path.join(_archive,dir.replace('/',os.sep)) or _archive zi = zipimport.zipimporter(dir) return zi.load_module(name) raise ImportError('%s[%s]' % (name,dir)) finally: if om: sys.modules[name] = om del om if f: f.close()
1a768d57e1c3dc6e3ec6727e002054813d37a0e7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/1a768d57e1c3dc6e3ec6727e002054813d37a0e7/utils.py
__namedColors = None
_namedColors = None
def colorDistance(col1, col2): """Returns a number between 0 and root(3) stating how similar two colours are - distance in r,g,b, space. Only used to find names for things.""" return math.sqrt( (col1.red - col2.red)**2 + (col1.green - col2.green)**2 + (col1.blue - col2.blue)**2 )
3daa68405a22f63b744187a24ada665bcc516ed9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3daa68405a22f63b744187a24ada665bcc516ed9/colors.py
if __namedColors is not None: return __namedColors
global _namedColors if _namedColors is not None: return _namedColors
def getAllNamedColors(): #returns a dictionary of all the named ones in the module # uses a singleton for efficiency if __namedColors is not None: return __namedColors import colors __namedColors = {} for (name, value) in colors.__dict__.items(): if isinstance(value, Color): __namedColors[name] = value return __namedColors
3daa68405a22f63b744187a24ada665bcc516ed9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3daa68405a22f63b744187a24ada665bcc516ed9/colors.py
__namedColors = {}
_namedColors = {}
def getAllNamedColors(): #returns a dictionary of all the named ones in the module # uses a singleton for efficiency if __namedColors is not None: return __namedColors import colors __namedColors = {} for (name, value) in colors.__dict__.items(): if isinstance(value, Color): __namedColors[name] = value return __namedColors
3daa68405a22f63b744187a24ada665bcc516ed9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3daa68405a22f63b744187a24ada665bcc516ed9/colors.py
__namedColors[name] = value return __namedColors
_namedColors[name] = value return _namedColors
def getAllNamedColors(): #returns a dictionary of all the named ones in the module # uses a singleton for efficiency if __namedColors is not None: return __namedColors import colors __namedColors = {} for (name, value) in colors.__dict__.items(): if isinstance(value, Color): __namedColors[name] = value return __namedColors
3daa68405a22f63b744187a24ada665bcc516ed9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3daa68405a22f63b744187a24ada665bcc516ed9/colors.py
map = aClass._attrMap.items() map.sort()
map = aClass._attrMap if map: map = map.items() map.sort() else: map = []
def beginAttributes(self, aClass): "Append a list of annotated attributes of a class."
4a5bb27eaec0f9d876dd0646b6d3c1ec3a053c46 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/4a5bb27eaec0f9d876dd0646b6d3c1ec3a053c46/graphdocpy.py
print 'wrap', aW, aH, W, H
def wrap(self, aW, aH): W = 0 H = 0 F = self._flowables for f in F: w,h = f.wrap(aW,0xfffffff) if f is not F[0]: h = h + f.getSpaceBefore() if f is not F[-1]: h = h + f.getSpaceAfter() W = max(W,w) H = H+h print 'wrap', aW, aH, W, H self._CPage = H>aH return W, 0xffffff # force a split
b6a4259602b81750399b1e972f992ebff49d4625 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b6a4259602b81750399b1e972f992ebff49d4625/flowables.py
print 'wrap', aW, aH, self._CPage
def split(self, aW, aH): print 'wrap', aW, aH, self._CPage S = self._CPage and [CondPageBreak(aH+1)] or [] for f in self._flowables: S.append(f) return S
b6a4259602b81750399b1e972f992ebff49d4625 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b6a4259602b81750399b1e972f992ebff49d4625/flowables.py
self.streamContent = string.join(imagedata[2:-1],'')
self.streamContent = string.join(imagedata[3:-1],'')
def loadImageFromA85(self,source): IMG=[] imagedata = map(string.strip,pdfutils.cacheImageFile(source,returnInMemory=1,IMG=IMG)) words = string.split(imagedata[1]) self.width, self.height = map(string.atoi,(words[1],words[3])) self.colorSpace = 'DeviceRGB' self.bitsPerComponent = 8 self._filters = 'A85','Fl' if IMG: self._checkTransparency(IMG[0]) else: self.mask = None self.streamContent = string.join(imagedata[2:-1],'')
c98308157a2e65808c8832c540199154d4451005 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c98308157a2e65808c8832c540199154d4451005/pdfdoc.py
from reportlab.pdfbase.pdfmetrics import _py_stringWidth, _py_getFont, registerFont
from reportlab.pdfbase.pdfmetrics import _py_stringWidth, getFont, registerFont, _fonts
def testStringWidth(self): from _rl_accel import stringWidthU from reportlab.pdfbase.pdfmetrics import _py_stringWidth, _py_getFont, registerFont from reportlab.pdfbase.ttfonts import TTFont from sys import getrefcount ttfn = 'Luxi-Serif' t1fn = 'Times-Roman' registerFont(TTFont(ttfn, "luxiserif.ttf")) ttf = _py_getFont(ttfn) t1f = _py_getFont(t1fn) testCp1252 = 'copyright %s trademark %s registered %s ReportLab! Ol%s!' % (chr(169), chr(153),chr(174), chr(0xe9)) enc='cp1252' senc = 'utf8' intern(senc) ts = 'ABCDEF\xce\x91\xce\xb2G' utext = 'ABCDEF\xce\x91\xce\xb2G'.decode('utf8') fontSize = 12. def tfunc(ts,fn,fontSize,enc): w1 = stringWidthU(ts,fn,fontSize,enc) w2 = _py_stringWidth(ts,fn,fontSize,enc) assert abs(w1-w2)<1e-10,"stringWidthU(%r,%r,%s,%r)-->%r != _py_stringWidth(...)-->%r" % (ts,fn,fontSize,enc,w1,w2) tfunc(testCp1252,t1fn,fontSize,enc) tfunc(ts,t1fn,fontSize,senc) tfunc(utext,t1fn,fontSize,senc) tfunc(ts,ttfn,fontSize,senc) tfunc(testCp1252,ttfn,fontSize,enc) tfunc(utext,ttfn,fontSize,senc)
ff2e54029ea3fa1ebe70a04b934bf428696c1312 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ff2e54029ea3fa1ebe70a04b934bf428696c1312/test_rl_accel.py
from sys import getrefcount
def testStringWidth(self): from _rl_accel import stringWidthU from reportlab.pdfbase.pdfmetrics import _py_stringWidth, _py_getFont, registerFont from reportlab.pdfbase.ttfonts import TTFont from sys import getrefcount ttfn = 'Luxi-Serif' t1fn = 'Times-Roman' registerFont(TTFont(ttfn, "luxiserif.ttf")) ttf = _py_getFont(ttfn) t1f = _py_getFont(t1fn) testCp1252 = 'copyright %s trademark %s registered %s ReportLab! Ol%s!' % (chr(169), chr(153),chr(174), chr(0xe9)) enc='cp1252' senc = 'utf8' intern(senc) ts = 'ABCDEF\xce\x91\xce\xb2G' utext = 'ABCDEF\xce\x91\xce\xb2G'.decode('utf8') fontSize = 12. def tfunc(ts,fn,fontSize,enc): w1 = stringWidthU(ts,fn,fontSize,enc) w2 = _py_stringWidth(ts,fn,fontSize,enc) assert abs(w1-w2)<1e-10,"stringWidthU(%r,%r,%s,%r)-->%r != _py_stringWidth(...)-->%r" % (ts,fn,fontSize,enc,w1,w2) tfunc(testCp1252,t1fn,fontSize,enc) tfunc(ts,t1fn,fontSize,senc) tfunc(utext,t1fn,fontSize,senc) tfunc(ts,ttfn,fontSize,senc) tfunc(testCp1252,ttfn,fontSize,enc) tfunc(utext,ttfn,fontSize,senc)
ff2e54029ea3fa1ebe70a04b934bf428696c1312 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ff2e54029ea3fa1ebe70a04b934bf428696c1312/test_rl_accel.py
ttf = _py_getFont(ttfn) t1f = _py_getFont(t1fn)
ttf = getFont(ttfn) t1f = getFont(t1fn)
def testStringWidth(self): from _rl_accel import stringWidthU from reportlab.pdfbase.pdfmetrics import _py_stringWidth, _py_getFont, registerFont from reportlab.pdfbase.ttfonts import TTFont from sys import getrefcount ttfn = 'Luxi-Serif' t1fn = 'Times-Roman' registerFont(TTFont(ttfn, "luxiserif.ttf")) ttf = _py_getFont(ttfn) t1f = _py_getFont(t1fn) testCp1252 = 'copyright %s trademark %s registered %s ReportLab! Ol%s!' % (chr(169), chr(153),chr(174), chr(0xe9)) enc='cp1252' senc = 'utf8' intern(senc) ts = 'ABCDEF\xce\x91\xce\xb2G' utext = 'ABCDEF\xce\x91\xce\xb2G'.decode('utf8') fontSize = 12. def tfunc(ts,fn,fontSize,enc): w1 = stringWidthU(ts,fn,fontSize,enc) w2 = _py_stringWidth(ts,fn,fontSize,enc) assert abs(w1-w2)<1e-10,"stringWidthU(%r,%r,%s,%r)-->%r != _py_stringWidth(...)-->%r" % (ts,fn,fontSize,enc,w1,w2) tfunc(testCp1252,t1fn,fontSize,enc) tfunc(ts,t1fn,fontSize,senc) tfunc(utext,t1fn,fontSize,senc) tfunc(ts,ttfn,fontSize,senc) tfunc(testCp1252,ttfn,fontSize,enc) tfunc(utext,ttfn,fontSize,senc)
ff2e54029ea3fa1ebe70a04b934bf428696c1312 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ff2e54029ea3fa1ebe70a04b934bf428696c1312/test_rl_accel.py
fontSize = 12.
fontSize = 12 defns="ttfn t1fn ttf t1f testCp1252 enc senc ts utext fontSize ttf.face ttf.face.charWidths ttf.face.defaultWidth t1f.widths t1f.encName t1f.substitutionFonts _fonts" rcv = getrc(defns)
def testStringWidth(self): from _rl_accel import stringWidthU from reportlab.pdfbase.pdfmetrics import _py_stringWidth, _py_getFont, registerFont from reportlab.pdfbase.ttfonts import TTFont from sys import getrefcount ttfn = 'Luxi-Serif' t1fn = 'Times-Roman' registerFont(TTFont(ttfn, "luxiserif.ttf")) ttf = _py_getFont(ttfn) t1f = _py_getFont(t1fn) testCp1252 = 'copyright %s trademark %s registered %s ReportLab! Ol%s!' % (chr(169), chr(153),chr(174), chr(0xe9)) enc='cp1252' senc = 'utf8' intern(senc) ts = 'ABCDEF\xce\x91\xce\xb2G' utext = 'ABCDEF\xce\x91\xce\xb2G'.decode('utf8') fontSize = 12. def tfunc(ts,fn,fontSize,enc): w1 = stringWidthU(ts,fn,fontSize,enc) w2 = _py_stringWidth(ts,fn,fontSize,enc) assert abs(w1-w2)<1e-10,"stringWidthU(%r,%r,%s,%r)-->%r != _py_stringWidth(...)-->%r" % (ts,fn,fontSize,enc,w1,w2) tfunc(testCp1252,t1fn,fontSize,enc) tfunc(ts,t1fn,fontSize,senc) tfunc(utext,t1fn,fontSize,senc) tfunc(ts,ttfn,fontSize,senc) tfunc(testCp1252,ttfn,fontSize,enc) tfunc(utext,ttfn,fontSize,senc)
ff2e54029ea3fa1ebe70a04b934bf428696c1312 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ff2e54029ea3fa1ebe70a04b934bf428696c1312/test_rl_accel.py
from reportlab.pdfbase.pdfmetrics import registerFont, _py_getFont
from reportlab.pdfbase.pdfmetrics import registerFont, getFont, _fonts, unicode2T1
def test_instanceStringWidth(self): from reportlab.pdfbase.pdfmetrics import registerFont, _py_getFont from reportlab.pdfbase.ttfonts import TTFont ttfn = 'Luxi-Serif' t1fn = 'Times-Roman' registerFont(TTFont(ttfn, "luxiserif.ttf")) ttf = _py_getFont(ttfn) t1f = _py_getFont(t1fn) testCp1252 = 'copyright %s trademark %s registered %s ReportLab! Ol%s!' % (chr(169), chr(153),chr(174), chr(0xe9)) enc='cp1252' senc = 'utf8' ts = 'ABCDEF\xce\x91\xce\xb2G' utext = 'ABCDEF\xce\x91\xce\xb2G'.decode(senc) fontSize = 12. def tfunc(f,ts,fontSize,enc): w1 = f.stringWidth(ts,fontSize,enc) w2 = f._py_stringWidth(ts,fontSize,enc) assert abs(w1-w2)<1e-10,"f(%r).stringWidthU(%r,%s,%r)-->%r != f._py_stringWidth(...)-->%r" % (f,ts,fontSize,enc,w1,w2) tfunc(t1f,testCp1252,fontSize,enc) tfunc(t1f,ts,fontSize,senc) tfunc(t1f,utext,fontSize,senc) tfunc(ttf,ts,fontSize,senc) tfunc(ttf,testCp1252,fontSize,enc) tfunc(ttf,utext,fontSize,senc)
ff2e54029ea3fa1ebe70a04b934bf428696c1312 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ff2e54029ea3fa1ebe70a04b934bf428696c1312/test_rl_accel.py
ttf = _py_getFont(ttfn) t1f = _py_getFont(t1fn)
ttf = getFont(ttfn) t1f = getFont(t1fn)
def test_instanceStringWidth(self): from reportlab.pdfbase.pdfmetrics import registerFont, _py_getFont from reportlab.pdfbase.ttfonts import TTFont ttfn = 'Luxi-Serif' t1fn = 'Times-Roman' registerFont(TTFont(ttfn, "luxiserif.ttf")) ttf = _py_getFont(ttfn) t1f = _py_getFont(t1fn) testCp1252 = 'copyright %s trademark %s registered %s ReportLab! Ol%s!' % (chr(169), chr(153),chr(174), chr(0xe9)) enc='cp1252' senc = 'utf8' ts = 'ABCDEF\xce\x91\xce\xb2G' utext = 'ABCDEF\xce\x91\xce\xb2G'.decode(senc) fontSize = 12. def tfunc(f,ts,fontSize,enc): w1 = f.stringWidth(ts,fontSize,enc) w2 = f._py_stringWidth(ts,fontSize,enc) assert abs(w1-w2)<1e-10,"f(%r).stringWidthU(%r,%s,%r)-->%r != f._py_stringWidth(...)-->%r" % (f,ts,fontSize,enc,w1,w2) tfunc(t1f,testCp1252,fontSize,enc) tfunc(t1f,ts,fontSize,senc) tfunc(t1f,utext,fontSize,senc) tfunc(ttf,ts,fontSize,senc) tfunc(ttf,testCp1252,fontSize,enc) tfunc(ttf,utext,fontSize,senc)
ff2e54029ea3fa1ebe70a04b934bf428696c1312 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ff2e54029ea3fa1ebe70a04b934bf428696c1312/test_rl_accel.py
fontSize = 12.
fontSize = 12 defns="ttfn t1fn ttf t1f testCp1252 enc senc ts utext fontSize ttf.face ttf.face.charWidths ttf.face.defaultWidth t1f.widths t1f.encName t1f.substitutionFonts _fonts" rcv = getrc(defns)
def test_instanceStringWidth(self): from reportlab.pdfbase.pdfmetrics import registerFont, _py_getFont from reportlab.pdfbase.ttfonts import TTFont ttfn = 'Luxi-Serif' t1fn = 'Times-Roman' registerFont(TTFont(ttfn, "luxiserif.ttf")) ttf = _py_getFont(ttfn) t1f = _py_getFont(t1fn) testCp1252 = 'copyright %s trademark %s registered %s ReportLab! Ol%s!' % (chr(169), chr(153),chr(174), chr(0xe9)) enc='cp1252' senc = 'utf8' ts = 'ABCDEF\xce\x91\xce\xb2G' utext = 'ABCDEF\xce\x91\xce\xb2G'.decode(senc) fontSize = 12. def tfunc(f,ts,fontSize,enc): w1 = f.stringWidth(ts,fontSize,enc) w2 = f._py_stringWidth(ts,fontSize,enc) assert abs(w1-w2)<1e-10,"f(%r).stringWidthU(%r,%s,%r)-->%r != f._py_stringWidth(...)-->%r" % (f,ts,fontSize,enc,w1,w2) tfunc(t1f,testCp1252,fontSize,enc) tfunc(t1f,ts,fontSize,senc) tfunc(t1f,utext,fontSize,senc) tfunc(ttf,ts,fontSize,senc) tfunc(ttf,testCp1252,fontSize,enc) tfunc(ttf,utext,fontSize,senc)
ff2e54029ea3fa1ebe70a04b934bf428696c1312 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ff2e54029ea3fa1ebe70a04b934bf428696c1312/test_rl_accel.py
from reportlab.pdfbase.pdfmetrics import _py_unicode2T1, _py_getFont
from reportlab.pdfbase.pdfmetrics import _py_unicode2T1, getFont, _fonts
def test_unicode2T1(self): from reportlab.pdfbase.pdfmetrics import _py_unicode2T1, _py_getFont from _rl_accel import unicode2T1 t1fn = 'Times-Roman' t1f = _py_getFont(t1fn) enc = 'cp1252' senc = 'utf8' testCp1252 = ('copyright %s trademark %s registered %s ReportLab! Ol%s!' % (chr(169), chr(153),chr(174), chr(0xe9))).decode(enc) utext = 'This is the end of the \xce\x91\xce\xb2 world. This is the end of the \xce\x91\xce\xb2 world jap=\xe3\x83\x9b\xe3\x83\x86. This is the end of the \xce\x91\xce\xb2 world. This is the end of the \xce\x91\xce\xb2 world jap=\xe3\x83\x9b\xe3\x83\x86'.decode('utf8') def tfunc(f,ts): w1 = unicode2T1(ts,[f]+f.substitutionFonts) w2 = _py_unicode2T1(ts,[f]+f.substitutionFonts) assert w1==w2,"%r != %r" % (w1,w2) tfunc(t1f,testCp1252) tfunc(t1f,utext)
ff2e54029ea3fa1ebe70a04b934bf428696c1312 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ff2e54029ea3fa1ebe70a04b934bf428696c1312/test_rl_accel.py
t1f = _py_getFont(t1fn)
t1f = getFont(t1fn)
def test_unicode2T1(self): from reportlab.pdfbase.pdfmetrics import _py_unicode2T1, _py_getFont from _rl_accel import unicode2T1 t1fn = 'Times-Roman' t1f = _py_getFont(t1fn) enc = 'cp1252' senc = 'utf8' testCp1252 = ('copyright %s trademark %s registered %s ReportLab! Ol%s!' % (chr(169), chr(153),chr(174), chr(0xe9))).decode(enc) utext = 'This is the end of the \xce\x91\xce\xb2 world. This is the end of the \xce\x91\xce\xb2 world jap=\xe3\x83\x9b\xe3\x83\x86. This is the end of the \xce\x91\xce\xb2 world. This is the end of the \xce\x91\xce\xb2 world jap=\xe3\x83\x9b\xe3\x83\x86'.decode('utf8') def tfunc(f,ts): w1 = unicode2T1(ts,[f]+f.substitutionFonts) w2 = _py_unicode2T1(ts,[f]+f.substitutionFonts) assert w1==w2,"%r != %r" % (w1,w2) tfunc(t1f,testCp1252) tfunc(t1f,utext)
ff2e54029ea3fa1ebe70a04b934bf428696c1312 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ff2e54029ea3fa1ebe70a04b934bf428696c1312/test_rl_accel.py
from reportlab.pdfbase.pdfmetrics import _py_getFont
from reportlab.pdfbase.pdfmetrics import _py_getFont, getFont
def test_getFont(self): from reportlab.pdfbase.pdfmetrics import _py_getFont from _rl_accel import getFontU t1fn = 'Times-Roman' assert _py_getFont(t1fn) is getFontU(t1fn)
ff2e54029ea3fa1ebe70a04b934bf428696c1312 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ff2e54029ea3fa1ebe70a04b934bf428696c1312/test_rl_accel.py
self.text = eval(string.join(newtext, ' '))
self.text = newtext
def normalizeText(self): """It contains literal XML text typed over several lines. We want to throw away tabs, newlines and so on, and only accept embedded string like '\n'""" lines = string.split(self.text, '\n') newtext = [] for line in lines: newtext.append(string.strip(line)) #eval turns all the escape sequences into real data self.text = eval(string.join(newtext, ' '))
64b3596f9d2c79e963222b1c3217db4f888feff4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/64b3596f9d2c79e963222b1c3217db4f888feff4/pythonpoint.py
lines = string.split(string.strip(self.text), '\n')
lines = string.split(string.strip(self.text), '\\n')
def drawOn(self, canv): if self.color is None: return lines = string.split(string.strip(self.text), '\n') canv.saveState() canv.setFont(self.font, self.size) r,g,b = self.color canv.setFillColorRGB(r,g,b) cur_y = self.y for line in lines: if self.align == layout.TA_LEFT: canv.drawString(self.x, cur_y, line) elif self.align == layout.TA_CENTER: canv.drawCentredString(self.x, cur_y, line) elif self.align == layout.TA_RIGHT: canv.drawRightString(self.x, cur_y, line) cur_y = cur_y - 1.2*self.size canv.restoreState()
64b3596f9d2c79e963222b1c3217db4f888feff4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/64b3596f9d2c79e963222b1c3217db4f888feff4/pythonpoint.py
x = AttrMapValue(isNumber, desc="The grid's lower-left x position."), y = AttrMapValue(isNumber, desc="The grid's lower-left y position."), width = AttrMapValue(isNumber, desc="The grid's width."), height = AttrMapValue(isNumber, desc="The grid's height."),
x = AttrMapValue(isNumber, desc="The grid's lower-left x position."), y = AttrMapValue(isNumber, desc="The grid's lower-left y position."), width = AttrMapValue(isNumber, desc="The grid's width."), height = AttrMapValue(isNumber, desc="The grid's height."),
def makeDistancesList(list): """Returns a list of distances between adjacent numbers in some input list. E.g. [1, 1, 2, 3, 5, 7] -> [0, 1, 1, 2, 2] """ d = [] for i in range(len(list[:-1])): d.append(list[i+1] - list[i]) return d
d44a67491d6da2320c4642fba7a0f805e02c6b3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d44a67491d6da2320c4642fba7a0f805e02c6b3e/grids.py
def demo(self): D = Drawing(100, 100)
d44a67491d6da2320c4642fba7a0f805e02c6b3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d44a67491d6da2320c4642fba7a0f805e02c6b3e/grids.py
group = Group() rect = Rect(self.x, self.y, self.width, self.height) rect.fillColor = self.fillColor rect.strokeColor = self.strokeColor rect.strokeWidth = self.strokeWidth return group
if self.fillColor or self.strokeColor and self.strokeWidth: rect = Rect(self.x, self.y, self.width, self.height) rect.fillColor = self.fillColor rect.strokeColor = self.strokeColor rect.strokeWidth = self.strokeWidth return rect else: return None
def makeOuterRect(self): # outer grid rectangle group = Group() #print 'Grid.makeOuterRect(%d, %d, %d, %d)' % (self.x, self.y, self.width, self.height) rect = Rect(self.x, self.y, self.width, self.height) rect.fillColor = self.fillColor rect.strokeColor = self.strokeColor rect.strokeWidth = self.strokeWidth
d44a67491d6da2320c4642fba7a0f805e02c6b3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d44a67491d6da2320c4642fba7a0f805e02c6b3e/grids.py
x = AttrMapValue(isNumber, desc="The grid's lower-left x position."), y = AttrMapValue(isNumber, desc="The grid's lower-left y position."), width = AttrMapValue(isNumber, desc="The grid's width."), height = AttrMapValue(isNumber, desc="The grid's height."), grid0 = AttrMapValue(None, desc="The first grid component."), grid1 = AttrMapValue(None, desc="The second grid component."),
x = AttrMapValue(isNumber, desc="The grid's lower-left x position."), y = AttrMapValue(isNumber, desc="The grid's lower-left y position."), width = AttrMapValue(isNumber, desc="The grid's width."), height = AttrMapValue(isNumber, desc="The grid's height."), grid0 = AttrMapValue(None, desc="The first grid component."), grid1 = AttrMapValue(None, desc="The second grid component."),
def draw(self): # general widget bits group = Group()
d44a67491d6da2320c4642fba7a0f805e02c6b3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d44a67491d6da2320c4642fba7a0f805e02c6b3e/grids.py
def draw(self): group = Group()
d44a67491d6da2320c4642fba7a0f805e02c6b3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d44a67491d6da2320c4642fba7a0f805e02c6b3e/grids.py
def draw(self): group = Group()
d44a67491d6da2320c4642fba7a0f805e02c6b3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d44a67491d6da2320c4642fba7a0f805e02c6b3e/grids.py
if g0.useRects == 1 and g1.useRects == 0: group.add(g0.draw()) group.add(g1.draw()) else: group.add(g1.draw()) group.add(g0.draw())
G = g0.useRects == 1 and g1.useRects == 0 and (g0,g1) or (g1,g0) for g in G: group.add(g.makeOuterRect()) for g in G: group.add(g.makeInnerTiles()) group.add(g.makeInnerLines())
def draw(self): group = Group()
d44a67491d6da2320c4642fba7a0f805e02c6b3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d44a67491d6da2320c4642fba7a0f805e02c6b3e/grids.py
print 'Error: '+ cmdname or cmd
print 'Error: '+ (cmdname or cmd)
def do_exec(cmd, cmdname=None): i=os.popen(cmd,'r') print i.read() i = i.close() if i is not None: if cmdname is not None: print 'Error: '+ cmdname or cmd sys.exit(1)
cbdf6ef8276d6a35d096c3ab1b0b0c5c88f67bc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/cbdf6ef8276d6a35d096c3ab1b0b0c5c88f67bc1/daily.py
dir = options[0][0]
dir = options[0]
def usage(code=0, msg=''): f = code and sys.stderr or sys.stdout if msg is not None: f.write(msg+'\n') f.write(\
d35025220ba00884f18aba97da43335e95e93acc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d35025220ba00884f18aba97da43335e95e93acc/runtests.py
if errmsg!='No module named _rl_accel': raise
if errMsg!='No module named _rl_accel': raise
def _AsciiHexDecode(input): """Decodes input using ASCII-Hex coding. Not used except to provide a test of the inverse function.""" #strip out all whitespace stripped = string.join(string.split(input),'') assert stripped[-1] == '>', 'Invalid terminator for Ascii Hex Stream' stripped = stripped[:-1] #chop off terminator assert len(stripped) % 2 == 0, 'Ascii Hex stream has odd number of bytes' i = 0 output = cStringIO.StringIO() while i < len(stripped): twobytes = stripped[i:i+2] output.write(chr(eval('0x'+twobytes))) i = i + 2 output.reset() return output.read()
74f208dda1fd005faedcd2926f31116af5521e91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/74f208dda1fd005faedcd2926f31116af5521e91/pdfutils.py
if errmsg!='No module named _rl_accel': raise
if errMsg!='No module named _rl_accel': raise
def _AsciiHexDecode(input): """Decodes input using ASCII-Hex coding. Not used except to provide a test of the inverse function.""" #strip out all whitespace stripped = string.join(string.split(input),'') assert stripped[-1] == '>', 'Invalid terminator for Ascii Hex Stream' stripped = stripped[:-1] #chop off terminator assert len(stripped) % 2 == 0, 'Ascii Hex stream has odd number of bytes' i = 0 output = cStringIO.StringIO() while i < len(stripped): twobytes = stripped[i:i+2] output.write(chr(eval('0x'+twobytes))) i = i + 2 output.reset() return output.read()
74f208dda1fd005faedcd2926f31116af5521e91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/74f208dda1fd005faedcd2926f31116af5521e91/pdfutils.py
fixedEnd = AttrMapValue(isNumberOrNone, desc="Non-zero for a fixed draw end"), fixedStart = AttrMapValue(isNumberOrNone, desc="Non-zero for a fixed draw start"),
fixedEnd = AttrMapValue(isNumberPair, desc="None or fixed draw ends +/-"), fixedStart = AttrMapValue(isNumberPair, desc="None or fixed draw starts +/-"),
def draw(self): _text = self._text self._text = _text or '' self.computeSize() self._text = _text g = Group() g.translate(self.x + self.dx, self.y + self.dy) g.rotate(self.angle)
5cc4f99e3578eea6ce379c682ec06623f9d54ba0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/5cc4f99e3578eea6ce379c682ec06623f9d54ba0/textlabels.py
def format(self, document): self.BBox = self.BBox or PDFArray([self.lowerx, self.lowery, self.upperx, self.uppery]) self.Matrix = self.Matrix or PDFArray([1, 0, 0, 1, 0, 0]) if not self.Annots: self.Annots = None else:
14b0740fdb9d776ee604f87700572cc47050ee90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/14b0740fdb9d776ee604f87700572cc47050ee90/pdfdoc.py
if self.mask=='auto': if PILImage.info.has_key("transparency") : transparency = PILImage.info["transparency"] * 3 (tred, tgreen, tblue) = map(ord, PILImage.palette.data[transparency:transparency+3]) self.mask = (tred, tred, tgreen, tgreen, tblue, tblue) else: self.mask = None
def loadImageFromPIL(self, PILImage): "Extracts the stream, width and height" zlib = import_zlib() if not zlib: return #standardize it to RGB. We could be more optimal later. if PILImage.mode <> 'RGB': PILImage = PILImage.convert('RGB') imgwidth, imgheight = PILImage.size raw = PILImage.tostring() assert(len(raw) == imgwidth * imgheight, "Wrong amount of data for image") compressed = zlib.compress(raw) encoded = pdfutils._AsciiBase85Encode(compressed) self.colorSpace = 'DeviceRGB' self.bitsPerComponent = 8 self.streamContent = encoded self.width = imgwidth self.height = imgheight
14b0740fdb9d776ee604f87700572cc47050ee90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/14b0740fdb9d776ee604f87700572cc47050ee90/pdfdoc.py
if self.mask=='auto': if PILImage.info.has_key("transparency") : transparency = PILImage.info["transparency"] * 3 (tred, tgreen, tblue) = map(ord, PILImage.palette.data[transparency:transparency+3]) self.mask = (tred, tred, tgreen, tgreen, tblue, tblue) dict["Mask"] = PDFArray(self.mask) else: dict["Mask"] = PDFArray(self.mask)
dict["Mask"] = PDFArray(self.mask)
def format(self, document): S = PDFStream() S.content = self.streamContent
14b0740fdb9d776ee604f87700572cc47050ee90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/14b0740fdb9d776ee604f87700572cc47050ee90/pdfdoc.py
def __init__(self, filename, **kw): frame1 = Frame(2.5*cm, 15.5*cm, 6*cm, 10*cm, id='F1') frame2 = Frame(11.5*cm, 15.5*cm, 6*cm, 10*cm, id='F2') frame3 = Frame(2.5*cm, 2.5*cm, 6*cm, 10*cm, id='F3') frame4 = Frame(11.5*cm, 2.5*cm, 6*cm, 10*cm, id='F4') self.allowSplitting = 0 self.showBoundary = 1 apply(BaseDocTemplate.__init__, (self, filename), kw) template = PageTemplate('normal', [frame1, frame2, frame3, frame4], myMainPageFrame) self.addPageTemplates(template)
21c1a3b419adb8df273febf1b9e4e11d4de6f845 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/21c1a3b419adb8df273febf1b9e4e11d4de6f845/test_platypus_breaking.py
def _test0(self): "This makes one long multi-page paragraph." # Build story. story = [] a = story.append styleSheet = getSampleStyleSheet() h1 = styleSheet['Heading1'] h1.pageBreakBefore = 1 h1.keepWithNext = 1 h2 = styleSheet['Heading2'] h2.frameBreakBefore = 1 h2.keepWithNext = 1 h3 = styleSheet['Heading3'] h3.backColor = colors.cyan h3.keepWithNext = 1 bt = styleSheet['BodyText'] a(Paragraph(""" Subsequent pages test pageBreakBefore, frameBreakBefore and keepTogether attributes. Generated at %s. The number in brackets at the end of each paragraph is its position in the story. (%d)""" % ( time.ctime(time.time()), len(story)), bt)) for i in range(10): a(Paragraph('Heading 1 always starts a new page (%d)' % len(story), h1)) for j in range(3): a(Paragraph('Heading1 paragraphs should always' 'have a page break before. Heading 2 on the other hand' 'should always have a FRAME break before (%d)' % len(story), bt)) a(Paragraph('Heading 2 always starts a new frame (%d)' % len(story), h2)) a(Paragraph('Heading1 paragraphs should always' 'have a page break before. Heading 2 on the other hand' 'should always have a FRAME break before (%d)' % len(story), bt)) for j in range(3): a(Paragraph(randomText(theme=PYTHON, sentences=2)+' (%d)' % len(story), bt)) a(Paragraph('I should never be at the bottom of a frame (%d)' % len(story), h3)) a(Paragraph(randomText(theme=PYTHON, sentences=1)+' (%d)' % len(story), bt)) a(Paragraph('Now we do &lt;br/&gt; tests', h1)) a(Paragraph('First off no br tags',h3)) a(Paragraph(_text1,bt)) a(Paragraph("&lt;br/&gt; after 'the' in line 4",h3)) a(Paragraph(_text1.replace('forms of the','forms of the<br/>',1),bt)) a(Paragraph("2*&lt;br/&gt; after 'the' in line 4",h3)) a(Paragraph(_text1.replace('forms of the','forms of the<br/><br/>',1),bt)) a(Paragraph("&lt;br/&gt; after 'I suggested ' in line 5",h3)) a(Paragraph(_text1.replace('I suggested ','I suggested<br/>',1),bt)) a(Paragraph("2*&lt;br/&gt; after 'I suggested ' in line 5",h3)) a(Paragraph(_text1.replace('I suggested ','I suggested<br/><br/>',1),bt)) doc = MyDocTemplate(outputfile('test_platypus_breaking.pdf')) doc.multiBuild(story)
21c1a3b419adb8df273febf1b9e4e11d4de6f845 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/21c1a3b419adb8df273febf1b9e4e11d4de6f845/test_platypus_breaking.py
for i in range(10):
for i in xrange(10):
def _test0(self): "This makes one long multi-page paragraph." # Build story. story = [] a = story.append styleSheet = getSampleStyleSheet() h1 = styleSheet['Heading1'] h1.pageBreakBefore = 1 h1.keepWithNext = 1 h2 = styleSheet['Heading2'] h2.frameBreakBefore = 1 h2.keepWithNext = 1 h3 = styleSheet['Heading3'] h3.backColor = colors.cyan h3.keepWithNext = 1 bt = styleSheet['BodyText'] a(Paragraph(""" Subsequent pages test pageBreakBefore, frameBreakBefore and keepTogether attributes. Generated at %s. The number in brackets at the end of each paragraph is its position in the story. (%d)""" % ( time.ctime(time.time()), len(story)), bt)) for i in range(10): a(Paragraph('Heading 1 always starts a new page (%d)' % len(story), h1)) for j in range(3): a(Paragraph('Heading1 paragraphs should always' 'have a page break before. Heading 2 on the other hand' 'should always have a FRAME break before (%d)' % len(story), bt)) a(Paragraph('Heading 2 always starts a new frame (%d)' % len(story), h2)) a(Paragraph('Heading1 paragraphs should always' 'have a page break before. Heading 2 on the other hand' 'should always have a FRAME break before (%d)' % len(story), bt)) for j in range(3): a(Paragraph(randomText(theme=PYTHON, sentences=2)+' (%d)' % len(story), bt)) a(Paragraph('I should never be at the bottom of a frame (%d)' % len(story), h3)) a(Paragraph(randomText(theme=PYTHON, sentences=1)+' (%d)' % len(story), bt)) a(Paragraph('Now we do &lt;br/&gt; tests', h1)) a(Paragraph('First off no br tags',h3)) a(Paragraph(_text1,bt)) a(Paragraph("&lt;br/&gt; after 'the' in line 4",h3)) a(Paragraph(_text1.replace('forms of the','forms of the<br/>',1),bt)) a(Paragraph("2*&lt;br/&gt; after 'the' in line 4",h3)) a(Paragraph(_text1.replace('forms of the','forms of the<br/><br/>',1),bt)) a(Paragraph("&lt;br/&gt; after 'I suggested ' in line 5",h3)) a(Paragraph(_text1.replace('I suggested ','I suggested<br/>',1),bt)) a(Paragraph("2*&lt;br/&gt; after 'I suggested ' in line 5",h3)) a(Paragraph(_text1.replace('I suggested ','I suggested<br/><br/>',1),bt)) doc = MyDocTemplate(outputfile('test_platypus_breaking.pdf')) doc.multiBuild(story)
21c1a3b419adb8df273febf1b9e4e11d4de6f845 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/21c1a3b419adb8df273febf1b9e4e11d4de6f845/test_platypus_breaking.py
for j in range(3):
for j in xrange(3):
def _test0(self): "This makes one long multi-page paragraph." # Build story. story = [] a = story.append styleSheet = getSampleStyleSheet() h1 = styleSheet['Heading1'] h1.pageBreakBefore = 1 h1.keepWithNext = 1 h2 = styleSheet['Heading2'] h2.frameBreakBefore = 1 h2.keepWithNext = 1 h3 = styleSheet['Heading3'] h3.backColor = colors.cyan h3.keepWithNext = 1 bt = styleSheet['BodyText'] a(Paragraph(""" Subsequent pages test pageBreakBefore, frameBreakBefore and keepTogether attributes. Generated at %s. The number in brackets at the end of each paragraph is its position in the story. (%d)""" % ( time.ctime(time.time()), len(story)), bt)) for i in range(10): a(Paragraph('Heading 1 always starts a new page (%d)' % len(story), h1)) for j in range(3): a(Paragraph('Heading1 paragraphs should always' 'have a page break before. Heading 2 on the other hand' 'should always have a FRAME break before (%d)' % len(story), bt)) a(Paragraph('Heading 2 always starts a new frame (%d)' % len(story), h2)) a(Paragraph('Heading1 paragraphs should always' 'have a page break before. Heading 2 on the other hand' 'should always have a FRAME break before (%d)' % len(story), bt)) for j in range(3): a(Paragraph(randomText(theme=PYTHON, sentences=2)+' (%d)' % len(story), bt)) a(Paragraph('I should never be at the bottom of a frame (%d)' % len(story), h3)) a(Paragraph(randomText(theme=PYTHON, sentences=1)+' (%d)' % len(story), bt)) a(Paragraph('Now we do &lt;br/&gt; tests', h1)) a(Paragraph('First off no br tags',h3)) a(Paragraph(_text1,bt)) a(Paragraph("&lt;br/&gt; after 'the' in line 4",h3)) a(Paragraph(_text1.replace('forms of the','forms of the<br/>',1),bt)) a(Paragraph("2*&lt;br/&gt; after 'the' in line 4",h3)) a(Paragraph(_text1.replace('forms of the','forms of the<br/><br/>',1),bt)) a(Paragraph("&lt;br/&gt; after 'I suggested ' in line 5",h3)) a(Paragraph(_text1.replace('I suggested ','I suggested<br/>',1),bt)) a(Paragraph("2*&lt;br/&gt; after 'I suggested ' in line 5",h3)) a(Paragraph(_text1.replace('I suggested ','I suggested<br/><br/>',1),bt)) doc = MyDocTemplate(outputfile('test_platypus_breaking.pdf')) doc.multiBuild(story)
21c1a3b419adb8df273febf1b9e4e11d4de6f845 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/21c1a3b419adb8df273febf1b9e4e11d4de6f845/test_platypus_breaking.py
for j in range(3):
for j in xrange(3):
def _test0(self): "This makes one long multi-page paragraph." # Build story. story = [] a = story.append styleSheet = getSampleStyleSheet() h1 = styleSheet['Heading1'] h1.pageBreakBefore = 1 h1.keepWithNext = 1 h2 = styleSheet['Heading2'] h2.frameBreakBefore = 1 h2.keepWithNext = 1 h3 = styleSheet['Heading3'] h3.backColor = colors.cyan h3.keepWithNext = 1 bt = styleSheet['BodyText'] a(Paragraph(""" Subsequent pages test pageBreakBefore, frameBreakBefore and keepTogether attributes. Generated at %s. The number in brackets at the end of each paragraph is its position in the story. (%d)""" % ( time.ctime(time.time()), len(story)), bt)) for i in range(10): a(Paragraph('Heading 1 always starts a new page (%d)' % len(story), h1)) for j in range(3): a(Paragraph('Heading1 paragraphs should always' 'have a page break before. Heading 2 on the other hand' 'should always have a FRAME break before (%d)' % len(story), bt)) a(Paragraph('Heading 2 always starts a new frame (%d)' % len(story), h2)) a(Paragraph('Heading1 paragraphs should always' 'have a page break before. Heading 2 on the other hand' 'should always have a FRAME break before (%d)' % len(story), bt)) for j in range(3): a(Paragraph(randomText(theme=PYTHON, sentences=2)+' (%d)' % len(story), bt)) a(Paragraph('I should never be at the bottom of a frame (%d)' % len(story), h3)) a(Paragraph(randomText(theme=PYTHON, sentences=1)+' (%d)' % len(story), bt)) a(Paragraph('Now we do &lt;br/&gt; tests', h1)) a(Paragraph('First off no br tags',h3)) a(Paragraph(_text1,bt)) a(Paragraph("&lt;br/&gt; after 'the' in line 4",h3)) a(Paragraph(_text1.replace('forms of the','forms of the<br/>',1),bt)) a(Paragraph("2*&lt;br/&gt; after 'the' in line 4",h3)) a(Paragraph(_text1.replace('forms of the','forms of the<br/><br/>',1),bt)) a(Paragraph("&lt;br/&gt; after 'I suggested ' in line 5",h3)) a(Paragraph(_text1.replace('I suggested ','I suggested<br/>',1),bt)) a(Paragraph("2*&lt;br/&gt; after 'I suggested ' in line 5",h3)) a(Paragraph(_text1.replace('I suggested ','I suggested<br/><br/>',1),bt)) doc = MyDocTemplate(outputfile('test_platypus_breaking.pdf')) doc.multiBuild(story)
21c1a3b419adb8df273febf1b9e4e11d4de6f845 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/21c1a3b419adb8df273febf1b9e4e11d4de6f845/test_platypus_breaking.py
words = [f.clone()] words[-1].text = nText elif not _sameFrag(words[-1],f):
g = f.clone() words = [g] g.text = nText elif not _sameFrag(g,f):
def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word list
6dff1c7feb252817a978c74ed2c13bbd2dace500 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6dff1c7feb252817a978c74ed2c13bbd2dace500/paragraph.py
words[-1].text = words[-1].text + ' ' words.append(f.clone()) words[-1].text = nText
if hasattr(g,'cbDefn'): i = len(words)-1 while hasattr(words[i],'cbDefn'): i = i-1 words[i].text = words[i].text + ' ' else: g.text = g.text + ' ' g = f.clone() words.append(g) g.text = nText
def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word list
6dff1c7feb252817a978c74ed2c13bbd2dace500 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6dff1c7feb252817a978c74ed2c13bbd2dace500/paragraph.py
words[-1].text = words[-1].text + ' ' + nText
g.text = g.text + ' ' + nText
def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word list
6dff1c7feb252817a978c74ed2c13bbd2dace500 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6dff1c7feb252817a978c74ed2c13bbd2dace500/paragraph.py
f = i[0].clone() f.text=i[1] words.append(f) maxSize = max(maxSize,f.fontSize)
g = i[0].clone() g.text=i[1] words.append(g) maxSize = max(maxSize,g.fontSize)
def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word list
6dff1c7feb252817a978c74ed2c13bbd2dace500 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6dff1c7feb252817a978c74ed2c13bbd2dace500/paragraph.py
words = [f.clone()] words[-1].text = w[1][1]
g = f.clone() words = [g] g.text = w[1][1]
def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word list
6dff1c7feb252817a978c74ed2c13bbd2dace500 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6dff1c7feb252817a978c74ed2c13bbd2dace500/paragraph.py
f = i[0].clone() f.text=i[1] words.append(f) maxSize = max(maxSize,f.fontSize)
g = i[0].clone() g.text=i[1] words.append(g) maxSize = max(maxSize,g.fontSize)
def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word list
6dff1c7feb252817a978c74ed2c13bbd2dace500 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6dff1c7feb252817a978c74ed2c13bbd2dace500/paragraph.py
for f in ('xmlparser.c', 'url.c', 'charset.c', 'string16.c', 'ctype16.c', 'dtd.c', 'input.c', 'stdio16.c', 'system.c', 'hash.c', 'version.c', 'namespaces.c', 'http.c'): RXPLIBSOURCES.append(os.path.join(RXPDIR,f))
uRXPLIBSOURCES=[] for f in ('xmlparser.c', 'url.c', 'charset.c', 'string16.c', 'ctype16.c', 'dtd.c', 'input.c', 'stdio16.c', 'system.c', 'hash.c', 'version.c', 'namespaces.c', 'http.c'): RXP_file = os.path.join(RXPDIR,f) uRXP_file = os.path.join(RXPUDIR,f.replace('.','U.')) RXPLIBSOURCES.append(RXP_file) shutil.copy2(RXP_file,uRXP_file) uRXPLIBSOURCES.append(uRXP_file) pyRXPU_c = os.path.join(RXPUDIR,'pyRXPU.c') shutil.copy2('pyRXP.c',pyRXPU_c) uRXPLIBSOURCES.append(pyRXPU_c)
def raiseConfigError(msg): import exceptions class ConfigError(exceptions.Exception): pass raise ConfigError(msg)
256ec0f31741d4323e9df85b73a53b374cf16545 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/256ec0f31741d4323e9df85b73a53b374cf16545/setup.py
def raiseConfigError(msg): import exceptions class ConfigError(exceptions.Exception): pass raise ConfigError(msg)
256ec0f31741d4323e9df85b73a53b374cf16545 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/256ec0f31741d4323e9df85b73a53b374cf16545/setup.py
version = "0.5", description = "Python RXP interface",
version = VERSION, description = "Python RXP interface - fast validating XML parser",
def raiseConfigError(msg): import exceptions class ConfigError(exceptions.Exception): pass raise ConfigError(msg)
256ec0f31741d4323e9df85b73a53b374cf16545 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/256ec0f31741d4323e9df85b73a53b374cf16545/setup.py
define_macros=[('CHAR_SIZE', 8)],
define_macros=[('CHAR_SIZE', 8),],
def raiseConfigError(msg): import exceptions class ConfigError(exceptions.Exception): pass raise ConfigError(msg)
256ec0f31741d4323e9df85b73a53b374cf16545 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/256ec0f31741d4323e9df85b73a53b374cf16545/setup.py
def raiseConfigError(msg): import exceptions class ConfigError(exceptions.Exception): pass raise ConfigError(msg)
256ec0f31741d4323e9df85b73a53b374cf16545 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/256ec0f31741d4323e9df85b73a53b374cf16545/setup.py
]
Extension( 'pyRXPU', uRXPLIBSOURCES, include_dirs=[RXPDIR], define_macros=[('CHAR_SIZE', 16),], library_dirs=[], libraries=LIBS, ), ], classifiers = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: ReportLab BSD derived', 'Programming Language :: Python', 'Programming Language :: C', 'Operating System :: Unix', 'Operating System :: POSIX', 'Operating System :: Microsoft :: Windows', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Text Processing :: Markup :: XML', ]
def raiseConfigError(msg): import exceptions class ConfigError(exceptions.Exception): pass raise ConfigError(msg)
256ec0f31741d4323e9df85b73a53b374cf16545 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/256ec0f31741d4323e9df85b73a53b374cf16545/setup.py
'greek': (self.start_greek, self.end_greek)
'greek': (self.start_greek, self.end_greek), 'para': (self.start_para, self.end_para)
def __init__(self,verbose=0): if _xmllib_newStyle: xmllib.XMLParser.__init__(self,verbose=verbose) else: xmllib.XMLParser.__init__(self) # set up handlers for various tags self.elements = { 'b': (self.start_b, self.end_b), 'u': (self.start_u, self.end_u), 'i': (self.start_i, self.end_i), 'super': (self.start_super, self.end_super), 'sub': (self.start_sub, self.end_sub), 'font': (self.start_font, self.end_font), 'greek': (self.start_greek, self.end_greek) }
b47b895b454dd5a607b621edc424e7aa9fdf9ec7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b47b895b454dd5a607b621edc424e7aa9fdf9ec7/paraparser.py
fnroot = os.path.join(getattr(self,'outDir','.'), fnRoot or (getattr(self,'fileNamePattern',(self.__class__.__name__+'%03d') % getattr(self,'chartId',0))))
fnroot = os.path.join(getattr(self,'outDir','.'), fnRoot or (getattr(self,'fileNamePattern',(self.__class__.__name__+'%03d')) % getattr(self,'chartId',0)))
def save(self, formats=['pdf'], verbose=None, fnRoot=None): "Saves copies of self in desired location and formats" ext = '' fnroot = os.path.join(getattr(self,'outDir','.'), fnRoot or (getattr(self,'fileNamePattern',(self.__class__.__name__+'%03d') % getattr(self,'chartId',0))))
d5de5a20f000d2726282b4e185e1dcf5511c61a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d5de5a20f000d2726282b4e185e1dcf5511c61a2/shapes.py
s = self._atTop and 0 or flowable.getSpaceBefore()
s = 0 if self._atTop: s = flowable.getSpaceBefore()
def _add(self, flowable, canv, trySplit=0): """ Draws the flowable at the current position. Returns 1 if successful, 0 if it would not fit. Raises a LayoutError if the object is too wide, or if it is too high for a totally empty frame, to avoid infinite loops""" y = self._y p = self._y1p s = self._atTop and 0 or flowable.getSpaceBefore() h = y - p - s if h>0: flowable.canv = canv #so they can use stringWidth etc w, h = flowable.wrap(self._aW, h) del flowable.canv else: return 0
31048e3fb20f6bfa0477838b2a37021a8ef76eef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/31048e3fb20f6bfa0477838b2a37021a8ef76eef/frames.py
self._atTop = 0
if y<>self._y: self._atTop = 0
def _add(self, flowable, canv, trySplit=0): """ Draws the flowable at the current position. Returns 1 if successful, 0 if it would not fit. Raises a LayoutError if the object is too wide, or if it is too high for a totally empty frame, to avoid infinite loops""" y = self._y p = self._y1p s = self._atTop and 0 or flowable.getSpaceBefore() h = y - p - s if h>0: flowable.canv = canv #so they can use stringWidth etc w, h = flowable.wrap(self._aW, h) del flowable.canv else: return 0
31048e3fb20f6bfa0477838b2a37021a8ef76eef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/31048e3fb20f6bfa0477838b2a37021a8ef76eef/frames.py
s = self._atTop and 0 or flowable.getSpaceBefore()
s = 0 if self._atTop: s = flowable.getSpaceBefore()
def split(self,flowable,canv): '''Ask the flowable to split using up the available space.''' y = self._y p = self._y1p s = self._atTop and 0 or flowable.getSpaceBefore() flowable.canv = canv #some flowables might need this r = flowable.split(self._aW, y-p-s) del flowable.canv return r
31048e3fb20f6bfa0477838b2a37021a8ef76eef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/31048e3fb20f6bfa0477838b2a37021a8ef76eef/frames.py
'license.txt'
'license.txt',
def _find_rl_accel(): '''locate where the accelerator code lives''' _ = [] for x in [ './rl_addons/rl_accel', '../rl_addons/rl_accel', '../../rl_addons/rl_accel', './rl_accel', '../rl_accel', '../../rl_accel', './lib'] \ + glob.glob('./rl_accel-*/rl_accel')\ + glob.glob('../rl_accel-*/rl_accel') \ + glob.glob('../../rl_accel-*/rl_accel') \ : fn = pjoin(x,'_rl_accel.c') if isfile(pjoin(x,'_rl_accel.c')): _.append(x) if _: if len(_)>1: _.sort(_cmp_rl_accel_dirs) return abspath(_[0]) return None
ca5ea18795855c1352a5cf1753739ded20b6ea88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ca5ea18795855c1352a5cf1753739ded20b6ea88/setup.py
p("""Illustrating that remapping using the [DRINKER<=DRINKER, BAR<=BAR] graph eliminates all attributes except DRINKER and
p("""Illustrating that remapping using the [DRINKER&lt;=DRINKER, BAR&lt;=BAR] graph eliminates all attributes except DRINKER and
def pre(txt): s = layout.Spacer(0.1*inch, 0.1*inch) Elements.append(s) p = layout.Preformatted(txt, PreStyle) Elements.append(p)
8b80a140a8df06644074e4f95a369a5d6a949426 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/8b80a140a8df06644074e4f95a369a5d6a949426/gfe.py
p("""where b<a<c. Furthermore joins with this table are not
p("""where b&lt;a&lt;c. Furthermore joins with this table are not
def pre(txt): s = layout.Spacer(0.1*inch, 0.1*inch) Elements.append(s) p = layout.Preformatted(txt, PreStyle) Elements.append(p)
8b80a140a8df06644074e4f95a369a5d6a949426 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/8b80a140a8df06644074e4f95a369a5d6a949426/gfe.py
if __name__=='__main__': import os, sys, string
def pfxJoin(pfx,*N): R=[] for n in N: R.append(os.path.join(pfx,n)) return R FT_LIB='C:/Python/devel/freetype-2.1.5/objs/freetype214.lib' FT_INCLUDE=None def check_ft_lib(ft_lib=FT_LIB): return os.path.isfile(ft_lib) and ft_lib or '' def main():
def BIGENDIAN(macname,value=None): 'define a macro if bigendian' return sys.byteorder=='big' and [(macname,value)] or []
92f97b6f8cea613f1aae2a10f67396d06e1a10c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/92f97b6f8cea613f1aae2a10f67396d06e1a10c9/setup.py
ROBIN_DEBUG=[('ROBIN_DEBUG',None)] ROBIN_DEBUG=[]
MACROS=[('ROBIN_DEBUG',None)] MACROS=[]
def BIGENDIAN(macname,value=None): 'define a macro if bigendian' return sys.byteorder=='big' and [(macname,value)] or []
92f97b6f8cea613f1aae2a10f67396d06e1a10c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/92f97b6f8cea613f1aae2a10f67396d06e1a10c9/setup.py
def pfxJoin(pfx,*N): R=[] for n in N: R.append(pJoin(pfx,n)) return R
def pfxJoin(pfx,*N): R=[] for n in N: R.append(pJoin(pfx,n)) return R
92f97b6f8cea613f1aae2a10f67396d06e1a10c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/92f97b6f8cea613f1aae2a10f67396d06e1a10c9/setup.py
version = "1.11",
version = VERSION,
def pfxJoin(pfx,*N): R=[] for n in N: R.append(pJoin(pfx,n)) return R
92f97b6f8cea613f1aae2a10f67396d06e1a10c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/92f97b6f8cea613f1aae2a10f67396d06e1a10c9/setup.py
'macros': [('LIBART_COMPILATION',None),]+BIGENDIAN('WORDS_BIGENDIAN')+ROBIN_DEBUG,
'macros': [('LIBART_COMPILATION',None),]+BIGENDIAN('WORDS_BIGENDIAN')+MACROS,
def pfxJoin(pfx,*N): R=[] for n in N: R.append(pJoin(pfx,n)) return R
92f97b6f8cea613f1aae2a10f67396d06e1a10c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/92f97b6f8cea613f1aae2a10f67396d06e1a10c9/setup.py
'macros': ROBIN_DEBUG,
'macros': MACROS,
def pfxJoin(pfx,*N): R=[] for n in N: R.append(pJoin(pfx,n)) return R
92f97b6f8cea613f1aae2a10f67396d06e1a10c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/92f97b6f8cea613f1aae2a10f67396d06e1a10c9/setup.py