rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
bc.x = 10 | bc.x = 20 | def demo(self): """Shows basic use of a bar chart""" | bedf7f255926172ee9ab9abbb5c315fab98cb0f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bedf7f255926172ee9ab9abbb5c315fab98cb0f2/barchart1.py |
bc.width = 90 | bc.width = 180 | def demo(self): """Shows basic use of a bar chart""" | bedf7f255926172ee9ab9abbb5c315fab98cb0f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bedf7f255926172ee9ab9abbb5c315fab98cb0f2/barchart1.py |
def calcBarPositions(self): | def _findMinMaxValues(self): """Find the minimum and maximum value of the data we have.""" data = self.data m, M = Auto, Auto for row in data: for val in row: if val < m: m = val if val > M: M = val return m, M def calcBarPositions0(self): | def calcBarPositions(self): """Works out where they go. | bedf7f255926172ee9ab9abbb5c315fab98cb0f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bedf7f255926172ee9ab9abbb5c315fab98cb0f2/barchart1.py |
"Make a bar chart showing value axis region staring at *exactly* zero." | "Make a bar chart showing value axis region starting at *exactly* zero." | def sample4a(): "Make a bar chart showing value axis region staring at *exactly* 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 = 0 ### bc.valueAxis.valueMax = 60 bc.v... | bedf7f255926172ee9ab9abbb5c315fab98cb0f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bedf7f255926172ee9ab9abbb5c315fab98cb0f2/barchart1.py |
bc.valueAxis.valueMin = 0 | bc.valueAxis.valueMin = 0 | def sample4a(): "Make a bar chart showing value axis region staring at *exactly* 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 = 0 ### bc.valueAxis.valueMax = 60 bc.v... | bedf7f255926172ee9ab9abbb5c315fab98cb0f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bedf7f255926172ee9ab9abbb5c315fab98cb0f2/barchart1.py |
"Make a bar chart showing value axis region staring *below* zero." | "Make a bar chart showing value axis region starting *below* zero." | def sample4b(): "Make a bar chart showing value axis region staring *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 = -10 ### bc.valueAxis.valueMax = 60 bc.valu... | bedf7f255926172ee9ab9abbb5c315fab98cb0f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bedf7f255926172ee9ab9abbb5c315fab98cb0f2/barchart1.py |
bc.valueAxis.valueMin = -10 | bc.valueAxis.valueMin = -10 | def sample4b(): "Make a bar chart showing value axis region staring *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 = -10 ### bc.valueAxis.valueMax = 60 bc.valu... | bedf7f255926172ee9ab9abbb5c315fab98cb0f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bedf7f255926172ee9ab9abbb5c315fab98cb0f2/barchart1.py |
bc = VerticalBarChart() bc.x = 50 bc.y = 50 bc.height = 125 bc.width = 300 bc.data = data bc.strokeColor = colors.black bc.valueAxis.valueMin = 10 | bc = VerticalBarChart() bc.x = 50 bc.y = 50 bc.height = 125 bc.width = 300 bc.data = data bc.strokeColor = colors.black bc.valueAxis.valueMin = 10 | def sample4c(): "Make a bar chart showing value axis region staring *above* 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 = 10 ### bc.valueAxis.valueMax = 60 bc.value... | bedf7f255926172ee9ab9abbb5c315fab98cb0f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bedf7f255926172ee9ab9abbb5c315fab98cb0f2/barchart1.py |
self._img = None | def __init__(self, filename, width=None, height=None, kind='direct', mask="auto", lazy=1): """If size to draw at not specified, get it from the image.""" self.hAlign = 'CENTER' self._mask = mask # if it is a JPEG, will be inlined within the file - # but we still need to know its size now fp = hasattr(filename,'read') i... | 46c2f6dae2fbbba4978d14ad1f14da72c11dd080 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/46c2f6dae2fbbba4978d14ad1f14da72c11dd080/flowables.py | |
(self.imageWidth, self.imageHeight) = self._img.getSize() | img = self._img if img: self.imageWidth, self.imageHeight = img.getSize() | def _setup_inner(self): width = self._width height = self._height kind = self._kind (self.imageWidth, self.imageHeight) = self._img.getSize() if self._lazy>=2: del self._img if kind in ['direct','absolute']: self.drawWidth = width or self.imageWidth self.drawHeight = height or self.imageHeight elif kind in ['percentage... | 46c2f6dae2fbbba4978d14ad1f14da72c11dd080 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/46c2f6dae2fbbba4978d14ad1f14da72c11dd080/flowables.py |
ReportLabBlue = HexColor(0x4e5688) | ReportLabBlueOLD = HexColor(0x4e5688) ReportLabBlue = HexColor(0x00337f) ReportLabBluePCMYK = PCMYKColor(100,65,0,30,spotName='Pantone 288U') | def linearlyInterpolatedColor(c0, c1, x0, x1, x): """ Linearly interpolates colors. Can handle RGB, CMYK and PCMYK colors - give ValueError if colours aren't the same. Doesn't currently handle 'Spot Color Interpolation'. """ if c0.__class__ != c1.__class__: raise ValueError, "Color classes must be the same for interpo... | 1c75ee7de5c5121dd18b0cb8986fded053f11969 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/1c75ee7de5c5121dd18b0cb8986fded053f11969/colors.py |
y = scale(self._findMinMaxValues()[0]) | y = self._findMinMaxValues()[0] if vm is not None: y = min(y,vm) y = scale(y) | def calcBarPositions(self): """Works out where they go. default vertical. | cb13ab363fa36c821b61aae9cdb905565175064c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/cb13ab363fa36c821b61aae9cdb905565175064c/barcharts.py |
org = flipXY and self.y or self.x | if flipXY: org = self.y else: org = self.x | def calcBarPositions(self): """Works out where they go. default vertical. | a1c1f3b47f2d651823c15490d25c6eab5c33882b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a1c1f3b47f2d651823c15490d25c6eab5c33882b/barcharts.py |
fontSize = self.labelFontSize)) | fontSize = self.labelFontSize) | def draw(self): g = Group() ys = self.bottomPadding+(self.triangleHeight/2)+self.sourceLabelOffset+self.sourceLabelFontSize if self.background: x,y = self._getDrawingDimensions() g.add(Rect(-self.leftPadding,-ys,x,y, strokeColor=None, strokeWidth=0, fillColor=self.background)) | 7b17b6832159cedb4158f0ee10ff026325c44e8d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7b17b6832159cedb4158f0ee10ff026325c44e8d/slidebox.py |
self.syntax_error('%s: invalid value %s'%(k,v)) | self._syntax_error('%s: invalid value %s'%(k,v)) | def getAttributes(self,attr,attrMap): A = {} for k, v in attr.items(): k = string.lower(k) if k in attrMap.keys(): j = attrMap[k] func = j[1] try: A[j[0]] = (func is None) and v or apply(func,(v,)) except: self.syntax_error('%s: invalid value %s'%(k,v)) else: self.syntax_error('invalid attribute name %s'%k) return A | 1e91a3573eb190faa40d3f37a311ce4354a87a9f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/1e91a3573eb190faa40d3f37a311ce4354a87a9f/paraparser.py |
self.syntax_error('invalid attribute name %s'%k) | self._syntax_error('invalid attribute name %s'%k) | def getAttributes(self,attr,attrMap): A = {} for k, v in attr.items(): k = string.lower(k) if k in attrMap.keys(): j = attrMap[k] func = j[1] try: A[j[0]] = (func is None) and v or apply(func,(v,)) except: self.syntax_error('%s: invalid value %s'%(k,v)) else: self.syntax_error('invalid attribute name %s'%k) return A | 1e91a3573eb190faa40d3f37a311ce4354a87a9f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/1e91a3573eb190faa40d3f37a311ce4354a87a9f/paraparser.py |
def syntax_error(self,message): if message[:11]=="attribute `" and message[-18:]=="' value not quoted": return self.errors.append(message) | def _reset(self, style): '''reset the parser''' xmllib.XMLParser.reset(self) | 1e91a3573eb190faa40d3f37a311ce4354a87a9f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/1e91a3573eb190faa40d3f37a311ce4354a87a9f/paraparser.py | |
try: | try: | def _AsciiHexTest(text='What is the average velocity of a sparrow?'): "Do the obvious test for whether Ascii Hex encoding works" print 'Plain text:', text encoded = _AsciiHexEncode(text) print 'Encoded:', encoded decoded = _AsciiHexDecode(encoded) print 'Decoded:', decoded if decoded == text: print 'Passed' else: print... | 0a6cde372a9934c6d902da62e7b8c41c00a5f2ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a6cde372a9934c6d902da62e7b8c41c00a5f2ab/pdfutils.py |
elif self.forceZero: | if self.forceZero: | def _setRange(self, dataSeries): """Set minimum and maximum axis values. | 0c68368502cb0d1b131db1479c8c67165eee01ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0c68368502cb0d1b131db1479c8c67165eee01ad/axes.py |
def beforeBuild(self): # keep track of the last run self._lastEntries = self._entries[:] self.clearEntries() | 3a22afced413e2d4edb74ba12a3b2489da70a8aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3a22afced413e2d4edb74ba12a3b2489da70a8aa/tocindex.py | ||
def notify(self, kind, stuff): """DocTemplate framework can call this with all kinds of events; we say we are interested in 'TOCEntry' events.""" if kind == 'TOCEntry': (level, text, pageNum) = stuff self.addEntry(level, text, pageNum) #print 'TOC notified of ', stuff | 3a22afced413e2d4edb74ba12a3b2489da70a8aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3a22afced413e2d4edb74ba12a3b2489da70a8aa/tocindex.py | ||
def addEntries(self, listOfEntries): """Bulk creation. If you knew the titles but not the page numbers, you could supply them to get sensible output on the first run.""" for (level, text, pageNum) in listOfEntries: self.addEntry(level, text, pageNum) | 3a22afced413e2d4edb74ba12a3b2489da70a8aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3a22afced413e2d4edb74ba12a3b2489da70a8aa/tocindex.py | ||
def drawOn(self, canvas, x, y, _sW=0): """Don't do this at home! The standard calls for implementing draw(); we are hooking this in order to delegate ALL the drawing work to the embedded table object""" self._table.drawOn(canvas, x, y, _sW) | 3a22afced413e2d4edb74ba12a3b2489da70a8aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3a22afced413e2d4edb74ba12a3b2489da70a8aa/tocindex.py | ||
def drawOn(self, canvas, x, y, _sW=0): """Don't do this at home! The standard calls for implementing draw(); we are hooking this in order to delegate ALL the drawing work to the embedded table object""" self._table.drawOn(canvas, x, y, _sW) | 3a22afced413e2d4edb74ba12a3b2489da70a8aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3a22afced413e2d4edb74ba12a3b2489da70a8aa/tocindex.py | ||
def drawOn(self, canvas, x, y, _sW=0): """Don't do this at home! The standard calls for implementing draw(); we are hooking this in order to delegate ALL the drawing work to the embedded table object""" self._table.drawOn(canvas, x, y, _sW) | 3a22afced413e2d4edb74ba12a3b2489da70a8aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3a22afced413e2d4edb74ba12a3b2489da70a8aa/tocindex.py | ||
data.append(0, """Chapter %d with a really long name which will hopefully | data.append((0, """Chapter %d with a really long name which will hopefully | def getSampleTOCData(depth=3): """Returns a longish block of page numbers and headings over 3 levels""" from random import randint pgNum = 2 data = [] for chapter in range(1,8): data.append(0, """Chapter %d with a really long name which will hopefully wrap onto a second line, fnding out if the right things happen with ... | 3a22afced413e2d4edb74ba12a3b2489da70a8aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3a22afced413e2d4edb74ba12a3b2489da70a8aa/tocindex.py |
full paragraphs n the table of contents""" % chapter, pgNum) | full paragraphs n the table of contents""" % chapter, pgNum)) | def getSampleTOCData(depth=3): """Returns a longish block of page numbers and headings over 3 levels""" from random import randint pgNum = 2 data = [] for chapter in range(1,8): data.append(0, """Chapter %d with a really long name which will hopefully wrap onto a second line, fnding out if the right things happen with ... | 3a22afced413e2d4edb74ba12a3b2489da70a8aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3a22afced413e2d4edb74ba12a3b2489da70a8aa/tocindex.py |
data.append(1, 'Chapter %d Section %d' % (chapter, section), pgNum) | data.append((1, 'Chapter %d Section %d' % (chapter, section), pgNum)) | def getSampleTOCData(depth=3): """Returns a longish block of page numbers and headings over 3 levels""" from random import randint pgNum = 2 data = [] for chapter in range(1,8): data.append(0, """Chapter %d with a really long name which will hopefully wrap onto a second line, fnding out if the right things happen with ... | 3a22afced413e2d4edb74ba12a3b2489da70a8aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3a22afced413e2d4edb74ba12a3b2489da70a8aa/tocindex.py |
return data | return data | def getSampleTOCData(depth=3): """Returns a longish block of page numbers and headings over 3 levels""" from random import randint pgNum = 2 data = [] for chapter in range(1,8): data.append(0, """Chapter %d with a really long name which will hopefully wrap onto a second line, fnding out if the right things happen with ... | 3a22afced413e2d4edb74ba12a3b2489da70a8aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3a22afced413e2d4edb74ba12a3b2489da70a8aa/tocindex.py |
def getSampleStory(depth=3): """Makes a story with lots of paragraphs. Uses the random TOC data and makes paragraphs to correspond to each.""" from reportlab.platypus.doctemplate import randomText from random import randint styles = getSampleStyleSheet() TOCData = getSampleTOCData(depth) story = [Paragraph("This is ... | 3a22afced413e2d4edb74ba12a3b2489da70a8aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3a22afced413e2d4edb74ba12a3b2489da70a8aa/tocindex.py | ||
def afterInit(self): """Set up the page templates""" frameT = Frame(self.leftMargin, self.bottomMargin, self.width, self.height, id='normal') self.addPageTemplates([PageTemplate(id='Front',frames=frameT), PageTemplate(id='Body',frames=frameT) ]) # just need a unique key generator for outline entries; # easiest is to co... | 3a22afced413e2d4edb74ba12a3b2489da70a8aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3a22afced413e2d4edb74ba12a3b2489da70a8aa/tocindex.py | ||
def afterFlowable(self, flowable): """Our rule for the table of contents is simply to take the text of H1, H2 and H3 elements. We broadcast a notification to the DocTemplate, which should inform the TOC and let it pull them out. Also build an outline""" self._uniqueKey = self._uniqueKey + 1 if hasattr(flowable, 'style... | 3a22afced413e2d4edb74ba12a3b2489da70a8aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3a22afced413e2d4edb74ba12a3b2489da70a8aa/tocindex.py | ||
def afterFlowable(self, flowable): """Our rule for the table of contents is simply to take the text of H1, H2 and H3 elements. We broadcast a notification to the DocTemplate, which should inform the TOC and let it pull them out. Also build an outline""" self._uniqueKey = self._uniqueKey + 1 if hasattr(flowable, 'style... | 3a22afced413e2d4edb74ba12a3b2489da70a8aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3a22afced413e2d4edb74ba12a3b2489da70a8aa/tocindex.py | ||
def afterFlowable(self, flowable): """Our rule for the table of contents is simply to take the text of H1, H2 and H3 elements. We broadcast a notification to the DocTemplate, which should inform the TOC and let it pull them out. Also build an outline""" self._uniqueKey = self._uniqueKey + 1 if hasattr(flowable, 'style... | 3a22afced413e2d4edb74ba12a3b2489da70a8aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3a22afced413e2d4edb74ba12a3b2489da70a8aa/tocindex.py | ||
def beforePage(self): """decorate the page""" self.canv.saveState() self.canv.setStrokeColor(colors.red) self.canv.setLineWidth(5) self.canv.line(66,72,66,PAGE_HEIGHT-72) self.canv.setFont('Times-Roman',12) self.canv.drawString(4 * inch, 0.75 * inch, "Page %d" % doc.page) self.canv.restoreState() | 3a22afced413e2d4edb74ba12a3b2489da70a8aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3a22afced413e2d4edb74ba12a3b2489da70a8aa/tocindex.py | ||
def beforePage(self): """decorate the page""" self.canv.saveState() self.canv.setStrokeColor(colors.red) self.canv.setLineWidth(5) self.canv.line(66,72,66,PAGE_HEIGHT-72) self.canv.setFont('Times-Roman',12) self.canv.drawString(4 * inch, 0.75 * inch, "Page %d" % doc.page) self.canv.restoreState() | 3a22afced413e2d4edb74ba12a3b2489da70a8aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/3a22afced413e2d4edb74ba12a3b2489da70a8aa/tocindex.py | ||
fp=image.fp | fp=im._image.fp | def loadImageFromSRC(self, im): "Extracts the stream, width and height" if im._image.format=='JPEG': fp=image.fp fp.seek(0) self.loadImageFromJPEG(fp) else: zlib = import_zlib() if not zlib: return self.width, self.height = im.getSize() raw = im.getRGBData() assert(len(raw) == self.width*self.height, "Wrong amount of d... | 868d92587d4e5808df5de88939b2b7e55aeb9764 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/868d92587d4e5808df5de88939b2b7e55aeb9764/pdfdoc.py |
return Color(arg[0],arg[1],arg[2]) | assert 3<=len(arg)<=4, 'Can only convert 3 and 4 sequences to color' assert 0<=min(arg) and max(arg)<=1 return len(arg)==3 and Color(arg[0],arg[1],arg[2]) or CMYKColor(arg[0],arg[1],arg[2],arg[3]) | def toColor(arg,default=None): '''try to map an arbitrary arg to a color instance''' if isinstance(arg,Color): return arg tArg = type(arg) if tArg in _SeqTypes: return Color(arg[0],arg[1],arg[2]) elif tArg == StringType: C = getAllNamedColors() s = string.lower(arg) if C.has_key(s): return C[s] try: s = eval(arg) if is... | 5bf5d91cb63b6b691b70bc9955fa96144a1d573b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/5bf5d91cb63b6b691b70bc9955fa96144a1d573b/colors.py |
s = eval(arg) if isinstance(s,Color): return s | return toColor(eval(arg)) | def toColor(arg,default=None): '''try to map an arbitrary arg to a color instance''' if isinstance(arg,Color): return arg tArg = type(arg) if tArg in _SeqTypes: return Color(arg[0],arg[1],arg[2]) elif tArg == StringType: C = getAllNamedColors() s = string.lower(arg) if C.has_key(s): return C[s] try: s = eval(arg) if is... | 5bf5d91cb63b6b691b70bc9955fa96144a1d573b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/5bf5d91cb63b6b691b70bc9955fa96144a1d573b/colors.py |
if oldValue in self.contents: pos = mylist.index(oldValue) | if oldValue in self_contents: pos = self_contents.index(oldValue) | def expandUserNodes0(self): """Return a new drawing which only contains primitive shapes.""" | 671d7beed810857839b858164e083ad5d65be028 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/671d7beed810857839b858164e083ad5d65be028/shapes.py |
if pagesize is None: pagesize rl_config.defaultPageSize | if pagesize is None: pagesize = rl_config.defaultPageSize | def __init__(self,filename, pagesize=None, bottomup = 1, pageCompression=None, encoding = None, invariant = None, verbosity=0): """Create a canvas of a given size. etc. Most of the attributes are private - we will use set/get methods as the preferred interface. Default page size is A4.""" if pagesize is None: pagesize... | 6db344ea65d2dcd466ba20cf6442f8277ef09ac2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6db344ea65d2dcd466ba20cf6442f8277ef09ac2/canvas.py |
if cp != dp: | if cp!=sp: | def checkPageSize(self,canv,doc): '''This gets called by the template framework If canv size != doc size then the canv size is set to the template size or if that's not available to the doc size. ''' #### NEVER EVER EVER COMPARE FLOATS FOR EQUALITY #RGB converting pagesizes to ints means we are accurate to one point #R... | 6133dfc48adf332b66e497d25d4c72bba35a425c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6133dfc48adf332b66e497d25d4c72bba35a425c/doctemplate.py |
else: | elif cp!=dp: | def checkPageSize(self,canv,doc): '''This gets called by the template framework If canv size != doc size then the canv size is set to the template size or if that's not available to the doc size. ''' #### NEVER EVER EVER COMPARE FLOATS FOR EQUALITY #RGB converting pagesizes to ints means we are accurate to one point #R... | 6133dfc48adf332b66e497d25d4c72bba35a425c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6133dfc48adf332b66e497d25d4c72bba35a425c/doctemplate.py |
f = open(filename, 'wb') | if type(f)==type(''): f = open(filename, 'wb') else: f = filename | def SaveToFile(self, filename,canvas): """Open a file, and ask each object in turn to write itself to the file. Keep track of the file position at each point for use in the index at the end""" f = open(filename, 'wb') i = 1 self.xref = [] f.write("%PDF-1.2" + LINEEND) # for CID support f.write("%\355\354\266\276" + L... | 89b84fff273f4992db80557f48fa795ff76cefc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/89b84fff273f4992db80557f48fa795ff76cefc3/pdfdoc.py |
if type(baseDir) not in SeqTypes | if type(baseDir) not in SeqTypes: | def recursiveImport(modulename, baseDir=None, noCWD=0, debug=0): """Dynamically imports possible packagized module, or raises ImportError""" import imp parts = string.split(modulename, '.') name = parts[0] if baseDir is None: path = sys.path[:] else: if type(baseDir) not in SeqTypes path = [baseDir] else: path = list(... | c72711cf02406ec68ee3042cff83cc3b3d4a8fac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c72711cf02406ec68ee3042cff83cc3b3d4a8fac/utils.py |
sys.argv.apend('pythonpoint.xml') | sys.argv.append('pythonpoint.xml') | def process(datafilename): parser = stdparser.PPMLParser() rawdata = open(datafilename).read() parser.feed(rawdata) pres = parser.getPresentation() pres.save() parser.close() | 1d9d4b200b56ddcb685a8e77da39ab2c7ce1bb36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/1d9d4b200b56ddcb685a8e77da39ab2c7ce1bb36/pythonpoint.py |
def __init__(self, encoding=DEFAULT_ENCODING): | def __init__(self, encoding=DEFAULT_ENCODING, dummyoutline=0): | def __init__(self, encoding=DEFAULT_ENCODING): self.encoding = encoding # mapping of internal identifier ("Page001") to PDF objectnumber and generation number (34, 0) self.idToObjectNumberAndVersion = {} # mapping of internal identifier ("Page001") to PDF object (PDFPage instance) self.idToObject = {} # internal id to ... | 094a829ab5b3d461c1ae7fe3381ded6522a0b498 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/094a829ab5b3d461c1ae7fe3381ded6522a0b498/pdfdoc.py |
outlines = self.Outlines = self.outline = PDFOutlines() | if dummyoutline: outlines = PDFOutlines0() else: outlines = PDFOutlines() self.Outlines = self.outline = outlines | def __init__(self, encoding=DEFAULT_ENCODING): self.encoding = encoding # mapping of internal identifier ("Page001") to PDF objectnumber and generation number (34, 0) self.idToObjectNumberAndVersion = {} # mapping of internal identifier ("Page001") to PDF object (PDFPage instance) self.idToObject = {} # internal id to ... | 094a829ab5b3d461c1ae7fe3381ded6522a0b498 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/094a829ab5b3d461c1ae7fe3381ded6522a0b498/pdfdoc.py |
outline = self.outline outline.prepare(self, canvas) | def format(self): # register the Catalog/INfo and then format the objects one by one until exhausted # (possible infinite loop if there is a bug that continually makes new objects/refs...) # prepare outline outline = self.outline outline.prepare(self, canvas) cat = self.Catalog info = self.Info self.Reference(self.Cata... | 094a829ab5b3d461c1ae7fe3381ded6522a0b498 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/094a829ab5b3d461c1ae7fe3381ded6522a0b498/pdfdoc.py | |
''' | def testpage(document): P = PDFPage() P.Contents = teststream() pages = document.Pages P.Parent = document.Reference(pages) P.MediaBox = PDFArray([0, 0, 595, 841]) resources = PDFResourceDictionary() resources.allProcs() # enable all procsets resources.basicFonts() P.Resources = resources pages.addPage(P) | 094a829ab5b3d461c1ae7fe3381ded6522a0b498 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/094a829ab5b3d461c1ae7fe3381ded6522a0b498/pdfdoc.py | |
class PDFOutlines: | class PDFOutlines0: | def testpage(document): P = PDFPage() P.Contents = teststream() pages = document.Pages P.Parent = document.Reference(pages) P.MediaBox = PDFArray([0, 0, 595, 841]) resources = PDFResourceDictionary() resources.allProcs() # enable all procsets resources.basicFonts() P.Resources = resources pages.addPage(P) | 094a829ab5b3d461c1ae7fe3381ded6522a0b498 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/094a829ab5b3d461c1ae7fe3381ded6522a0b498/pdfdoc.py |
''' | def format(self, document): return self.text ''' | 094a829ab5b3d461c1ae7fe3381ded6522a0b498 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/094a829ab5b3d461c1ae7fe3381ded6522a0b498/pdfdoc.py | |
D = PDFDocument() | D = PDFDocument(dummyoutline=1) | 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: raise ValueError, "annotations not reimplemented yet" if not self.Contents: stream = self.stream if n... | 094a829ab5b3d461c1ae7fe3381ded6522a0b498 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/094a829ab5b3d461c1ae7fe3381ded6522a0b498/pdfdoc.py |
return string.join(self.strings, "") | return string.join(strings, "") | def format(self, document): strings = map(str, self.strings) # final conversion, in case of lazy objects return string.join(self.strings, "") | 2469a406ef81aa521725cef0b258b1deb8544fbf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2469a406ef81aa521725cef0b258b1deb8544fbf/pdfdoc.py |
'sigmaf': 'v', | 'sigmaf': 'V', | def _applyAttributes(obj, attr): for k, v in attr.items(): if type(v) is TupleType and v[0]=='relative': #AR 20/5/2000 - remove 1.5.2-ism #v = v[1]+getattr(obj,k,0) if hasattr(obj, k): v = v[1]+getattr(obj,k) else: v = v[1] setattr(obj,k,v) | ce9d1480244c6018dfcae58c9fb0a28b60ff3155 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ce9d1480244c6018dfcae58c9fb0a28b60ff3155/paraparser.py |
'thetasym': 'j', 'thetav': 'j', | 'thetasym': 'J', 'thetav': 'J', | def _applyAttributes(obj, attr): for k, v in attr.items(): if type(v) is TupleType and v[0]=='relative': #AR 20/5/2000 - remove 1.5.2-ism #v = v[1]+getattr(obj,k,0) if hasattr(obj, k): v = v[1]+getattr(obj,k) else: v = v[1] setattr(obj,k,v) | ce9d1480244c6018dfcae58c9fb0a28b60ff3155 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ce9d1480244c6018dfcae58c9fb0a28b60ff3155/paraparser.py |
962:'v', | 962:'V', | def _applyAttributes(obj, attr): for k, v in attr.items(): if type(v) is TupleType and v[0]=='relative': #AR 20/5/2000 - remove 1.5.2-ism #v = v[1]+getattr(obj,k,0) if hasattr(obj, k): v = v[1]+getattr(obj,k) else: v = v[1] setattr(obj,k,v) | ce9d1480244c6018dfcae58c9fb0a28b60ff3155 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ce9d1480244c6018dfcae58c9fb0a28b60ff3155/paraparser.py |
977:'j', | 977:'J', | def _applyAttributes(obj, attr): for k, v in attr.items(): if type(v) is TupleType and v[0]=='relative': #AR 20/5/2000 - remove 1.5.2-ism #v = v[1]+getattr(obj,k,0) if hasattr(obj, k): v = v[1]+getattr(obj,k) else: v = v[1] setattr(obj,k,v) | ce9d1480244c6018dfcae58c9fb0a28b60ff3155 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ce9d1480244c6018dfcae58c9fb0a28b60ff3155/paraparser.py |
981:'f', | 981:'f', | def _applyAttributes(obj, attr): for k, v in attr.items(): if type(v) is TupleType and v[0]=='relative': #AR 20/5/2000 - remove 1.5.2-ism #v = v[1]+getattr(obj,k,0) if hasattr(obj, k): v = v[1]+getattr(obj,k) else: v = v[1] setattr(obj,k,v) | ce9d1480244c6018dfcae58c9fb0a28b60ff3155 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ce9d1480244c6018dfcae58c9fb0a28b60ff3155/paraparser.py |
try: c = symenc[n] except KeyError: self.unknown_charref(name) return self._push(greek=1) self.handle_data(c) self._pop(greek=1) | self.unknown_charref(name) | def handle_charref(self, name): try: if name[0] == 'x': n = string.atoi(name[1:], 16) else: n = string.atoi(name) except string.atoi_error: self.unknown_charref(name) return if 0 <=n<=255: self.handle_data(chr(n)) else: try: c = symenc[n] except KeyError: self.unknown_charref(name) return self._push(greek=1) self.handl... | ce9d1480244c6018dfcae58c9fb0a28b60ff3155 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ce9d1480244c6018dfcae58c9fb0a28b60ff3155/paraparser.py |
def _copyNamedContents(self,obj): | def _copyContents(self,obj): for child in self.contents: obj.contents.append(child) def _copyNamedContents(self,obj,aKeys=None,noCopy=('contents',)): from copy import copy | def _copyNamedContents(self,obj): self_contents = self.contents for (oldKey, oldValue) in self.__dict__.items(): if oldValue in self_contents: pos = self_contents.index(oldValue) setattr(obj, oldKey, obj.contents[pos]) | 0db2330e659933f84282d056763486c5d836da89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0db2330e659933f84282d056763486c5d836da89/shapes.py |
for (oldKey, oldValue) in self.__dict__.items(): if oldValue in self_contents: pos = self_contents.index(oldValue) | if not aKeys: aKeys = self._attrMap.keys() for (k, v) in self.__dict__.items(): if k in self_contents: pos = self_contents.index(v) | def _copyNamedContents(self,obj): self_contents = self.contents for (oldKey, oldValue) in self.__dict__.items(): if oldValue in self_contents: pos = self_contents.index(oldValue) setattr(obj, oldKey, obj.contents[pos]) | 0db2330e659933f84282d056763486c5d836da89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0db2330e659933f84282d056763486c5d836da89/shapes.py |
def copy(self): """returns a copy""" obj = self.__class__() obj.transform = self.transform[:] self_contents = self.contents for child in self_contents: obj.append(child.copy()) | elif k in aKeys and k not in noCopy: setattr(obj, k, copy(v)) def _copy(self,obj): """copies to obj""" obj._attrMap = self._attrMap.clone() self._copyContents(obj) | def _copyNamedContents(self,obj): self_contents = self.contents for (oldKey, oldValue) in self.__dict__.items(): if oldValue in self_contents: pos = self_contents.index(oldValue) setattr(obj, oldKey, obj.contents[pos]) | 0db2330e659933f84282d056763486c5d836da89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0db2330e659933f84282d056763486c5d836da89/shapes.py |
def _copy(self,obj): """copies to obj""" obj._attrMap = self._attrMap.clone() self_contents = self.contents for child in self_contents: obj.contents.append(child) self_contents = self.contents for (oldKey, oldValue) in self.__dict__.items(): if oldValue in self_contents: pos = self_contents.index(oldValue) setattr(ob... | def _copy(self,obj): """copies to obj""" obj._attrMap = self._attrMap.clone() | 0db2330e659933f84282d056763486c5d836da89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0db2330e659933f84282d056763486c5d836da89/shapes.py | |
self.page = page; self.top=top; self.zoom=zoom | self.page = page self.top = top self.zoom = zoom self.left = left | def __init__(self, page, left, top, zoom): self.page = page; self.top=top; self.zoom=zoom | dd808a7d679ca516104d2e4f2854f57d479d9c41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/dd808a7d679ca516104d2e4f2854f57d479d9c41/pdfdoc.py |
cvsdir = os.path.join(groupdir,projdir) | cvsdir = os.path.join(d,projdir) | def cvs_checkout(d): os.chdir(d) cvsdir = os.path.join(groupdir,projdir) recursive_rmdir(cvsdir) cvs = find_exe('cvs') if cvs is None: os.exit(1) os.environ['CVSROOT']=':pserver:%s@cvs.reportlab.sourceforge.net:/cvsroot/reportlab' % USER if release: do_exec(cvs+(' export -r %s %s' % (tagname,projdir)), 'the export ph... | 5d3cc717414fc5e317b8c4fae11161e25f158418 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/5d3cc717414fc5e317b8c4fae11161e25f158418/daily.py |
self._tempdir = get_rl_tempdir('reportlab_test','tmp_%d' % time()) _testmodulename = os.path.join(self._tempdir,'test_module_%d.py' % time()) | s = `int(time())` + `self.count` self.count += 1 self._tempdir = get_rl_tempdir('reportlab_test','tmp_%s' % s) _testmodulename = os.path.join(self._tempdir,'test_module_%s.py' % s) | def setUp(self): from time import time from reportlab.lib.utils import get_rl_tempdir self._tempdir = get_rl_tempdir('reportlab_test','tmp_%d' % time()) _testmodulename = os.path.join(self._tempdir,'test_module_%d.py' % time()) f = open(_testmodulename,'w') f.write('__all__=[]\n') f.close() self._testmodulename = os.pa... | a8537a0cbe3c786442fc386fe7f50d7ecc848798 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a8537a0cbe3c786442fc386fe7f50d7ecc848798/test_lib_utils.py |
htmlTop = """<html><head><title>renderGD output results</title></head> | htmlTop = """<html><head><title>renderPM output results</title></head> | def test(): #grab all drawings from the test module and write out. #make a page of links in HTML to assist viewing. import os from reportlab.graphics.testshapes import getAllTestDrawings drawings = [] if not os.path.isdir('pmout'): os.mkdir('pmout') htmlTop = """<html><head><title>renderGD output results</title></head>... | c04ad2bb43b59401ae759bf0a7fa25912f42ca17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c04ad2bb43b59401ae759bf0a7fa25912f42ca17/renderPM.py |
def __init__(self,fn='rl_dbgmemo.dbg',mode='w',getScript=1,modules=(),**kw): | def __init__(self,fn='rl_dbgmemo.dbg',mode='w',getScript=1,modules=(),capture_traceback=1, **kw): | def __init__(self,fn='rl_dbgmemo.dbg',mode='w',getScript=1,modules=(),**kw): import time, socket self.fn = fn if mode!='w': return self.store = store = {} if sys.exc_info() != (None,None,None): import traceback s = getStringIO() traceback.print_exc(None,s) store['__traceback'] = s.getvalue() cwd=os.getcwd() lcwd = os.l... | 7931417e3db96e08462b6b8ca4db2012f6275f45 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7931417e3db96e08462b6b8ca4db2012f6275f45/utils.py |
if sys.exc_info() != (None,None,None): | if capture_traceback and sys.exc_info() != (None,None,None): | def __init__(self,fn='rl_dbgmemo.dbg',mode='w',getScript=1,modules=(),**kw): import time, socket self.fn = fn if mode!='w': return self.store = store = {} if sys.exc_info() != (None,None,None): import traceback s = getStringIO() traceback.print_exc(None,s) store['__traceback'] = s.getvalue() cwd=os.getcwd() lcwd = os.l... | 7931417e3db96e08462b6b8ca4db2012f6275f45 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7931417e3db96e08462b6b8ca4db2012f6275f45/utils.py |
S = self._CPage and [CondPageBreak(aH+1)] or [] | S = getattr(self,'_CPage',1) and [CondPageBreak(aH+1)] or [] | def split(self, aW, aH): S = self._CPage and [CondPageBreak(aH+1)] or [] for f in self._flowables: S.append(f) return S | f55fe66ae5fa7181b5e05e3fa5bc394c2f07139d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f55fe66ae5fa7181b5e05e3fa5bc394c2f07139d/flowables.py |
def writeXref(self, f): self.startxref = f.tell() f.write('xref' + LINEEND) f.write('0 %d' % (len(self.objects) + 1) + LINEEND) f.write('0000000000 65535 f' + LINEEND) for pos in self.xref: f.write('%0.10d 00000 n' % pos + LINEEND) | 740e41b68e5af6966e15709cb4d51eff360c5082 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/740e41b68e5af6966e15709cb4d51eff360c5082/pdfdoc.py | ||
f.write(str(self.startxref) + LINEEND) | f.write(('%d' % self.startxref) + LINEEND) | def writeTrailer(self, f): f.write('trailer' + LINEEND) f.write('<< /Size %d /Root %d 0 R /Info %d 0 R>>' % (len(self.objects) + 1, 1, self.infopos) + LINEEND) f.write('startxref' + LINEEND) f.write(str(self.startxref) + LINEEND) | 740e41b68e5af6966e15709cb4d51eff360c5082 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/740e41b68e5af6966e15709cb4d51eff360c5082/pdfdoc.py |
fn = float(len(P)) return reduce(lambda x,y: (x[0]+y[0]/fn,x[1]+y[1]/fn),P,(0,0)) | return reduce(lambda x,y, fn=float(len(P)): (x[0]+y[0]/fn,x[1]+y[1]/fn),P,(0,0)) | def centroid(P): '''compute average point of a set of points''' fn = float(len(P)) return reduce(lambda x,y: (x[0]+y[0]/fn,x[1]+y[1]/fn),P,(0,0)) | 0b865c15064db7417349ada1ecb35b8598121d6b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0b865c15064db7417349ada1ecb35b8598121d6b/grids.py |
def goodTest(x,t,tb=0,**kw): | def goodTest(x,t,tb=0,inOnly=0,**kw): | def goodTest(x,t,tb=0,**kw): try: P=_pyRXP.Parser(**kw) r = P(x) rb = 0 except: et, ev, _unused = sys.exc_info() r = '%s %s' % (et.__name__, str(ev)) rb = 1 s = '' for k,v in kw.items(): s = s+', %s=%s' % (k,str(v)) if type(t) is type(''): t = t.replace('\r','\\r') t = t.replace('\n','\\n') if type(r) is type(''): r =... | 745f89a9c4895b841f6bbba5266430f7ad1968db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/745f89a9c4895b841f6bbba5266430f7ad1968db/testRXPbasic.py |
if r==t and rb==tb: | if (inOnly and t in r) or (r==t) and rb==tb: | def goodTest(x,t,tb=0,**kw): try: P=_pyRXP.Parser(**kw) r = P(x) rb = 0 except: et, ev, _unused = sys.exc_info() r = '%s %s' % (et.__name__, str(ev)) rb = 1 s = '' for k,v in kw.items(): s = s+', %s=%s' % (k,str(v)) if type(t) is type(''): t = t.replace('\r','\\r') t = t.replace('\n','\\n') if type(r) is type(''): r =... | 745f89a9c4895b841f6bbba5266430f7ad1968db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/745f89a9c4895b841f6bbba5266430f7ad1968db/testRXPbasic.py |
def failTest(x,t,tb=1,**kw): goodTest(x,t,tb,**kw) | def failTest(x,t,tb=1,inOnly=0,**kw): goodTest(x,t,tb,inOnly=inOnly,**kw) def bigDepth(n): return n and '<tag%d>%s</tag%d>' % (n,bigDepth(n-1),n) or 'middle' | def failTest(x,t,tb=1,**kw): goodTest(x,t,tb,**kw) | 745f89a9c4895b841f6bbba5266430f7ad1968db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/745f89a9c4895b841f6bbba5266430f7ad1968db/testRXPbasic.py |
failTest(bigDepth(257),"""Error Internal error, stack limit reached!\n""", inOnly=1) | def _runTests(pyRXP): global _pyRXP _pyRXP = pyRXP print >>_logf, '############# Testing',pyRXP.__name__ try: for k,v in pyRXP.parser_flags.items(): eval('pyRXP.Parser(%s=%d)' % (k,v)) print >>_logf,'Parser keywords OK' _dot('.') except: traceback.print_exc() print >>_logf,'Parser keywords BAD' _dot('E') try: for k,v i... | 745f89a9c4895b841f6bbba5266430f7ad1968db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/745f89a9c4895b841f6bbba5266430f7ad1968db/testRXPbasic.py | |
c=s.fontsize,d=self.canv: d.stringWidth(a,b,c), v)) | c=s.fontsize,d=d.stringWidth: d(a,b,c), v)) | def _calc(self): | ae66273e476a2a8551ddca91699826510f3fe486 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ae66273e476a2a8551ddca91699826510f3fe486/tables.py |
def _calc(self): | ae66273e476a2a8551ddca91699826510f3fe486 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ae66273e476a2a8551ddca91699826510f3fe486/tables.py | ||
if op == 'GRID': self._drawBox( (sc, sr), (ec, er), weight, color) self._drawInnerGrid( (sc, sr), (ec, er), weight, color) elif op in ('BOX', 'OUTLINE',): self._drawBox( (sc, sr), (ec, er), weight, color) elif op == 'INNERGRID': self._drawInnerGrid( (sc, sr), (ec, er), weight, color) elif op == 'LINEBELOW': self._drawH... | getattr(self,_LineOpMap.get(op, '_drawUnknown' ))( (sc, sr), (ec, er), weight, color) | def _drawLines(self): for op, (sc, sr), (ec, er), weight, color in self._linecmds: if sc < 0: sc = sc + self._ncols if ec < 0: ec = ec + self._ncols if sr < 0: sr = sr + self._nrows if er < 0: er = er + self._nrows if op == 'GRID': self._drawBox( (sc, sr), (ec, er), weight, color) self._drawInnerGrid( (sc, sr), (ec, er... | ae66273e476a2a8551ddca91699826510f3fe486 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ae66273e476a2a8551ddca91699826510f3fe486/tables.py |
self._calc() | def _splitRows(self,availHeight): self._calc() h = 0 n = 0 lim = len(self._rowHeights) while n<lim: hn = h + self._rowHeights[n] if hn>availHeight: break h = hn n = n + 1 | ae66273e476a2a8551ddca91699826510f3fe486 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ae66273e476a2a8551ddca91699826510f3fe486/tables.py | |
def split(self, availWidth, availHeight): if self.splitByRow: if self._width>availWidth: return [] return self._splitRows(availHeight) else: raise NotImplementedError | ae66273e476a2a8551ddca91699826510f3fe486 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ae66273e476a2a8551ddca91699826510f3fe486/tables.py | ||
y = rowpos + (cellstyle.bottomPadding + rowheight-cellstyle.topPadding+(n-1)*leading)/2.0+leading-fontsize | y = rowpos + (cellstyle.bottomPadding + rowheight-cellstyle.topPadding+(n-1)*leading)/2.0 | def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): #print "cellstyle is ", repr(cellstyle), id(cellstyle) if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: #print "setting cell color to %s" % `cellstyle.color` self.canv.setFil... | ae66273e476a2a8551ddca91699826510f3fe486 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ae66273e476a2a8551ddca91699826510f3fe486/tables.py |
LINECOMMANDS = ( 'GRID', 'BOX', 'OUTLINE', 'INNERGRID', 'BOXGRID', 'LINEBELOW', 'LINEABOVE', 'LINEBEFORE', 'LINEAFTER', ) | _LineOpMap = { 'GRID':'_drawGrid', 'BOX':'_drawBox', 'OUTLINE':'_drawBox', 'INNERGRID':'_drawInnerGrid', 'LINEBELOW':'_drawHLinesB', 'LINEABOVE':'_drawHLines', 'LINEBEFORE':'_drawVLines', 'LINEAFTER':'_drawVLinesA', } LINECOMMANDS = _LineOpMap.keys() | def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): #print "cellstyle is ", repr(cellstyle), id(cellstyle) if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: #print "setting cell color to %s" % `cellstyle.color` self.canv.setFil... | ae66273e476a2a8551ddca91699826510f3fe486 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ae66273e476a2a8551ddca91699826510f3fe486/tables.py |
t=apply(Table,([('Attribute', 'Synonyms'), ('alignment', 'align, alignment'), ('bulletColor', 'bulletcolor, bcolor'), ('bulletFontName', 'bfont, bulletfontname'), ('bulletFontSize', 'bfontsize, bulletfontsize'), ('bulletIndent', 'bindent, bulletindent'), ('firstLineIndent', 'findent, firstlineindent'), ('fontName', 'fa... | t = Table([ ('Attribute', 'Synonyms'), ('alignment', 'align, alignment'), ('bulletColor', 'bulletcolor, bcolor'), ('bulletFontName', 'bfont, bulletfontname'), ('bulletFontSize', 'bfontsize, bulletfontsize'), ('bulletIndent', 'bindent, bulletindent'), ('firstLineIndent', 'findent, firstlineindent'), ('fontName', 'face, ... | def test(): from reportlab.lib.units import inch rowheights = (24, 16, 16, 16, 16) rowheights2 = (24, 16, 16, 16, 30) colwidths = (50, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32) data = ( ('', 'Jan', 'Feb', 'Mar','Apr','May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'), ('Mugs', 0, 4, 17, 3, 21, 47, 12, 33, 2,... | ae66273e476a2a8551ddca91699826510f3fe486 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ae66273e476a2a8551ddca91699826510f3fe486/tables.py |
if W>maxWidth: | if W>maxWidth+_FUZZ: | def func(x): W, H = _listWrapOn(self._content,x*availWidth,self.canv) W /= x H /= x return W, H | 026f7cbb1263946fbcc0b345557c6f44c85e0949 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/026f7cbb1263946fbcc0b345557c6f44c85e0949/flowables.py |
if H<=maxHeight: | if H<=maxHeight-_FUZZ: | def func(x): W, H = _listWrapOn(self._content,x*availWidth,self.canv) W /= x H /= x return W, H | 026f7cbb1263946fbcc0b345557c6f44c85e0949 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/026f7cbb1263946fbcc0b345557c6f44c85e0949/flowables.py |
import glob | def bruteForceSearchForAFM(faceName): """Looks in all AFM files on path for face with given name. Returns AFM file name or None. Ouch!""" import glob from reportlab.rl_config import T1SearchPath for dirname in T1SearchPath: if not rl_isdir(dirname): continue possibles = glob.glob(dirname + os.sep + '*.[aA][fF][mM]')... | 25e3f3595e06130ed62e1ff2c247b80f7c35b166 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/25e3f3595e06130ed62e1ff2c247b80f7c35b166/pdfmetrics.py | |
possibles = glob.glob(dirname + os.sep + '*.[aA][fF][mM]') | possibles = rl_glob(dirname + os.sep + '*.[aA][fF][mM]') | def bruteForceSearchForAFM(faceName): """Looks in all AFM files on path for face with given name. Returns AFM file name or None. Ouch!""" import glob from reportlab.rl_config import T1SearchPath for dirname in T1SearchPath: if not rl_isdir(dirname): continue possibles = glob.glob(dirname + os.sep + '*.[aA][fF][mM]')... | 25e3f3595e06130ed62e1ff2c247b80f7c35b166 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/25e3f3595e06130ed62e1ff2c247b80f7c35b166/pdfmetrics.py |
g.add(String(x+self.boxWidth/2.,(self.boxHeight-ascent)/2.), | g.add(String(x+self.boxWidth/2.,(self.boxHeight-ascent)/2., | def draw(self): g = Group() ys = self.bottomPadding+(self.triangleHeight/2)+self.sourceLabelOffset+self.sourceLabelFontSize if self.background: x,y = self._getDrawingDimensions() g.add(Rect(-self.leftPadding,-ys,x,y, strokeColor=None, strokeWidth=0, fillColor=self.background)) | 556433b5af1994aa1e775a1ecdd280eb8c49e662 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/556433b5af1994aa1e775a1ecdd280eb8c49e662/slidebox.py |
fontSize = self.labelFontSize) | fontSize = self.labelFontSize)) | def draw(self): g = Group() ys = self.bottomPadding+(self.triangleHeight/2)+self.sourceLabelOffset+self.sourceLabelFontSize if self.background: x,y = self._getDrawingDimensions() g.add(Rect(-self.leftPadding,-ys,x,y, strokeColor=None, strokeWidth=0, fillColor=self.background)) | 556433b5af1994aa1e775a1ecdd280eb8c49e662 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/556433b5af1994aa1e775a1ecdd280eb8c49e662/slidebox.py |
print 'Error: %s '+ 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: %s '+ cmdname or cmd sys.exit(1) | 341a8bd431df4ef80835c9225d499a68cdcd1c94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/341a8bd431df4ef80835c9225d499a68cdcd1c94/daily.py |
def getMacRomanWidths(self): #derive a MacRoman encoding vector MacRomanWidths = [0] * 256 for i in range(255): name = MacRomanNames[i] try: width = self.widthsByName[name] except: width = 0 MacRomanWidths[i] = width return MacRomanWidths | 2d146dd0c69f926ce9c398889d32a4980a7b5e78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2d146dd0c69f926ce9c398889d32a4980a7b5e78/pdfmetrics.py | ||
_fonts[font.fontName] = font | fontName = str(font.fontName) _fonts[fontName] = font | def registerFont(font): "Registers a font, including setting up info for accelerated stringWidth" #assert isinstance(font, Font), 'Not a Font: %s' % font _fonts[font.fontName] = font if not font._multiByte: if _stringWidth: _rl_accel.setFontInfo(string.lower(font.fontName), _dummyEncoding, font.face.ascent, font.face.d... | 255237541447c464464fa0e85e9a7bd90fcf34a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/255237541447c464464fa0e85e9a7bd90fcf34a1/pdfmetrics.py |
_rl_accel.setFontInfo(string.lower(font.fontName), | _rl_accel.setFontInfo(string.lower(fontName), | def registerFont(font): "Registers a font, including setting up info for accelerated stringWidth" #assert isinstance(font, Font), 'Not a Font: %s' % font _fonts[font.fontName] = font if not font._multiByte: if _stringWidth: _rl_accel.setFontInfo(string.lower(font.fontName), _dummyEncoding, font.face.ascent, font.face.d... | 255237541447c464464fa0e85e9a7bd90fcf34a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/255237541447c464464fa0e85e9a7bd90fcf34a1/pdfmetrics.py |
testStringWidthAlgorithms() | testStringWidthAlgorithms() | def test(): helv = TypeFace('Helvetica') registerTypeFace(helv) print helv.glyphNames[0:30] wombat = TypeFace('Wombat') print wombat.glyphNames registerTypeFace(wombat) dumpFontData() | 255237541447c464464fa0e85e9a7bd90fcf34a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/255237541447c464464fa0e85e9a7bd90fcf34a1/pdfmetrics.py |
text = self.labels[i] if text: si = self.strands[i] labelRadius = si.labelRadius ex = centerx + labelRadius*car ey = centery + labelRadius*sar L = Label() L.setText(text) L.x = ex L.y = ey L.boxAnchor = _findNearestAngleValue(angle*180/pi,_ANGLE2ANCHOR) L.fontName = si.fontName L.fontSize = si.fontSize L.fillColor = si... | if labels: text = labels[i] if text: si = self.strands[i] labelRadius = si.labelRadius ex = centerx + labelRadius*car ey = centery + labelRadius*sar L = Label() L.setText(text) L.x = ex L.y = ey L.boxAnchor = _findNearestAngleValue(angle*180/pi,_ANGLE2ANCHOR) L.fontName = si.fontName L.fontSize = si.fontSize L.fillColo... | def draw(self): # normalize slice data g = self.makeBackground() or Group() | 8922182af8db0862177d11334bc6e05954c564ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/8922182af8db0862177d11334bc6e05954c564ca/spider.py |
p = [self.CX(i,0),self.CY(i,0), self.CX(i,1),self.CY(i,1), self.OX(i,angle,1),self.OY(i,angle,1), self.OX(i,angle,0),self.OY(i,angle,0)] L.append((rd,Polygon(p, strokeColor=strokeColor, fillColor=fillColor,strokeWidth=strokeWidth,strokeLineJoin=1))) | if abs(angle-_270r)>1e-6: p = [self.CX(i,0),self.CY(i,0), self.CX(i,1),self.CY(i,1), self.OX(i,angle,1),self.OY(i,angle,1), self.OX(i,angle,0),self.OY(i,angle,0)] L.append((rd,Polygon(p, strokeColor=strokeColor, fillColor=fillColor,strokeWidth=strokeWidth,strokeLineJoin=1))) | def _fillSide(self,L,i,angle,strokeColor,strokeWidth,fillColor): rd = self.rad_dist(angle) if rd<self.rad_dist(self._sl3d[i].mid): p = [self.CX(i,0),self.CY(i,0), self.CX(i,1),self.CY(i,1), self.OX(i,angle,1),self.OY(i,angle,1), self.OX(i,angle,0),self.OY(i,angle,0)] L.append((rd,Polygon(p, strokeColor=strokeColor, fil... | 74b78594f9ee03973a5f0f18a52601ea95a8ef56 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/74b78594f9ee03973a5f0f18a52601ea95a8ef56/piecharts.py |
g.draw() | def demo(self): D = Drawing(100, 100) | 7085104ce6ab4adbb19ecef99f88fe6823d23ca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7085104ce6ab4adbb19ecef99f88fe6823d23ca2/grids.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.