bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def breakLines(self, width): """ Returns a broken line structure. There are two cases
def breakLines(self, width): """ Returns a broken line structure. There are two cases
4,800
def breakLines(self, width): """ Returns a broken line structure. There are two cases
def breakLines(self, width): """ Returns a broken line structure. There are two cases
4,801
def breakLines(self, width): """ Returns a broken line structure. There are two cases
def breakLines(self, width): """ Returns a broken line structure. There are two cases
4,802
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)
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)
4,803
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 = [] f...
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 = [] f...
4,804
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.enco...
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.enco...
4,805
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 findFontAndRegi...
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 findFontAndRegi...
4,806
def makeBars(self): g = Group()
def makeBars(self): g = Group()
4,807
def makeBars(self): g = Group()
def makeBars(self): g = Group()
4,808
def test0(self): "Test if pythonpoint.pdf can be created from pythonpoint.xml."
def test0(self): "Test if pythonpoint.pdf can be created from pythonpoint.xml."
4,809
def test0(self): "Test if pythonpoint.pdf can be created from pythonpoint.xml."
def test0(self): "Test if pythonpoint.pdf can be created from pythonpoint.xml."
4,810
def test0(self): "Test if pythonpoint.pdf can be created from pythonpoint.xml."
deftest0(self):"Testifpythonpoint.pdfcanbecreatedfrompythonpoint.xml."
4,811
def makeSuite(): return makeSuiteForClasses(PythonPointTestCase)
def makeSuite(): return makeSuiteForClasses(PythonPointTestCase)
4,812
def __setattr__(self, key, value): if self.defaults.has_key(key): self.attributes[key] = value else: self.__dict__[key] = value
def __setattr__(self, key, value): if self.defaults.has_key(key): self.attributes[key] = value else: self.__dict__[key] = value
4,813
def __repr__(self): return "<%s '%s'>" % (self.__class__.__name__, self.name)
def __repr__(self): return "<%s '%s'>" % (self.__class__.__name__, self.name)
4,814
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 = %...
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 = %...
4,815
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) ...
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) ...
4,816
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) ...
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) ...
4,817
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) ...
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) ...
4,818
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) ...
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) ...
4,819
def cleanBlockQuotedText(text): """This is an internal utility which takes triple- quoted text form within the document and returns (hopefully) the paragraph the user intended originally.""" stripped = string.strip(text) lines = string.split(stripped, '\n') trimmed_lines = map(string.lstrip, lines) return string.join(t...
def cleanBlockQuotedText(text): """This is an internal utility which takes triple- quoted text form within the document and returns (hopefully) the paragraph the user intended originally.""" stripped = string.strip(text) lines = string.split(stripped, '\n') trimmed_lines = map(string.lstrip, lines) return string.join(t...
4,820
def __init__(self): self.width = 0 self.height = 0 self.wrapped = 0
def __init__(self): self.width = 0 self.height = 0 self.wrapped = 0
4,821
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)
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)
4,822
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)
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)
4,823
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.
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.
4,824
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]
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]
4,825
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 ...
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 ...
4,826
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 ...
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 ...
4,827
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 ...
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 ...
4,828
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 ...
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 ...
4,829
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)
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)
4,830
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)
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)
4,831
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)
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)
4,832
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)
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)
4,833
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)
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)
4,834
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)
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)
4,835
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)
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)
4,836
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)
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)
4,837
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)
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)
4,838
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)
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)
4,839
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)
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)
4,840
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)
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)
4,841
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)
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)
4,842
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)
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)
4,843
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)
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)
4,844
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)
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)
4,845
def __init__(self, text, style, bulletText = None, dedent=0): self.style = style self.bulletText = bulletText
def __init__(self, text, style, bulletText = None, dedent=0): self.style = style self.bulletText = bulletText
4,846
def __init__(self, text, style, bulletText = None, dedent=0): self.style = style self.bulletText = bulletText
def __init__(self, text, style, bulletText = None, dedent=0): self.style = style self.bulletText = bulletText
4,847
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)
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)
4,848
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')
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')
4,849
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')
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')
4,850
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')
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')
4,851
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')
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')
4,852
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:...
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:...
4,853
## def __init__(self, colWidths, rowHeights):
## def __init__(self, colWidths, rowHeights):
4,854
## def __init__(self, colWidths, rowHeights):
## def __init__(self, colWidths, rowHeights):
4,855
## def __init__(self, colWidths, rowHeights):
## def __init__(self, colWidths, rowHeights):
4,856
## def wrap(self, availWidth, availHeight):
## def wrap(self, availWidth, availHeight):
4,857
## def __init__(self, colWidths, rowHeights, data):
## def __init__(self, colWidths, rowHeights, data):
4,858
## def addLines(self, col1, row1, col2, row2, width=1):
## def addLines(self, col1, row1, col2, row2, width=1):
4,859
## def addLines(self, col1, row1, col2, row2, width=1):
## def addLines(self, col1, row1, col2, row2, width=1):
4,860
## def draw(self):
## def draw(self):
4,861
## def drawLines(self):
## def drawLines(self):
4,862
## def drawLines(self):
## def drawLines(self):
4,863
## def getCellRect(self, col, row):
## def getCellRect(self, col, row):
4,864
## def drawText(self):
## def drawText(self):
4,865
## def drawText(self):
## def drawText(self):
4,866
def wrap(self, availWidth, availHeight): self.width = availWidth self.height = availHeight return (availWidth,availHeight) #step back a point
def wrap(self, availWidth, availHeight): self.width = availWidth self.height = availHeight return (availWidth,availHeight) #step back a point
4,867
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 = Fo...
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 = Fo...
4,868
def draw(self): exec self.command in globals(), {'canvas':self.canv}
def draw(self): exec self.command in globals(), {'canvas':self.canv}
4,869
def __init__(self, canvas, x1, y1, width,height): self.canvas = canvas
def __init__(self, canvas, x1, y1, width,height): self.canvas = canvas
4,870
def __init__(self, canvas, x1, y1, width,height): self.canvas = canvas
def __init__(self, canvas, x1, y1, width,height): self.canvas = canvas
4,871
def __init__(self, canvas, x1, y1, width,height): self.canvas = canvas
def __init__(self, canvas, x1, y1, width,height): self.canvas = canvas
4,872
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."""
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."""
4,873
def __init__(self): self.dict = {}
def __init__(self): self.dict = {}
4,874
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]
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]
4,875
def reset(self, category): self.dict[category] = 0
def reset(self, category): self.dict[category] = 0
4,876
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
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
4,877
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
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
4,878
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
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
4,879
def build(self, drawables): canv = canvas.Canvas(self.filename) #canv.setPageTransition('Dissolve')
def build(self, drawables): canv = canvas.Canvas(self.filename) #canv.setPageTransition('Dissolve')
4,880
def build(self, drawables): canv = canvas.Canvas(self.filename) #canv.setPageTransition('Dissolve')
def build(self, drawables): canv = canvas.Canvas(self.filename) #canv.setPageTransition('Dissolve')
4,881
def build(self, drawables): canv = canvas.Canvas(self.filename) #canv.setPageTransition('Dissolve')
def build(self, drawables): canv = canvas.Canvas(self.filename) #canv.setPageTransition('Dissolve')
4,882
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 r...
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 r...
4,883
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....
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....
4,884
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()
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()
4,885
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(), nor...
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(), nor...
4,886
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
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
4,887
def availableFlagNames(self): '''return a list of the things we can display''' return filter(lambda x: x is not None, self._attrMap['kind']._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)
4,888
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...
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: pdir = py2pdf_dir cvsdir = os.path.join(groupdir,pdir) else: pdir = projdir tar = fin...
4,889
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...
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...
4,890
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...
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...
4,891
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
def split(self,flowable,canv): '''Ask the flowable to split using up the available space.''' y = self._y p = self._y1p s = 0 if not 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
4,892
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."""
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."""
4,893
def expandUserNodes(self): """Return a new object which only contains primitive shapes."""
def expandUserNodes(self): """Return a new object which only contains primitive shapes."""
4,894
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 n...
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 v in self_contents: pos = self_contents.index(v) setattr(obj, oldKey, obj.contents[pos]) elif k in aKeys and k not in n...
4,895
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 n...
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, k, obj.contents[pos]) elif k in aKeys and k not in noCopy...
4,896
def gAdd(t,g=g,fontName=fontName,fontSize=fontSize,fillColor=fillColor): t.fontName = fontName t.fontSize = fontSize t.fillColor = fillColor return g.add(t)
def gAdd(t,g=g,fontName=fontName,fontSize=fontSize,fillColor=fillColor): t.fontName = fontName t.fontSize = fontSize t.fillColor = fillColor return g.add(t)
4,897
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 = bruteForceSea...
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 = bruteForceSe...
4,898
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 = bruteForceSea...
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 = bruteForceSea...
4,899