rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
if lineBreak and not len(words): | if lineBreak: | def breakLines(self, width): """ Returns a broken line structure. There are two cases | 8d23a394d71e94269f4f4a0be1e036155775a4c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/8d23a394d71e94269f4f4a0be1e036155775a4c8/paragraph.py |
del g.lineBreak | def breakLines(self, width): """ Returns a broken line structure. There are two cases | 8d23a394d71e94269f4f4a0be1e036155775a4c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/8d23a394d71e94269f4f4a0be1e036155775a4c8/paragraph.py |
|
lineBreakPrev = lineBreak | def breakLines(self, width): """ Returns a broken line structure. There are two cases | 8d23a394d71e94269f4f4a0be1e036155775a4c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/8d23a394d71e94269f4f4a0be1e036155775a4c8/paragraph.py |
|
print "frag%d: '%s'" % (l, frags[l].text) | print "frag%d: '%s' %s" % (l, frags[l].text,' '.join(['%s=%s' % (k,getattr(frags[l],k)) for k in frags[l].__dict__ if k!=text])) | def dumpParagraphFrags(P): print 'dumpParagraphFrags(<Paragraph @ %d>) minWidth() = %.2f' % (id(P), P.minWidth()) frags = P.frags n =len(frags) for l in range(n): print "frag%d: '%s'" % (l, frags[l].text) | 8d23a394d71e94269f4f4a0be1e036155775a4c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/8d23a394d71e94269f4f4a0be1e036155775a4c8/paragraph.py |
w = [] for frag in self.blPara.lines: w.append(self.width - frag.extraSpace) return w | if self.blPara.kind: func = lambda frag, w=self.width: w - frag.extraSpace else: func = lambda frag, w=self.width: w - frag[0] return map(func,self.blPara.lines) | def getActualLineWidths0(self): """Convenience function; tells you how wide each line actually is. For justified styles, this will be the same as the wrap width; for others it might be useful for seeing if paragraphs will fit in spaces.""" assert hasattr(self, 'width'), "Cannot call this method before wrap()" w = [] for frag in self.blPara.lines: w.append(self.width - frag.extraSpace) return w | f995cb62417e4d90b44f74d6d6a41ebe83140624 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f995cb62417e4d90b44f74d6d6a41ebe83140624/paragraph.py |
R.extend(unicode2T1(utext[i0:il],fonts)) | R.extend(_py_unicode2T1(utext[i0:il],fonts)) | def _py_unicode2T1(utext,fonts): '''return a list of (font,string) pairs representing the unicode text''' #print 'unicode2t1(%s, %s): %s' % (utext, fonts, type(utext)) #if type(utext) R = [] font, fonts = fonts[0], fonts[1:] enc = font.encName if 'UCS-2' in enc: enc = 'UTF16' while utext: try: R.append((font,utext.encode(enc))) break except UnicodeEncodeError, e: i0, il = e.args[2:4] if i0: R.append((font,utext[:i0].encode(enc))) if fonts: R.extend(unicode2T1(utext[i0:il],fonts)) else: R.append((_notdefFont,_notdefChar*(il-i0))) utext = utext[il:] return R | 2563eabcb26b965002412d2f8968b48a1c785049 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2563eabcb26b965002412d2f8968b48a1c785049/pdfmetrics.py |
from rl_accel import getFontU as getFont | from _rl_accel import getFontU as getFont | def _py_getFont(fontName): """Lazily constructs known fonts if not found. Names of form 'face-encoding' will be built if face and encoding are known. Also if the name is just one of the standard 14, it will make up a font in the default encoding.""" try: return _fonts[fontName] except KeyError: return findFontAndRegister(fontName) | 2563eabcb26b965002412d2f8968b48a1c785049 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2563eabcb26b965002412d2f8968b48a1c785049/pdfmetrics.py |
self._addNABarLabel(g,rowNo,colNo,x,y,width,height) | self._addNABarLabel(lg,rowNo,colNo,x,y,width,height) | def makeBars(self): g = Group() | 547416fffb98c525a773f15c81ae14cf5cf43384 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/547416fffb98c525a773f15c81ae14cf5cf43384/barcharts.py |
self._addBarLabel(g,rowNo,colNo,x,y,width,height) | self._addBarLabel(lg,rowNo,colNo,x,y,width,height) g.add(lg) | def makeBars(self): g = Group() | 547416fffb98c525a773f15c81ae14cf5cf43384 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/547416fffb98c525a773f15c81ae14cf5cf43384/barcharts.py |
outDir = join(rlDir, 'test') pdf = join(outDir, 'pythonpoint.pdf') | datafilename = 'pythonpoiint.pdf' if isCompactDistro(): cwd = None outDir = '.' xml = open_for_read(xml) else: outDir = join(rlDir, 'test') cwd = os.getcwd() os.chdir(join(ppDir, 'demos')) pdf = join(outDir, datafilename) | def test0(self): "Test if pythonpoint.pdf can be created from pythonpoint.xml." | d5aea2fc5d319681a359751c10f99955e8d04077 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d5aea2fc5d319681a359751c10f99955e8d04077/test_tools_pythonpoint.py |
cwd = os.getcwd() os.chdir(join(ppDir, 'demos')) pythonpoint.process(xml, outDir=outDir, verbose=0) os.chdir(cwd) | pythonpoint.process(xml, outDir=outDir, verbose=0, datafilename=datafilename) if cwd: os.chdir(cwd) | def test0(self): "Test if pythonpoint.pdf can be created from pythonpoint.xml." | d5aea2fc5d319681a359751c10f99955e8d04077 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d5aea2fc5d319681a359751c10f99955e8d04077/test_tools_pythonpoint.py |
def test0(self): "Test if pythonpoint.pdf can be created from pythonpoint.xml." | d5aea2fc5d319681a359751c10f99955e8d04077 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d5aea2fc5d319681a359751c10f99955e8d04077/test_tools_pythonpoint.py |
||
unittest.TextTestRunner().run(makeSuite()) | unittest.TextTestRunner().run(makeSuite()) | def makeSuite(): return makeSuiteForClasses(PythonPointTestCase) | d5aea2fc5d319681a359751c10f99955e8d04077 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d5aea2fc5d319681a359751c10f99955e8d04077/test_tools_pythonpoint.py |
def __setattr__(self, key, value): if self.defaults.has_key(key): self.attributes[key] = value else: self.__dict__[key] = value | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def __repr__(self): return "<%s '%s'>" % (self.__class__.__name__, self.name) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def listAttrs(self): print 'name =', self.name print 'parent =', self.parent keylist = self.defaults.keys() keylist.sort() for key in keylist: value = self.attributes.get(key, None) if value: print '%s = %s (direct)' % (key, value) else: #try for inherited value = getattr(self.parent, key, None) if value: print '%s = %s (inherited)' % (key, value) else: value = self.defaults[key] print '%s = %s (class default)' % (key, value) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def getSampleStyleSheet(): """Returns a dictionary of styles to get you started. Should be usable for fairly basic word processing tasks. We should really have a class for StyleSheets, which can list itself and avoid the duplication of item names seen below.""" stylesheet = {} para = ParagraphStyle('Normal', None) #the ancestor of all para.fontName = 'Times-Roman' para.fontSize = 10 para.leading = 12 stylesheet['Normal'] = para para = ParagraphStyle('BodyText', stylesheet['Normal']) para.spaceBefore = 6 stylesheet['BodyText'] = para para = ParagraphStyle('Italic', stylesheet['BodyText']) para.fontName = 'Times-Italic' stylesheet['Italic'] = para para = ParagraphStyle('Heading1', stylesheet['Normal']) para.fontName = 'Times-Bold' para.fontSize = 18 para.spaceAfter = 6 stylesheet['Heading1'] = para para = ParagraphStyle('Heading2', stylesheet['Normal']) para.fontName = 'Times-Bold' para.fontSize = 14 para.spaceBefore = 12 para.spaceAfter = 6 stylesheet['Heading2'] = para para = ParagraphStyle('Heading3', stylesheet['Normal']) para.fontName = 'Times-BoldItalic' para.fontSize = 12 para.spaceBefore = 12 para.spaceAfter = 6 stylesheet['Heading3'] = para para = ParagraphStyle('Bullet', stylesheet['Normal']) para.firstLineIndent = 36 para.leftIndent = 36 para.spaceBefore = 3 stylesheet['Bullet'] = para para = ParagraphStyle('Definition', stylesheet['Normal']) #use this for definition lists para.firstLineIndent = 36 para.leftIndent = 36 para.bulletIndent = 0 para.spaceBefore = 6 para.bulletFontName = 'Times-BoldItalic' stylesheet['Definition'] = para para = ParagraphStyle('Code', stylesheet['Normal']) para.fontName = 'Courier' para.fontSize = 8 para.leading = 8.8 para.leftIndent = 36 stylesheet['Code'] = para return stylesheet | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def getSampleStyleSheet(): """Returns a dictionary of styles to get you started. Should be usable for fairly basic word processing tasks. We should really have a class for StyleSheets, which can list itself and avoid the duplication of item names seen below.""" stylesheet = {} para = ParagraphStyle('Normal', None) #the ancestor of all para.fontName = 'Times-Roman' para.fontSize = 10 para.leading = 12 stylesheet['Normal'] = para para = ParagraphStyle('BodyText', stylesheet['Normal']) para.spaceBefore = 6 stylesheet['BodyText'] = para para = ParagraphStyle('Italic', stylesheet['BodyText']) para.fontName = 'Times-Italic' stylesheet['Italic'] = para para = ParagraphStyle('Heading1', stylesheet['Normal']) para.fontName = 'Times-Bold' para.fontSize = 18 para.spaceAfter = 6 stylesheet['Heading1'] = para para = ParagraphStyle('Heading2', stylesheet['Normal']) para.fontName = 'Times-Bold' para.fontSize = 14 para.spaceBefore = 12 para.spaceAfter = 6 stylesheet['Heading2'] = para para = ParagraphStyle('Heading3', stylesheet['Normal']) para.fontName = 'Times-BoldItalic' para.fontSize = 12 para.spaceBefore = 12 para.spaceAfter = 6 stylesheet['Heading3'] = para para = ParagraphStyle('Bullet', stylesheet['Normal']) para.firstLineIndent = 36 para.leftIndent = 36 para.spaceBefore = 3 stylesheet['Bullet'] = para para = ParagraphStyle('Definition', stylesheet['Normal']) #use this for definition lists para.firstLineIndent = 36 para.leftIndent = 36 para.bulletIndent = 0 para.spaceBefore = 6 para.bulletFontName = 'Times-BoldItalic' stylesheet['Definition'] = para para = ParagraphStyle('Code', stylesheet['Normal']) para.fontName = 'Courier' para.fontSize = 8 para.leading = 8.8 para.leftIndent = 36 stylesheet['Code'] = para return stylesheet | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def getSampleStyleSheet(): """Returns a dictionary of styles to get you started. Should be usable for fairly basic word processing tasks. We should really have a class for StyleSheets, which can list itself and avoid the duplication of item names seen below.""" stylesheet = {} para = ParagraphStyle('Normal', None) #the ancestor of all para.fontName = 'Times-Roman' para.fontSize = 10 para.leading = 12 stylesheet['Normal'] = para para = ParagraphStyle('BodyText', stylesheet['Normal']) para.spaceBefore = 6 stylesheet['BodyText'] = para para = ParagraphStyle('Italic', stylesheet['BodyText']) para.fontName = 'Times-Italic' stylesheet['Italic'] = para para = ParagraphStyle('Heading1', stylesheet['Normal']) para.fontName = 'Times-Bold' para.fontSize = 18 para.spaceAfter = 6 stylesheet['Heading1'] = para para = ParagraphStyle('Heading2', stylesheet['Normal']) para.fontName = 'Times-Bold' para.fontSize = 14 para.spaceBefore = 12 para.spaceAfter = 6 stylesheet['Heading2'] = para para = ParagraphStyle('Heading3', stylesheet['Normal']) para.fontName = 'Times-BoldItalic' para.fontSize = 12 para.spaceBefore = 12 para.spaceAfter = 6 stylesheet['Heading3'] = para para = ParagraphStyle('Bullet', stylesheet['Normal']) para.firstLineIndent = 36 para.leftIndent = 36 para.spaceBefore = 3 stylesheet['Bullet'] = para para = ParagraphStyle('Definition', stylesheet['Normal']) #use this for definition lists para.firstLineIndent = 36 para.leftIndent = 36 para.bulletIndent = 0 para.spaceBefore = 6 para.bulletFontName = 'Times-BoldItalic' stylesheet['Definition'] = para para = ParagraphStyle('Code', stylesheet['Normal']) para.fontName = 'Courier' para.fontSize = 8 para.leading = 8.8 para.leftIndent = 36 stylesheet['Code'] = para return stylesheet | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def getSampleStyleSheet(): """Returns a dictionary of styles to get you started. Should be usable for fairly basic word processing tasks. We should really have a class for StyleSheets, which can list itself and avoid the duplication of item names seen below.""" stylesheet = {} para = ParagraphStyle('Normal', None) #the ancestor of all para.fontName = 'Times-Roman' para.fontSize = 10 para.leading = 12 stylesheet['Normal'] = para para = ParagraphStyle('BodyText', stylesheet['Normal']) para.spaceBefore = 6 stylesheet['BodyText'] = para para = ParagraphStyle('Italic', stylesheet['BodyText']) para.fontName = 'Times-Italic' stylesheet['Italic'] = para para = ParagraphStyle('Heading1', stylesheet['Normal']) para.fontName = 'Times-Bold' para.fontSize = 18 para.spaceAfter = 6 stylesheet['Heading1'] = para para = ParagraphStyle('Heading2', stylesheet['Normal']) para.fontName = 'Times-Bold' para.fontSize = 14 para.spaceBefore = 12 para.spaceAfter = 6 stylesheet['Heading2'] = para para = ParagraphStyle('Heading3', stylesheet['Normal']) para.fontName = 'Times-BoldItalic' para.fontSize = 12 para.spaceBefore = 12 para.spaceAfter = 6 stylesheet['Heading3'] = para para = ParagraphStyle('Bullet', stylesheet['Normal']) para.firstLineIndent = 36 para.leftIndent = 36 para.spaceBefore = 3 stylesheet['Bullet'] = para para = ParagraphStyle('Definition', stylesheet['Normal']) #use this for definition lists para.firstLineIndent = 36 para.leftIndent = 36 para.bulletIndent = 0 para.spaceBefore = 6 para.bulletFontName = 'Times-BoldItalic' stylesheet['Definition'] = para para = ParagraphStyle('Code', stylesheet['Normal']) para.fontName = 'Courier' para.fontSize = 8 para.leading = 8.8 para.leftIndent = 36 stylesheet['Code'] = para return stylesheet | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def cleanBlockQuotedText(text): """This is an internal utility which takes triple- quoted text form within the document and returns (hopefully) the paragraph the user intended originally.""" stripped = string.strip(text) lines = string.split(stripped, '\n') trimmed_lines = map(string.lstrip, lines) return string.join(trimmed_lines, ' ') | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def __init__(self): self.width = 0 self.height = 0 self.wrapped = 0 | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def drawOn(self, canvas, x, y): "Tell it to draw itself on the canvas. Do not override" self.canv = canvas self.canv.saveState() self.canv.translate(x, y) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def draw(self): self.canv.rect(0, 0, self.width, self.height) self.canv.line(0, 0, self.width, self.height) self.canv.line(0, self.height, self.width, 0) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def __init__(self, text, style, bulletText = None): self.text = cleanBlockQuotedText(text) self.style = style self.bulletText = bulletText self.debug = 0 #turn this on to see a pretty one with all the margins etc. | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def wrap(self, availWidth, availHeight): # work out widths array for breaking self.width = availWidth first_line_width = availWidth - self.style.firstLineIndent - self.style.rightIndent later_widths = availWidth - self.style.leftIndent - self.style.rightIndent wrap_widths = [first_line_width, later_widths] | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
words = string.split(text, ' ') | words = string.split(text, ' ') | def breakLines(self, text, width, fontName, fontSize): """Returns a structure broken into lines. Each line has two items. Item one is the extra points of space available on that line; item two is the list of words themselves. This structure can be used to easily draw paragraphs with the various alignments. You can supply either a single width or a list of widths; the latter will have its last item repeated until necessary. A 2-element list is useful when there is a different first line indent; a longer list could be created to facilitate custom wraps around irregular objects.""" if type(width) <> types.ListType: maxwidths = [width] else: maxwidths = width lines = [] spacewidth = pdfmetrics.stringwidth(' ', fontName) * 0.001 * fontSize words = string.split(text, ' ') currentline = [] lineno = 0 maxwidth = maxwidths[lineno] currentwidth = - spacewidth # hack to get around extra space for word 1 | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
def breakLines(self, text, width, fontName, fontSize): """Returns a structure broken into lines. Each line has two items. Item one is the extra points of space available on that line; item two is the list of words themselves. This structure can be used to easily draw paragraphs with the various alignments. You can supply either a single width or a list of widths; the latter will have its last item repeated until necessary. A 2-element list is useful when there is a different first line indent; a longer list could be created to facilitate custom wraps around irregular objects.""" if type(width) <> types.ListType: maxwidths = [width] else: maxwidths = width lines = [] spacewidth = pdfmetrics.stringwidth(' ', fontName) * 0.001 * fontSize words = string.split(text, ' ') currentline = [] lineno = 0 maxwidth = maxwidths[lineno] currentwidth = - spacewidth # hack to get around extra space for word 1 | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def breakLines(self, text, width, fontName, fontSize): """Returns a structure broken into lines. Each line has two items. Item one is the extra points of space available on that line; item two is the list of words themselves. This structure can be used to easily draw paragraphs with the various alignments. You can supply either a single width or a list of widths; the latter will have its last item repeated until necessary. A 2-element list is useful when there is a different first line indent; a longer list could be created to facilitate custom wraps around irregular objects.""" if type(width) <> types.ListType: maxwidths = [width] else: maxwidths = width lines = [] spacewidth = pdfmetrics.stringwidth(' ', fontName) * 0.001 * fontSize words = string.split(text, ' ') currentline = [] lineno = 0 maxwidth = maxwidths[lineno] currentwidth = - spacewidth # hack to get around extra space for word 1 | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def breakLines(self, text, width, fontName, fontSize): """Returns a structure broken into lines. Each line has two items. Item one is the extra points of space available on that line; item two is the list of words themselves. This structure can be used to easily draw paragraphs with the various alignments. You can supply either a single width or a list of widths; the latter will have its last item repeated until necessary. A 2-element list is useful when there is a different first line indent; a longer list could be created to facilitate custom wraps around irregular objects.""" if type(width) <> types.ListType: maxwidths = [width] else: maxwidths = width lines = [] spacewidth = pdfmetrics.stringwidth(' ', fontName) * 0.001 * fontSize words = string.split(text, ' ') currentline = [] lineno = 0 maxwidth = maxwidths[lineno] currentwidth = - spacewidth # hack to get around extra space for word 1 | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite.""" text = cleanBlockQuotedText(self.text) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
cur_x = self.style.leftIndent | cur_x = self.style.leftIndent | def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite.""" text = cleanBlockQuotedText(self.text) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite.""" text = cleanBlockQuotedText(self.text) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite.""" text = cleanBlockQuotedText(self.text) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite.""" text = cleanBlockQuotedText(self.text) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite.""" text = cleanBlockQuotedText(self.text) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite.""" text = cleanBlockQuotedText(self.text) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite.""" text = cleanBlockQuotedText(self.text) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite.""" text = cleanBlockQuotedText(self.text) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
tx2 = canvas.beginText(self.style.bulletIndent, cur_y) | tx2 = canvas.beginText(self.style.bulletIndent, cur_y) | def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite.""" text = cleanBlockQuotedText(self.text) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite.""" text = cleanBlockQuotedText(self.text) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite.""" text = cleanBlockQuotedText(self.text) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite.""" text = cleanBlockQuotedText(self.text) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite.""" text = cleanBlockQuotedText(self.text) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
cur_y = cur_y - self.style.leading | cur_y = cur_y - self.style.leading | def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite.""" text = cleanBlockQuotedText(self.text) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite.""" text = cleanBlockQuotedText(self.text) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def __init__(self, text, style, bulletText = None, dedent=0): self.style = style self.bulletText = bulletText | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def __init__(self, text, style, bulletText = None, dedent=0): self.style = style self.bulletText = bulletText | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def wrap(self, availWidth, availHeight): self.width = availWidth self.height = (self.style.spaceBefore + self.style.leading * len(self.lines) + self.style.spaceAfter) return (self.width, self.height) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
cur_x = self.style.leftIndent | cur_x = self.style.leftIndent | def draw(self): #call another method for historical reasons. Besides, I #suspect I will be playing with alternate drawing routines #so not doing it here makes it easier to switch. cur_x = self.style.leftIndent cur_y = self.height - self.style.spaceBefore - self.style.fontSize self.canv.addLiteral('%PreformattedPara') | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
tx = self.canv.beginText(cur_x, cur_y) | tx = self.canv.beginText(cur_x, cur_y) | def draw(self): #call another method for historical reasons. Besides, I #suspect I will be playing with alternate drawing routines #so not doing it here makes it easier to switch. cur_x = self.style.leftIndent cur_y = self.height - self.style.spaceBefore - self.style.fontSize self.canv.addLiteral('%PreformattedPara') | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
def draw(self): #call another method for historical reasons. Besides, I #suspect I will be playing with alternate drawing routines #so not doing it here makes it easier to switch. cur_x = self.style.leftIndent cur_y = self.height - self.style.spaceBefore - self.style.fontSize self.canv.addLiteral('%PreformattedPara') | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def draw(self): #call another method for historical reasons. Besides, I #suspect I will be playing with alternate drawing routines #so not doing it here makes it easier to switch. cur_x = self.style.leftIndent cur_y = self.height - self.style.spaceBefore - self.style.fontSize self.canv.addLiteral('%PreformattedPara') | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def __init__(self, filename, width=None, height=None): """If size to draw at not specified, get it from the image.""" import Image #this will raise an error if they do not have PIL. self.filename = filename img = Image.open(filename) (self.imageWidth, self.imageHeight) = img.size if width: self.drawWidth = width else: self.drawWidth = self.imageWidth if height: self.drawHeight = height else: self.drawHeight = self.imageHeight | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
## def __init__(self, colWidths, rowHeights): | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
## def __init__(self, colWidths, rowHeights): | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
## def __init__(self, colWidths, rowHeights): | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
## def wrap(self, availWidth, availHeight): | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
## def __init__(self, colWidths, rowHeights, data): | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
## def addLines(self, col1, row1, col2, row2, width=1): | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
## def addLines(self, col1, row1, col2, row2, width=1): | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
## def draw(self): | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
## def drawLines(self): | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
## def drawLines(self): | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
## def getCellRect(self, col, row): | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
## def drawText(self): | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
## def drawText(self): | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def wrap(self, availWidth, availHeight): self.width = availWidth self.height = availHeight return (availWidth,availHeight) #step back a point | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def draw(self): pass # #self.canv.drawRect(0, 0, self.width, self.height) #self.canv.drawLine(0, 0, self.width, self.height) #self.canv.drawLine(0, self.height, self.width, 0) #self.text = 'Page Break Object (%d x %d)' % (self.width, self.height) ##centre the text #self.canv._currentFont = self.canv.defaultFont #f = Font(size=24,bold=1) #w = self.canv.stringWidth(self.text, f) #x = 0.5 * (self.width - w) #y = 0.33 * (self.height + f.size) #self.canv.drawString(self.text, x, y, font=f) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def draw(self): exec self.command in globals(), {'canvas':self.canv} | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def __init__(self, canvas, x1, y1, width,height): self.canvas = canvas | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
self.objects = [] | self.objects = [] | def __init__(self, canvas, x1, y1, width,height): self.canvas = canvas | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
def __init__(self, canvas, x1, y1, width,height): self.canvas = canvas | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def addFromList(self, drawlist): """Consumes objects from the front of the list until the frame is full. If it cannot fit one object, raises an exception.""" | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def __init__(self): self.dict = {} | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def next(self, category): if self.dict.has_key(category): self.dict[category] = self.dict[category] + 1 else: self.dict[category] = 1 return self.dict[category] | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def _doNothing(drawables, doc): "Dummy callback for onFirstPage and onNewPage" pass | def reset(self, category): self.dict[category] = 0 | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
|
self.showBoundary=showBoundary | self.showBoundary=showBoundary | def __init__(self, filename, pagesize, showBoundary=0): self.filename = filename self.pagesize = pagesize self.showBoundary=showBoundary #sensibel defaults; override if you wish self.leftMargin = inch self.bottomMargin = inch self.rightMargin = self.pagesize[0] - inch self.topMargin = self.pagesize[1] - inch | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
self.page = 1 | self.page = 1 | def __init__(self, filename, pagesize, showBoundary=0): self.filename = filename self.pagesize = pagesize self.showBoundary=showBoundary #sensibel defaults; override if you wish self.leftMargin = inch self.bottomMargin = inch self.rightMargin = self.pagesize[0] - inch self.topMargin = self.pagesize[1] - inch | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
self.onFirstPage = self.doNothing self.onNewPage = self.doNothing def doNothing(self, drawables, doc): "Dummy callback for onFirstPage and onNewPage" pass | self.onFirstPage = _doNothing self.onNewPage = _doNothing | def __init__(self, filename, pagesize, showBoundary=0): self.filename = filename self.pagesize = pagesize self.showBoundary=showBoundary #sensibel defaults; override if you wish self.leftMargin = inch self.bottomMargin = inch self.rightMargin = self.pagesize[0] - inch self.topMargin = self.pagesize[1] - inch | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
def build(self, drawables): canv = canvas.Canvas(self.filename) #canv.setPageTransition('Dissolve') | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def build(self, drawables): canv = canvas.Canvas(self.filename) #canv.setPageTransition('Dissolve') | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def build(self, drawables): canv = canvas.Canvas(self.filename) #canv.setPageTransition('Dissolve') | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def randomText(): #this may or may not be appropriate in your company from random import randint, choice RANDOMWORDS = ['strategic','direction','proactive', 'reengineering','forecast','resources', 'forward-thinking','profit','growth','doubletalk', 'venture capital','IPO'] sentences = 5 output = "" for sentenceno in range(randint(1,5)): output = output + 'Blah' for wordno in range(randint(10,25)): if randint(0,4)==0: word = choice(RANDOMWORDS) else: word = 'blah' output = output + ' ' +word output = output+'.' return output | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def myFirstPage(canvas, doc): canvas.saveState() canvas.setStrokeColorRGB(1,0,0) canvas.setLineWidth(5) canvas.line(66,72,66,PAGE_HEIGHT-72) canvas.setFont('Times-Bold',24) canvas.drawString(108, PAGE_HEIGHT-108, "PLATYPUS") canvas.setFont('Times-Roman',12) canvas.drawString(4 * inch, 0.75 * inch, "First Page") canvas.restoreState() | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def myLaterPages(canvas, doc): #canvas.drawImage("snkanim.gif", 36, 36) canvas.saveState() canvas.setStrokeColorRGB(1,0,0) canvas.setLineWidth(5) canvas.line(66,72,66,PAGE_HEIGHT-72) canvas.setFont('Times-Roman',12) canvas.drawString(4 * inch, 0.75 * inch, "Page %d" % doc.page) canvas.restoreState() | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def run(): objects_to_draw = [] #need a style normal = ParagraphStyle('normal') normal.firstLineIndent = 18 normal.spaceBefore = 6 import random for i in range(15): height = 0.5 + (2*random.random()) box = XBox(6 * inch, height * inch, 'Box Number %d' % i) objects_to_draw.append(box) para = Paragraph(randomText(), normal) objects_to_draw.append(para) doc = SimpleFlowDocument('platypus.pdf',DEFAULT_PAGE_SIZE) doc.onFirstPage = myFirstPage doc.onNewPage = myLaterPages doc.build(objects_to_draw) | 0a3005e58658b34c80170c55abb5ba2f74e8209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0a3005e58658b34c80170c55abb5ba2f74e8209b/layout.py |
||
def __init__(self): assert self.__class__.__name__!='ValueAxis', 'Abstract Class ValueAxis Instantiated' self._configured = 0 # private properties set by methods. The initial values # here are to make demos easy; they would always be # overridden in real life. self._x = 50 self._y = 50 self._length = 100 | d2c9c6bb54e998896c5e1ba41fdd6da642b96fdf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/d2c9c6bb54e998896c5e1ba41fdd6da642b96fdf/axes.py |
||
return filter(lambda x: x is not None, self._attrMap['kind']._enum) | return filter(lambda x: x is not None, self._attrMap['kind'].validate._enum) | def availableFlagNames(self): '''return a list of the things we can display''' return filter(lambda x: x is not None, self._attrMap['kind']._enum) | e0fe0f69db7a6eb253a9125586f62ba072100236 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/e0fe0f69db7a6eb253a9125586f62ba072100236/flags.py |
projdir = py2pdf_dir cvsdir = os.path.join(groupdir,projdir) | pdir = py2pdf_dir cvsdir = os.path.join(groupdir,pdir) else: pdir = projdir | def do_zip(d): 'create .tgz and .zip file archives of d/reportlab' os.chdir(d) if release: b = tagname else: b = py2pdf and "py2pdf" or "current" tarfile = '%s/%s.tgz' % (groupdir,b) zipfile = '%s/%s.zip' % (groupdir,b) if py2pdf: projdir = py2pdf_dir cvsdir = os.path.join(groupdir,projdir) tar = find_exe('tar') if tar is not None: safe_remove(tarfile) do_exec('%s czvf %s %s' % (tar, tarfile, projdir), 'tar creation') zip = find_exe('zip') if zip is not None: safe_remove(zipfile) do_exec('%s -ur %s %s' % (zip, zipfile, projdir), 'zip creation') recursive_rmdir(cvsdir) if release: # make links to the latest outcome for b in ['reportlab','current']: ltarfile = '%s/%s.tgz' % (groupdir,b) lzipfile = '%s/%s.zip' % (groupdir,b) safe_remove(lzipfile) safe_remove(ltarfile) os.symlink(zipfile,lzipfile) os.symlink(tarfile,ltarfile) | 2108d82c74d584b5a877cc395240269b664bcfa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2108d82c74d584b5a877cc395240269b664bcfa9/daily.py |
do_exec('%s czvf %s %s' % (tar, tarfile, projdir), 'tar creation') | do_exec('%s czvf %s %s' % (tar, tarfile, pdir), 'tar creation') | def do_zip(d): 'create .tgz and .zip file archives of d/reportlab' os.chdir(d) if release: b = tagname else: b = py2pdf and "py2pdf" or "current" tarfile = '%s/%s.tgz' % (groupdir,b) zipfile = '%s/%s.zip' % (groupdir,b) if py2pdf: projdir = py2pdf_dir cvsdir = os.path.join(groupdir,projdir) tar = find_exe('tar') if tar is not None: safe_remove(tarfile) do_exec('%s czvf %s %s' % (tar, tarfile, projdir), 'tar creation') zip = find_exe('zip') if zip is not None: safe_remove(zipfile) do_exec('%s -ur %s %s' % (zip, zipfile, projdir), 'zip creation') recursive_rmdir(cvsdir) if release: # make links to the latest outcome for b in ['reportlab','current']: ltarfile = '%s/%s.tgz' % (groupdir,b) lzipfile = '%s/%s.zip' % (groupdir,b) safe_remove(lzipfile) safe_remove(ltarfile) os.symlink(zipfile,lzipfile) os.symlink(tarfile,ltarfile) | 2108d82c74d584b5a877cc395240269b664bcfa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2108d82c74d584b5a877cc395240269b664bcfa9/daily.py |
do_exec('%s -ur %s %s' % (zip, zipfile, projdir), 'zip creation') | do_exec('%s -ur %s %s' % (zip, zipfile, pdir), 'zip creation') | def do_zip(d): 'create .tgz and .zip file archives of d/reportlab' os.chdir(d) if release: b = tagname else: b = py2pdf and "py2pdf" or "current" tarfile = '%s/%s.tgz' % (groupdir,b) zipfile = '%s/%s.zip' % (groupdir,b) if py2pdf: projdir = py2pdf_dir cvsdir = os.path.join(groupdir,projdir) tar = find_exe('tar') if tar is not None: safe_remove(tarfile) do_exec('%s czvf %s %s' % (tar, tarfile, projdir), 'tar creation') zip = find_exe('zip') if zip is not None: safe_remove(zipfile) do_exec('%s -ur %s %s' % (zip, zipfile, projdir), 'zip creation') recursive_rmdir(cvsdir) if release: # make links to the latest outcome for b in ['reportlab','current']: ltarfile = '%s/%s.tgz' % (groupdir,b) lzipfile = '%s/%s.zip' % (groupdir,b) safe_remove(lzipfile) safe_remove(ltarfile) os.symlink(zipfile,lzipfile) os.symlink(tarfile,ltarfile) | 2108d82c74d584b5a877cc395240269b664bcfa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2108d82c74d584b5a877cc395240269b664bcfa9/daily.py |
if self._atTop: s = flowable.getSpaceBefore() | if not 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 = 0 if self._atTop: s = flowable.getSpaceBefore() flowable.canv = canv #some flowables might need this r = flowable.split(self._aW, y-p-s) del flowable.canv return r | f1d00f4a2983c887927a53d2593008f6eb946564 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f1d00f4a2983c887927a53d2593008f6eb946564/frames.py |
def addFromList(self, drawlist, canv): """Consumes objects from the front of the list until the frame is full. If it cannot fit one object, raises an exception.""" | f1d00f4a2983c887927a53d2593008f6eb946564 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/f1d00f4a2983c887927a53d2593008f6eb946564/frames.py |
||
obj.contents.append(newChild) | a(newChild) | def expandUserNodes(self): """Return a new object which only contains primitive shapes.""" | bcc4d7e15d2cb3a7d0ac11e4b804a485ad4b9b11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bcc4d7e15d2cb3a7d0ac11e4b804a485ad4b9b11/shapes.py |
if k in self_contents: | if v in self_contents: | def _copyNamedContents(self,obj,aKeys=None,noCopy=('contents',)): from copy import copy self_contents = self.contents if not aKeys: aKeys = self._attrMap.keys() for (k, v) in self.__dict__.items(): if k in self_contents: pos = self_contents.index(v) setattr(obj, oldKey, obj.contents[pos]) elif k in aKeys and k not in noCopy: setattr(obj, k, copy(v)) | bcc4d7e15d2cb3a7d0ac11e4b804a485ad4b9b11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bcc4d7e15d2cb3a7d0ac11e4b804a485ad4b9b11/shapes.py |
setattr(obj, oldKey, obj.contents[pos]) | setattr(obj, k, obj.contents[pos]) | def _copyNamedContents(self,obj,aKeys=None,noCopy=('contents',)): from copy import copy self_contents = self.contents if not aKeys: aKeys = self._attrMap.keys() for (k, v) in self.__dict__.items(): if k in self_contents: pos = self_contents.index(v) setattr(obj, oldKey, obj.contents[pos]) elif k in aKeys and k not in noCopy: setattr(obj, k, copy(v)) | bcc4d7e15d2cb3a7d0ac11e4b804a485ad4b9b11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/bcc4d7e15d2cb3a7d0ac11e4b804a485ad4b9b11/shapes.py |
ascent=getFont(fontName).face.ascent | ascent=getFont(fontName).face.ascent/1000. | def gAdd(t,g=g,fontName=fontName,fontSize=fontSize,fillColor=fillColor): t.fontName = fontName t.fontSize = fontSize t.fillColor = fillColor return g.add(t) | ffb3cf9b57de629f9f5c5236ffcd94640c30be87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ffb3cf9b57de629f9f5c5236ffcd94640c30be87/legends.py |
def findT1File(self,ext='.pfb'): | def findT1File(self, ext='.pfb'): | def findT1File(self,ext='.pfb'): possible_exts = (string.lower(ext), string.upper(ext)) if hasattr(self,'pfbFileName'): r_basename = os.path.splitext(self.pfbFileName)[0] for e in possible_exts: if os.path.isfile(r_basename + e): return r_basename + e try: r = _fontdata.findT1File(self.name) except: afm = bruteForceSearchForAFM(self.name) if afm: if ext == '.pfb': for e in possible_exts: pfb = os.path.splitext(afm)[0] + e if os.path.isfile(pfb): r = pfb else: r = None elif ext == '.afm': r = afm else: r = None if r is None: warnOnce("Can't find %s for face '%s'" % (ext, self.name)) return r | 922c14bfb04eba279f5c9a4499839c1aa941eb81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/922c14bfb04eba279f5c9a4499839c1aa941eb81/pdfmetrics.py |
if ext == '.pfb': | if string.lower(ext) == '.pfb': | def findT1File(self,ext='.pfb'): possible_exts = (string.lower(ext), string.upper(ext)) if hasattr(self,'pfbFileName'): r_basename = os.path.splitext(self.pfbFileName)[0] for e in possible_exts: if os.path.isfile(r_basename + e): return r_basename + e try: r = _fontdata.findT1File(self.name) except: afm = bruteForceSearchForAFM(self.name) if afm: if ext == '.pfb': for e in possible_exts: pfb = os.path.splitext(afm)[0] + e if os.path.isfile(pfb): r = pfb else: r = None elif ext == '.afm': r = afm else: r = None if r is None: warnOnce("Can't find %s for face '%s'" % (ext, self.name)) return r | 922c14bfb04eba279f5c9a4499839c1aa941eb81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/922c14bfb04eba279f5c9a4499839c1aa941eb81/pdfmetrics.py |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.