bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def _addCommand(self,cmd): if cmd[0] == 'BACKGROUND': self._bkgrndcmds.append(cmd) if cmd[0] == 'ROWBACKGROUNDS': self._bkgrndcmds.append(cmd) if cmd[0] == 'COLBACKGROUNDS': self._bkgrndcmds.append(cmd) elif cmd[0] == 'SPAN': self._spanCmds.append(cmd) elif _isLineCommand(cmd): # we expect op, start, stop, weight, colo...
def _addCommand(self,cmd): if cmd[0] in ('BACKGROUND','ROWBACKGROUNDS','COLBACKGROUNDS'): self._bkgrndcmds.append(cmd) elif cmd[0] == 'SPAN': self._spanCmds.append(cmd) elif _isLineCommand(cmd): # we expect op, start, stop, weight, colour, cap, dashes, join cmd = tuple(cmd) if len(cmd)<5: raise ValueError('bad line com...
5,300
def _drawBkgrnd(self): nrows = self._nrows ncols = self._ncols for cmd, (sc, sr), (ec, er), arg in self._bkgrndcmds: if sc < 0: sc = sc + ncols if ec < 0: ec = ec + ncols if sr < 0: sr = sr + nrows if er < 0: er = er + nrows x0 = self._colpositions[sc] y0 = self._rowpositions[sr] x1 = self._colpositions[min(ec+1,ncols)...
def _drawBkgrnd(self): nrows = self._nrows ncols = self._ncols for cmd, (sc, sr), (ec, er), arg in self._bkgrndcmds: if sc < 0: sc = sc + ncols if ec < 0: ec = ec + ncols if sr < 0: sr = sr + nrows if er < 0: er = er + nrows x0 = self._colpositions[sc] y0 = self._rowpositions[sr] x1 = self._colpositions[min(ec+1,ncols)...
5,301
def _drawBkgrnd(self): nrows = self._nrows ncols = self._ncols for cmd, (sc, sr), (ec, er), arg in self._bkgrndcmds: if sc < 0: sc = sc + ncols if ec < 0: ec = ec + ncols if sr < 0: sr = sr + nrows if er < 0: er = er + nrows x0 = self._colpositions[sc] y0 = self._rowpositions[sr] x1 = self._colpositions[min(ec+1,ncols)...
defelse: canv.setFillColor(colors.toColor(arg)) canv.rect(x0, y0, w, h, stroke=0,fill=1) _drawBkgrnd(self):else: canv.setFillColor(colors.toColor(arg)) canv.rect(x0, y0, w, h, stroke=0,fill=1) nrowselse: canv.setFillColor(colors.toColor(arg)) canv.rect(x0, y0, w, h, stroke=0,fill=1) =else: canv.setFillColor(colors.toCo...
5,302
def _writeLogFile(self, objType): "Write log file for different kind of documentable objects." cwd = os.getcwd()
def _writeLogFile(self, objType): "Write log file for different kind of documentable objects." cwd = os.getcwd()
5,303
def updateWithContentsOfArgv(self, argv): "Update options as specified in a (command line) argument vector." # Specify accepted short option names (UNIX style). shortOpts = 'hv'
def updateWithContentsOfArgv(self, argv): "Update options as specified in a (command line) argument vector." # Specify accepted short option names (UNIX style). shortOpts = 'hv'
5,304
def main(cmdline): "Process command line as if it were sys.argv" # Create default options and initialize with argv # from the command line. options = Options() options.updateWithContentsOfArgv(cmdline[1:]) # Print help message if desired, then exit. if options.h or options.help: print __doc__ sys.exit() # Apply mode...
def main(cmdline): "Process command line as if it were sys.argv" # Create default options and initialize with argv # from the command line. options = Options() options.updateWithContentsOfArgv(cmdline[1:]) # Print help message if desired, then exit. if options.h or options.help: print __doc__ sys.exit() # Apply mode...
5,305
def process(*args, **kwargs): "Provides a way of using py2pdf from within other Python scripts." noValOpts = 'landscape stdout lineNum marcs help multiPage noOutline' noValOpts = string.split(noValOpts, ' ') line = string.join(args, ' ') for k, v in kwargs.items(): if len(k) == 1: line = line + ' -%s=%s' % (k, v) eli...
def process(*args, **kwargs): "Provides a way of using py2pdf from within other Python scripts." noValOpts = 'h v verbose landscape stdout lineNum marcs help multiPage noOutline' noValOpts = string.split(noValOpts, ' ') line = string.join(args, ' ') for k, v in kwargs.items(): if len(k) == 1: line = line + ' -%s=%s' ...
5,306
def process(*args, **kwargs): "Provides a way of using py2pdf from within other Python scripts." noValOpts = 'landscape stdout lineNum marcs help multiPage noOutline' noValOpts = string.split(noValOpts, ' ') line = string.join(args, ' ') for k, v in kwargs.items(): if len(k) == 1: line = line + ' -%s=%s' % (k, v) eli...
def process(*args, **kwargs): "Provides a way of using py2pdf from within other Python scripts." noValOpts = 'landscape stdout lineNum marcs help multiPage noOutline' noValOpts = string.split(noValOpts, ' ') s = 'py2pdf.py' for k, v in kwargs.items(): if len(k) == 1: line = line + ' -%s=%s' % (k, v) elif len(k) > 1: ...
5,307
def process(*args, **kwargs): "Provides a way of using py2pdf from within other Python scripts." noValOpts = 'landscape stdout lineNum marcs help multiPage noOutline' noValOpts = string.split(noValOpts, ' ') line = string.join(args, ' ') for k, v in kwargs.items(): if len(k) == 1: line = line + ' -%s=%s' % (k, v) eli...
def process(*args, **kwargs): "Provides a way of using py2pdf from within other Python scripts." noValOpts = 'landscape stdout lineNum marcs help multiPage noOutline' noValOpts = string.split(noValOpts, ' ') line = string.join(args, ' ') for k, v in kwargs.items(): if len(k) == 1: s = s + ' -%s' % k if k not in noVal...
5,308
def process(*args, **kwargs): "Provides a way of using py2pdf from within other Python scripts." noValOpts = 'landscape stdout lineNum marcs help multiPage noOutline' noValOpts = string.split(noValOpts, ' ') line = string.join(args, ' ') for k, v in kwargs.items(): if len(k) == 1: line = line + ' -%s=%s' % (k, v) eli...
def process(*args, **kwargs): "Provides a way of using py2pdf from within other Python scripts." noValOpts = 'landscape stdout lineNum marcs help multiPage noOutline' noValOpts = string.split(noValOpts, ' ') line = string.join(args, ' ') for k, v in kwargs.items(): if len(k) == 1: line = line + ' -%s=%s' % (k, v) eli...
5,309
def _add(self, flowable, canv, trySplit=0): """ Draws the flowable at the current position. Returns 1 if successful, 0 if it would not fit. Raises a LayoutError if the object is too wide, or if it is too high for a totally empty frame, to avoid infinite loops""" y = self._y p = self._y1p s = 0 if not self._atTop: s = f...
def _add(self, flowable, canv, trySplit=0): """ Draws the flowable at the current position. Returns 1 if successful, 0 if it would not fit. Raises a LayoutError if the object is too wide, or if it is too high for a totally empty frame, to avoid infinite loops""" y = self._y p = self._y1p s = 0 if not self._atTop: s = f...
5,310
def insert(self, i, n, name=None): 'Inserts sub-node n in contents at specified location' assert isValidChild(n), "Can only insert Shape or UserNode objects in a Group" if i<0: self.contents[i:i] =[n] else: slf.contents.insert(i,n) self._addNamedNode(name,n)
def insert(self, i, n, name=None): 'Inserts sub-node n in contents at specified location' assert isValidChild(n), "Can only insert Shape or UserNode objects in a Group" if i<0: self.contents[i:i] =[n] else: self.contents.insert(i,n) self._addNamedNode(name,n)
5,311
def prepareCanvas(self, canvas): """You can ask a LineStyle to set up the canvas for drawing the lines.""" canvas.setLineWidth(1) #etc. etc.
def prepareCanvas(self, canvas): """You can ask a LineStyle to set up the canvas for drawing the lines.""" canvas.setLineWidth(1) #etc. etc.
5,312
def Paragraph(text, style, bulletText=None, frags=None)
def Paragraph(text, style, bulletText=None, frags=None)
5,313
def format(self, maxwidth, maxheight, program, leading=0): "return program with line operations added if at least one line fits" # note: a generated formatted segment should not be formatted again startstate = self.__dict__.copy() #remainder = self.cleanProgram(program) remainder = program[:] #program1 = remainder[:] #...
def format(self, maxwidth, maxheight, program, leading=0): "return program with line operations added if at least one line fits" # note: a generated formatted segment should not be formatted again startstate = self.__dict__.copy() #remainder = self.cleanProgram(program) remainder = program[:] #program1 = remainder[:] #...
5,314
def runOpCodes(self, program, canvas, textobject): "render the line(s)"
deftextobject.setFont(self.fontName, self.fontSize) runOpCodes(self,textobject.setFont(self.fontName, self.fontSize) program,textobject.setFont(self.fontName, self.fontSize) canvas,textobject.setFont(self.fontName, self.fontSize) textobject):textobject.setFont(self.fontName, self.fontSize) "rendertextobject.setFont(sel...
5,315
def translate(self, nodetuple, controller, context, overrides): thepara = ("para", {}, [nodetuple], None) return theParaMapper.translate(thepara, controller, context, overrides)
def translate(self, nodetuple, controller, context, overrides): thepara = ("para", {}, [nodetuple], None) return theParaMapper.translate(thepara, controller, context, overrides)
5,316
def test2(canv): #print test_program; return from reportlab.lib.units import inch from reportlab.lib.styles import ParagraphStyle from reportlab.lib import rparsexml parsedpara = rparsexml.parsexmlSimple(testparagraph) S = ParagraphStyle("Normal", None) P = Para(S, parsedpara) (w, h) = P.wrap(5*inch, 10*inch) print "wr...
def test2(canv): #print test_program; return from reportlab.lib.units import inch from reportlab.lib.styles import ParagraphStyle from reportlab.lib import rparsexml parsedpara = rparsexml.parsexmlSimple(testparagraph,entityReplacer=None) S = ParagraphStyle("Normal", None) P = Para(S, parsedpara) (w, h) = P.wrap(5*inch...
5,317
def test2(canv): #print test_program; return from reportlab.lib.units import inch from reportlab.lib.styles import ParagraphStyle from reportlab.lib import rparsexml parsedpara = rparsexml.parsexmlSimple(testparagraph) S = ParagraphStyle("Normal", None) P = Para(S, parsedpara) (w, h) = P.wrap(5*inch, 10*inch) print "wr...
def test2(canv): #print test_program; return from reportlab.lib.units import inch from reportlab.lib.styles import ParagraphStyle from reportlab.lib import rparsexml parsedpara = rparsexml.parsexmlSimple(testparagraph) S = ParagraphStyle("Normal", None) P = Para(S, parsedpara) (w, h) = P.wrap(5*inch, 10*inch) print "wr...
5,318
def handleSpecialCharacters(engine, text, program=None, greeks=greeks): from string import whitespace # add space prefix if space here if text[0:1] in whitespace: program.append(" ") #print "handling", repr(text) # shortcut if 0 and "&" not in text: result = [] for x in text.split(): result.append(x+" ") if result: las...
def handleSpecialCharacters(engine, text, program=None, greeks=greeks): from string import whitespace # add space prefix if space here if text[0:1] in whitespace: program.append(" ") #print "handling", repr(text) # shortcut if 0 and "&" not in text: result = [] for x in text.split(): result.append(x+" ") if result: las...
5,319
def handleSpecialCharacters(engine, text, program=None, greeks=greeks): from string import whitespace # add space prefix if space here if text[0:1] in whitespace: program.append(" ") #print "handling", repr(text) # shortcut if 0 and "&" not in text: result = [] for x in text.split(): result.append(x+" ") if result: las...
def handleSpecialCharacters(engine, text, program=None, greeks=greeks): from string import whitespace # add space prefix if space here if text[0:1] in whitespace: program.append(" ") #print "handling", repr(text) # shortcut if 0 and "&" not in text: result = [] for x in text.split(): result.append(x+" ") if result: las...
5,320
def Paragraph(text, style, bulletText=None, frags=None, context=None): """ Paragraph(text, style, bulletText=None) intended to be like a platypus Paragraph but better. """ # if there is no & or < in text then use the fast paragraph if "&" not in text and "<" not in text: return FastPara(style, simpletext=text) else: # ...
def Paragraph(text, style, bulletText=None, frags=None, context=None): """ Paragraph(text, style, bulletText=None) intended to be like a platypus Paragraph but better. """ # if there is no & or < in text then use the fast paragraph if "&" not in text and "<" not in text: return FastPara(style, simpletext=text) else: # ...
5,321
def Paragraph(text, style, bulletText=None, frags=None, context=None): """ Paragraph(text, style, bulletText=None) intended to be like a platypus Paragraph but better. """ # if there is no & or < in text then use the fast paragraph if "&" not in text and "<" not in text: return FastPara(style, simpletext=text) else: # ...
def Paragraph(text, style, bulletText=None, frags=None, context=None): """ Paragraph(text, style, bulletText=None) intended to be like a platypus Paragraph but better. """ # if there is no & or < in text then use the fast paragraph if "&" not in text and "<" not in text: return FastPara(style, simpletext=text) else: # ...
5,322
def drawInlineImage(self, canvas): #, image, x,y, width=None,height=None): """Draw an Image into the specified rectangle. If width and height are omitted, they are calculated from the image size. Also allow file names as well as images. This allows a caching mechanism"""
def drawInlineImage(self, canvas): #, image, x,y, width=None,height=None): """Draw an Image into the specified rectangle. If width and height are omitted, they are calculated from the image size. Also allow file names as well as images. This allows a caching mechanism"""
5,323
def Paragraph(text, style, bulletText=None, frags=None)
def Paragraph(text, style, bulletText=None, frags=None)
5,324
def __init__(self, program = None): from reportlab.lib.colors import black if program is None: program = [] self.lineOpHandlers = [] # for handling underlining and hyperlinking, etc self.program = program #self. self.indent = self.rightIndent = 0.0 self.baseindent = 0.0 # adjust this to add more indentation for bullets...
def__init__(self,program=None):fromreportlab.lib.colorsimportblackifprogramisNone:program=[]self.lineOpHandlers=[]#forhandlingunderliningandhyperlinking,etcself.program=program#self.self.indent=self.rightIndent=0.0self.baseindent=0.0#adjustthistoaddmoreindentationforbullets,egself.fontName="Helvetica"self.fontSize=10se...
5,325
def format(self, maxwidth, maxheight, program, leading=0): "return program with line operations added if at least one line fits" # note: a generated formatted segment should not be formatted again startstate = self.__dict__.copy() #remainder = self.cleanProgram(program) remainder = program[:] #program1 = remainder[:] #...
def format(self, maxwidth, maxheight, program, leading=0): "return program with line operations added if at least one line fits" # note: a generated formatted segment should not be formatted again startstate = self.__dict__.copy() #remainder = self.cleanProgram(program) remainder = program[:] #program1 = remainder[:] #...
5,326
def format(self, maxwidth, maxheight, program, leading=0): "return program with line operations added if at least one line fits" # note: a generated formatted segment should not be formatted again startstate = self.__dict__.copy() #remainder = self.cleanProgram(program) remainder = program[:] #program1 = remainder[:] #...
def format(self, maxwidth, maxheight, program, leading=0): "return program with line operations added if at least one line fits" # note: a generated formatted segment should not be formatted again startstate = self.__dict__.copy() #remainder = self.cleanProgram(program) remainder = program[:] #program1 = remainder[:] #...
5,327
def format(self, maxwidth, maxheight, program, leading=0): "return program with line operations added if at least one line fits" # note: a generated formatted segment should not be formatted again startstate = self.__dict__.copy() #remainder = self.cleanProgram(program) remainder = program[:] #program1 = remainder[:] #...
def format(self, maxwidth, maxheight, program, leading=0): "return program with line operations added if at least one line fits" # note: a generated formatted segment should not be formatted again startstate = self.__dict__.copy() #remainder = self.cleanProgram(program) remainder = program[:] #program1 = remainder[:] #...
5,328
def fitLine(self, program, totalLength): "fit words (and other things) onto a line" # assuming word lengths and spaces have not been yet added # fit words onto a line up to maxlength, adding spaces and respecting extra space from types import StringType, TupleType, InstanceType, FloatType from reportlab.pdfbase.pdfmetr...
def fitLine(self, program, totalLength): "fit words (and other things) onto a line" # assuming word lengths and spaces have not been yet added # fit words onto a line up to maxlength, adding spaces and respecting extra space from reportlab.pdfbase.pdfmetrics import stringWidth usedIndent = self.indent maxLength = total...
5,329
def fitLine(self, program, totalLength): "fit words (and other things) onto a line" # assuming word lengths and spaces have not been yet added # fit words onto a line up to maxlength, adding spaces and respecting extra space from types import StringType, TupleType, InstanceType, FloatType from reportlab.pdfbase.pdfmetr...
def fitLine(self, program, totalLength): "fit words (and other things) onto a line" # assuming word lengths and spaces have not been yet added # fit words onto a line up to maxlength, adding spaces and respecting extra space from types import StringType, TupleType, InstanceType, FloatType from reportlab.pdfbase.pdfmetr...
5,330
def fitLine(self, program, totalLength): "fit words (and other things) onto a line" # assuming word lengths and spaces have not been yet added # fit words onto a line up to maxlength, adding spaces and respecting extra space from types import StringType, TupleType, InstanceType, FloatType from reportlab.pdfbase.pdfmetr...
def fitLine(self, program, totalLength): "fit words (and other things) onto a line" # assuming word lengths and spaces have not been yet added # fit words onto a line up to maxlength, adding spaces and respecting extra space from types import StringType, TupleType, InstanceType, FloatType from reportlab.pdfbase.pdfmetr...
5,331
def fitLine(self, program, totalLength): "fit words (and other things) onto a line" # assuming word lengths and spaces have not been yet added # fit words onto a line up to maxlength, adding spaces and respecting extra space from types import StringType, TupleType, InstanceType, FloatType from reportlab.pdfbase.pdfmetr...
def fitLine(self, program, totalLength): "fit words (and other things) onto a line" # assuming word lengths and spaces have not been yet added # fit words onto a line up to maxlength, adding spaces and respecting extra space from types import StringType, TupleType, InstanceType, FloatType from reportlab.pdfbase.pdfmetr...
5,332
def fitLine(self, program, totalLength): "fit words (and other things) onto a line" # assuming word lengths and spaces have not been yet added # fit words onto a line up to maxlength, adding spaces and respecting extra space from types import StringType, TupleType, InstanceType, FloatType from reportlab.pdfbase.pdfmetr...
def fitLine(self, program, totalLength): "fit words (and other things) onto a line" # assuming word lengths and spaces have not been yet added # fit words onto a line up to maxlength, adding spaces and respecting extra space from types import StringType, TupleType, InstanceType, FloatType from reportlab.pdfbase.pdfmetr...
5,333
def insertShift(self, line, shift): # insert shift just before first visible element in line from types import StringType, InstanceType result = [] first = 1 for e in line: te = type(e) if first and (te is StringType or te is InstanceType): result.append(shift) first = 0 result.append(e) return result
def insertShift(self, line, shift): # insert shift just before first visible element in line result = [] first = 1 for e in line: te = type(e) if first and (te is StringType or te is InstanceType): result.append(shift) first = 0 result.append(e) return result
5,334
def insertShift(self, line, shift): # insert shift just before first visible element in line from types import StringType, InstanceType result = [] first = 1 for e in line: te = type(e) if first and (te is StringType or te is InstanceType): result.append(shift) first = 0 result.append(e) return result
def insertShift(self, line, shift): # insert shift just before first visible element in line from types import StringType, InstanceType result = [] first = 1 for e in line: te = type(e) if first and (te in (StringType, UnicodeType, InstanceType)): result.append(shift) first = 0 result.append(e) return result
5,335
def justifyAlign(self, line, lineLength, maxLength): diff = maxLength-lineLength # count EXPANDABLE SPACES AFTER THE FIRST VISIBLE from types import InstanceType, StringType, TupleType, FloatType spacecount = 0 visible = 0 for e in line: te = type(e) if te is FloatType and e>TOOSMALLSPACE and visible: spacecount = spac...
def justifyAlign(self, line, lineLength, maxLength): diff = maxLength-lineLength # count EXPANDABLE SPACES AFTER THE FIRST VISIBLE spacecount = 0 visible = 0 for e in line: te = type(e) if te is FloatType and e>TOOSMALLSPACE and visible: spacecount = spacecount+1 elif te is StringType or te is InstanceType: visible = 1...
5,336
def justifyAlign(self, line, lineLength, maxLength): diff = maxLength-lineLength # count EXPANDABLE SPACES AFTER THE FIRST VISIBLE from types import InstanceType, StringType, TupleType, FloatType spacecount = 0 visible = 0 for e in line: te = type(e) if te is FloatType and e>TOOSMALLSPACE and visible: spacecount = spac...
def justifyAlign(self, line, lineLength, maxLength): diff = maxLength-lineLength # count EXPANDABLE SPACES AFTER THE FIRST VISIBLE from types import InstanceType, StringType, TupleType, FloatType spacecount = 0 visible = 0 for e in line: te = type(e) if te is FloatType and e>TOOSMALLSPACE and visible: spacecount = spac...
5,337
def justifyAlign(self, line, lineLength, maxLength): diff = maxLength-lineLength # count EXPANDABLE SPACES AFTER THE FIRST VISIBLE from types import InstanceType, StringType, TupleType, FloatType spacecount = 0 visible = 0 for e in line: te = type(e) if te is FloatType and e>TOOSMALLSPACE and visible: spacecount = spac...
def justifyAlign(self, line, lineLength, maxLength): diff = maxLength-lineLength # count EXPANDABLE SPACES AFTER THE FIRST VISIBLE from types import InstanceType, StringType, TupleType, FloatType spacecount = 0 visible = 0 for e in line: te = type(e) if te is FloatType and e>TOOSMALLSPACE and visible: spacecount = spac...
5,338
def shrinkWrap(self, line): # for non justified text, collapse adjacent text/shift's into single operations #return line # for testing result = [] index = 0 maxindex = len(line) from types import FloatType, StringType, InstanceType from string import join while index<maxindex: e = line[index] te = type(e) if te is Stri...
defshrinkWrap(self,line):#fornonjustifiedtext,collapseadjacenttext/shift'sintosingleoperations#returnline#fortestingresult=[]index=0maxindex=len(line)fromtypesimportFloatType,StringType,InstanceTypefromstringimportjoinwhileindex<maxindex:e=line[index]te=type(e)ifteisStringTypeandindex<maxindex-1:#collectstringsandfloat...
5,339
def shrinkWrap(self, line): # for non justified text, collapse adjacent text/shift's into single operations #return line # for testing result = [] index = 0 maxindex = len(line) from types import FloatType, StringType, InstanceType from string import join while index<maxindex: e = line[index] te = type(e) if te is Stri...
def shrinkWrap(self, line): # for non justified text, collapse adjacent text/shift's into single operations #return line # for testing result = [] index = 0 maxindex = len(line) while index<maxindex: e = line[index] te = type(e) if te is StringType and index<maxindex-1: # collect strings and floats thestrings = [e] the...
5,340
def shrinkWrap(self, line): # for non justified text, collapse adjacent text/shift's into single operations #return line # for testing result = [] index = 0 maxindex = len(line) from types import FloatType, StringType, InstanceType from string import join while index<maxindex: e = line[index] te = type(e) if te is Stri...
def shrinkWrap(self, line): # for non justified text, collapse adjacent text/shift's into single operations #return line # for testing result = [] index = 0 maxindex = len(line) from types import FloatType, StringType, InstanceType from string import join while index<maxindex: e = line[index] te = type(e) if te in (Str...
5,341
def shrinkWrap(self, line): # for non justified text, collapse adjacent text/shift's into single operations #return line # for testing result = [] index = 0 maxindex = len(line) from types import FloatType, StringType, InstanceType from string import join while index<maxindex: e = line[index] te = type(e) if te is Stri...
def shrinkWrap(self, line): # for non justified text, collapse adjacent text/shift's into single operations #return line # for testing result = [] index = 0 maxindex = len(line) from types import FloatType, StringType, InstanceType from string import join while index<maxindex: e = line[index] te = type(e) if te is Stri...
5,342
def shrinkWrap(self, line): # for non justified text, collapse adjacent text/shift's into single operations #return line # for testing result = [] index = 0 maxindex = len(line) from types import FloatType, StringType, InstanceType from string import join while index<maxindex: e = line[index] te = type(e) if te is Stri...
def shrinkWrap(self, line): # for non justified text, collapse adjacent text/shift's into single operations #return line # for testing result = [] index = 0 maxindex = len(line) from types import FloatType, StringType, InstanceType from string import join while index<maxindex: e = line[index] te = type(e) if te is Stri...
5,343
def shrinkWrap(self, line): # for non justified text, collapse adjacent text/shift's into single operations #return line # for testing result = [] index = 0 maxindex = len(line) from types import FloatType, StringType, InstanceType from string import join while index<maxindex: e = line[index] te = type(e) if te is Stri...
def shrinkWrap(self, line): # for non justified text, collapse adjacent text/shift's into single operations #return line # for testing result = [] index = 0 maxindex = len(line) from types import FloatType, StringType, InstanceType from string import join while index<maxindex: e = line[index] te = type(e) if te is Stri...
5,344
def cleanProgram(self, line): "collapse adjacent spacings" #return line # for debugging result = [] last = 0 from types import FloatType, TupleType, StringType, InstanceType for e in line: if type(e) is FloatType: # switch to expandable space if appropriate if last<0 and e>0: last = -last if e<0 and last>0: e = -e last...
def cleanProgram(self, line): "collapse adjacent spacings" #return line # for debugging result = [] last = 0 for e in line: if type(e) is FloatType: # switch to expandable space if appropriate if last<0 and e>0: last = -last if e<0 and last>0: e = -e last = float(last)+e else: if abs(last)>TOOSMALLSPACE: result.append(...
5,345
def cleanProgram(self, line): "collapse adjacent spacings" #return line # for debugging result = [] last = 0 from types import FloatType, TupleType, StringType, InstanceType for e in line: if type(e) is FloatType: # switch to expandable space if appropriate if last<0 and e>0: last = -last if e<0 and last>0: e = -e last...
def cleanProgram(self, line): "collapse adjacent spacings" #return line # for debugging result = [] last = 0 from types import FloatType, TupleType, StringType, InstanceType for e in line: if type(e) is FloatType: # switch to expandable space if appropriate if last<0 and e>0: last = -last if e<0 and last>0: e = -e last...
5,346
def runOpCodes(self, program, canvas, textobject): "render the line(s)" #import types from types import StringType, TupleType, InstanceType, FloatType escape = canvas._escape code = textobject._code startstate = self.__dict__.copy() font = None size = None # be sure to set them before using them (done lazily below) #te...
def runOpCodes(self, program, canvas, textobject): "render the line(s)" #import types escape = canvas._escape code = textobject._code startstate = self.__dict__.copy() font = None size = None # be sure to set them before using them (done lazily below) #textobject.setFont(self.fontName, self.fontSize) textobject.setFill...
5,347
def runOpCodes(self, program, canvas, textobject): "render the line(s)" #import types from types import StringType, TupleType, InstanceType, FloatType escape = canvas._escape code = textobject._code startstate = self.__dict__.copy() font = None size = None # be sure to set them before using them (done lazily below) #te...
def runOpCodes(self, program, canvas, textobject): "render the line(s)" #import types from types import StringType, TupleType, InstanceType, FloatType escape = canvas._escape code = textobject._code startstate = self.__dict__.copy() font = None size = None # be sure to set them before using them (done lazily below) #te...
5,348
def runOpCodes(self, program, canvas, textobject): "render the line(s)" #import types from types import StringType, TupleType, InstanceType, FloatType escape = canvas._escape code = textobject._code startstate = self.__dict__.copy() font = None size = None # be sure to set them before using them (done lazily below) #te...
def runOpCodes(self, program, canvas, textobject): "render the line(s)" #import types from types import StringType, TupleType, InstanceType, FloatType escape = canvas._escape code = textobject._code startstate = self.__dict__.copy() font = None size = None # be sure to set them before using them (done lazily below) #te...
5,349
def runOpCodes(self, program, canvas, textobject): "render the line(s)" #import types from types import StringType, TupleType, InstanceType, FloatType escape = canvas._escape code = textobject._code startstate = self.__dict__.copy() font = None size = None # be sure to set them before using them (done lazily below) #te...
def runOpCodes(self, program, canvas, textobject): "render the line(s)" #import types from types import StringType, TupleType, InstanceType, FloatType escape = canvas._escape code = textobject._code startstate = self.__dict__.copy() font = None size = None # be sure to set them before using them (done lazily below) #te...
5,350
def runOpCodes(self, program, canvas, textobject): "render the line(s)" #import types from types import StringType, TupleType, InstanceType, FloatType escape = canvas._escape code = textobject._code startstate = self.__dict__.copy() font = None size = None # be sure to set them before using them (done lazily below) #te...
def runOpCodes(self, program, canvas, textobject): "render the line(s)" #import types from types import StringType, TupleType, InstanceType, FloatType escape = canvas._escape code = textobject._code startstate = self.__dict__.copy() font = None size = None # be sure to set them before using them (done lazily below) #te...
5,351
def stringLine(line, length): "simple case: line with just strings and spacings which can be ignored" strings = [] from types import StringType for x in line: if type(x) is StringType: strings.append(x) text = string.join(strings) result = [text, float(length)] nextlinemark = ("nextLine", 0) if line and line[-1]==nextl...
def stringLine(line, length): "simple case: line with just strings and spacings which can be ignored" strings = [] for x in line: if type(x) is StringType: strings.append(x) text = string.join(strings) result = [text, float(length)] nextlinemark = ("nextLine", 0) if line and line[-1]==nextlinemark: result.append( nextl...
5,352
def stringLine(line, length): "simple case: line with just strings and spacings which can be ignored" strings = [] from types import StringType for x in line: if type(x) is StringType: strings.append(x) text = string.join(strings) result = [text, float(length)] nextlinemark = ("nextLine", 0) if line and line[-1]==nextl...
def stringLine(line, length): "simple case: line with just strings and spacings which can be ignored" strings = [] from types import StringType for x in line: if type(x) in (StringType, UnicodeType): strings.append(x) text = string.join(strings) result = [text, float(length)] nextlinemark = ("nextLine", 0) if line and ...
5,353
def stringLine(line, length): "simple case: line with just strings and spacings which can be ignored" strings = [] from types import StringType for x in line: if type(x) is StringType: strings.append(x) text = string.join(strings) result = [text, float(length)] nextlinemark = ("nextLine", 0) if line and line[-1]==nextl...
def stringLine(line, length): "simple case: line with just strings and spacings which can be ignored" strings = [] from types import StringType for x in line: if type(x) is StringType: strings.append(x) text = ' '.join(strings) result = [text, float(length)] nextlinemark = ("nextLine", 0) if line and line[-1]==nextline...
5,354
def simpleJustifyAlign(line, currentLength, maxLength): "simple justification with only strings" strings = [] from types import StringType for x in line[:-1]: if type(x) is StringType: strings.append(x) nspaces = len(strings)-1 slack = maxLength-currentLength text = string.join(strings) if nspaces>0 and slack>0: wordsp...
def simpleJustifyAlign(line, currentLength, maxLength): "simple justification with only strings" strings = [] for x in line[:-1]: if type(x) is StringType: strings.append(x) nspaces = len(strings)-1 slack = maxLength-currentLength text = string.join(strings) if nspaces>0 and slack>0: wordspacing = slack/float(nspaces) ...
5,355
def simpleJustifyAlign(line, currentLength, maxLength): "simple justification with only strings" strings = [] from types import StringType for x in line[:-1]: if type(x) is StringType: strings.append(x) nspaces = len(strings)-1 slack = maxLength-currentLength text = string.join(strings) if nspaces>0 and slack>0: wordsp...
def simpleJustifyAlign(line, currentLength, maxLength): "simple justification with only strings" strings = [] from types import StringType for x in line[:-1]: if type(x) in (StringType, UnicodeType): strings.append(x) nspaces = len(strings)-1 slack = maxLength-currentLength text = string.join(strings) if nspaces>0 and ...
5,356
def simpleJustifyAlign(line, currentLength, maxLength): "simple justification with only strings" strings = [] from types import StringType for x in line[:-1]: if type(x) is StringType: strings.append(x) nspaces = len(strings)-1 slack = maxLength-currentLength text = string.join(strings) if nspaces>0 and slack>0: wordsp...
def simpleJustifyAlign(line, currentLength, maxLength): "simple justification with only strings" strings = [] from types import StringType for x in line[:-1]: if type(x) is StringType: strings.append(x) nspaces = len(strings)-1 slack = maxLength-currentLength text = ' '.join(strings) if nspaces>0 and slack>0: wordspaci...
5,357
def readBool(text): if string.upper(text) in ("Y", "YES", "TRUE", "1"): return 1 elif string.upper(text) in ("N", "NO", "FALSE", "0"): return 0 else: raise RMLError, "true/false attribute has illegal value '%s'" % text
def readBool(text): if text.upper() in ("Y", "YES", "TRUE", "1"): return 1 elif string.upper(text) in ("N", "NO", "FALSE", "0"): return 0 else: raise RMLError, "true/false attribute has illegal value '%s'" % text
5,358
def readBool(text): if string.upper(text) in ("Y", "YES", "TRUE", "1"): return 1 elif string.upper(text) in ("N", "NO", "FALSE", "0"): return 0 else: raise RMLError, "true/false attribute has illegal value '%s'" % text
def readBool(text): if string.upper(text) in ("Y", "YES", "TRUE", "1"): return 1 elif text.upper() in ("N", "NO", "FALSE", "0"): return 0 else: raise RMLError, "true/false attribute has illegal value '%s'" % text
5,359
def readAlignment(text): from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY up = string.upper(text) if up == 'LEFT': return TA_LEFT elif up == 'RIGHT': return TA_RIGHT elif up in ['CENTER', 'CENTRE']: return TA_CENTER elif up == 'JUSTIFY': return TA_JUSTIFY
def readAlignment(text): up = text.upper() if up == 'LEFT': return TA_LEFT elif up == 'RIGHT': return TA_RIGHT elif up in ['CENTER', 'CENTRE']: return TA_CENTER elif up == 'JUSTIFY': return TA_JUSTIFY
5,360
def readLength(text): """Read a dimension measurement: accept "3in", "5cm", "72 pt" and so on.""" text = string.strip(text) try: return float(text) except ValueError: text = string.lower(text) numberText, units = text[:-2],text[-2:] numberText = string.strip(numberText) try: number = float(numberText) except ValueError...
def readLength(text): """Read a dimension measurement: accept "3in", "5cm", "72 pt" and so on.""" text = text.strip() try: return float(text) except ValueError: text = string.lower(text) numberText, units = text[:-2],text[-2:] numberText = string.strip(numberText) try: number = float(numberText) except ValueError: rais...
5,361
def readLength(text): """Read a dimension measurement: accept "3in", "5cm", "72 pt" and so on.""" text = string.strip(text) try: return float(text) except ValueError: text = string.lower(text) numberText, units = text[:-2],text[-2:] numberText = string.strip(numberText) try: number = float(numberText) except ValueError...
def readLength(text): """Read a dimension measurement: accept "3in", "5cm", "72 pt" and so on.""" text = string.strip(text) try: return float(text) except ValueError: text = text.lower() numberText, units = text[:-2],text[-2:] numberText = string.strip(numberText) try: number = float(numberText) except ValueError: rais...
5,362
def readLength(text): """Read a dimension measurement: accept "3in", "5cm", "72 pt" and so on.""" text = string.strip(text) try: return float(text) except ValueError: text = string.lower(text) numberText, units = text[:-2],text[-2:] numberText = string.strip(numberText) try: number = float(numberText) except ValueError...
def readLength(text): """Read a dimension measurement: accept "3in", "5cm", "72 pt" and so on.""" text = string.strip(text) try: return float(text) except ValueError: text = string.lower(text) numberText, units = text[:-2],text[-2:] numberText = numberText.strip() try: number = float(numberText) except ValueError: rais...
5,363
def lengthSequence(s, converter=readLength): """from "(2, 1)" or "2,1" return [2,1], for example""" from string import split, strip s = strip(s) if s[:1]=="(" and s[-1:]==")": s = s[1:-1] sl = split(s, ",") sl = map(strip, sl) sl = map(converter, sl) return sl
def lengthSequence(s, converter=readLength): """from "(2, 1)" or "2,1" return [2,1], for example""" s = s.strip() if s[:1]=="(" and s[-1:]==")": s = s[1:-1] sl = split(s, ",") sl = map(strip, sl) sl = map(converter, sl) return sl
5,364
def lengthSequence(s, converter=readLength): """from "(2, 1)" or "2,1" return [2,1], for example""" from string import split, strip s = strip(s) if s[:1]=="(" and s[-1:]==")": s = s[1:-1] sl = split(s, ",") sl = map(strip, sl) sl = map(converter, sl) return sl
def lengthSequence(s, converter=readLength): """from "(2, 1)" or "2,1" return [2,1], for example""" from string import split, strip s = strip(s) if s[:1]=="(" and s[-1:]==")": s = s[1:-1] sl = s.split(',') sl = [s.strip() for s in sl] sl = [converter(s) for s in sl] return sl
5,365
def readColor(text): """Read color names or tuples, RGB or CMYK, and return a Color object.""" if not text: return None from reportlab.lib import colors if text[0] in string.letters: return colors.__dict__[text] tup = lengthSequence(text) msg = "Color tuple must have 3 (or 4) elements for RGB (or CMYC)." assert 3 <= l...
def readColor(text): """Read color names or tuples, RGB or CMYK, and return a Color object.""" if not text: return None from reportlab.lib import colors if text[0] in LETTERS: return colors.__dict__[text] tup = lengthSequence(text) msg = "Color tuple must have 3 (or 4) elements for RGB (or CMYC)." assert 3 <= len(tup)...
5,366
def addAttributes(self, dictionary): for key in dictionary.keys(): value = dictionary[key] if value is not None: if hasattr(StyleAttributeConverters, key): converter = getattr(StyleAttributeConverters, key)[0] value = converter(value) setattr(self, key, value)
def addAttributes(self, dictionary): for key in dictionary.keys(): value = dictionary[key] if value is not None: if hasattr(StyleAttributeConverters, key): converter = getattr(StyleAttributeConverters, key)[0] value = converter(value) setattr(self, key, value)
5,367
def wrap(self, availableWidth, availableHeight): simpletext = self.simpletext self.availableWidth = availableWidth style = self.style text = self.simpletext rightIndent = style.rightIndent leftIndent = style.leftIndent leading = style.leading font = style.fontName size = style.fontSize firstindent = style.firstLineInde...
def wrap(self, availableWidth, availableHeight): simpletext = self.simpletext self.availableWidth = availableWidth style = self.style text = self.simpletext rightIndent = style.rightIndent leftIndent = style.leftIndent leading = style.leading font = style.fontName size = style.fontSize firstindent = style.firstLineInde...
5,368
def wrap(self, availableWidth, availableHeight): simpletext = self.simpletext self.availableWidth = availableWidth style = self.style text = self.simpletext rightIndent = style.rightIndent leftIndent = style.leftIndent leading = style.leading font = style.fontName size = style.fontSize firstindent = style.firstLineInde...
def wrap(self, availableWidth, availableHeight): simpletext = self.simpletext self.availableWidth = availableWidth style = self.style text = self.simpletext rightIndent = style.rightIndent leftIndent = style.leftIndent leading = style.leading font = style.fontName size = style.fontSize firstindent = style.firstLineInde...
5,369
def wrap(self, availableWidth, availableHeight): simpletext = self.simpletext self.availableWidth = availableWidth style = self.style text = self.simpletext rightIndent = style.rightIndent leftIndent = style.leftIndent leading = style.leading font = style.fontName size = style.fontSize firstindent = style.firstLineInde...
def wrap(self, availableWidth, availableHeight): simpletext = self.simpletext self.availableWidth = availableWidth style = self.style text = self.simpletext rightIndent = style.rightIndent leftIndent = style.leftIndent leading = style.leading font = style.fontName size = style.fontSize firstindent = style.firstLineInde...
5,370
def wrap(self, availableWidth, availableHeight): simpletext = self.simpletext self.availableWidth = availableWidth style = self.style text = self.simpletext rightIndent = style.rightIndent leftIndent = style.leftIndent leading = style.leading font = style.fontName size = style.fontSize firstindent = style.firstLineInde...
def wrap(self, availableWidth, availableHeight): simpletext = self.simpletext self.availableWidth = availableWidth style = self.style text = self.simpletext rightIndent = style.rightIndent leftIndent = style.leftIndent leading = style.leading font = style.fontName size = style.fontSize firstindent = style.firstLineInde...
5,371
def draw(self): from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY style = self.style lines = self.lines rightIndent = style.rightIndent leftIndent = style.leftIndent leading = style.leading font = style.fontName size = style.fontSize alignment = style.alignment firstindent = style.firstLineIndent...
def draw(self): style = self.style lines = self.lines rightIndent = style.rightIndent leftIndent = style.leftIndent leading = style.leading font = style.fontName size = style.fontSize alignment = style.alignment firstindent = style.firstLineIndent c = self.canv escape = c._escape #if debug: # print "FAST", id(self),...
5,372
def __init__(self, style, parsedText=None, bulletText=None, state=None, context=None, baseindent=0): #print id(self), "para", parsedText self.baseindent = baseindent if context is None: context = defaultContext() self.context = context self.parsedText = parsedText self.bulletText = bulletText self.style1 = style # make...
def __init__(self, style, parsedText=None, bulletText=None, state=None, context=None, baseindent=0): #print id(self), "para", parsedText self.baseindent = baseindent self.context = buildContext(context) self.parsedText = parsedText self.bulletText = bulletText self.style1 = style # make sure Flowable doesn't use this u...
5,373
def __init__(self, style, parsedText=None, bulletText=None, state=None, context=None, baseindent=0): #print id(self), "para", parsedText self.baseindent = baseindent if context is None: context = defaultContext() self.context = context self.parsedText = parsedText self.bulletText = bulletText self.style1 = style # make...
def __init__(self, style, parsedText=None, bulletText=None, state=None, context=None, baseindent=0): #print id(self), "para", parsedText self.baseindent = baseindent if context is None: context = defaultContext() self.context = context self.parsedText = parsedText self.bulletText = bulletText self.style1 = style # make...
5,374
def wrap(self, availableWidth, availableHeight): if debug: print "WRAPPING", id(self), availableWidth, availableHeight print " ", self.formattedProgram print " ", self.program self.availableHeight = availableHeight self.myengine = p = paragraphEngine() p.baseindent = self.baseindent # for shifting bullets as needed...
def wrap(self, availableWidth, availableHeight): if debug: print "WRAPPING", id(self), availableWidth, availableHeight print " ", self.formattedProgram print " ", self.program self.availableHeight = availableHeight self.myengine = p = paragraphEngine() p.baseindent = self.baseindent # for shifting bullets as needed...
5,375
def wrap(self, availableWidth, availableHeight): if debug: print "WRAPPING", id(self), availableWidth, availableHeight print " ", self.formattedProgram print " ", self.program self.availableHeight = availableHeight self.myengine = p = paragraphEngine() p.baseindent = self.baseindent # for shifting bullets as needed...
def wrap(self, availableWidth, availableHeight): if debug: print "WRAPPING", id(self), availableWidth, availableHeight print " ", self.formattedProgram print " ", self.program self.availableHeight = availableHeight self.myengine = p = paragraphEngine() p.baseindent = self.baseindent # for shifting bullets as needed...
5,376
def compileProgram(self, parsedText, program=None): style = self.style1 # standard parameters #program = self.program if program is None: program = [] a = program.append fn = style.fontName # add style information if there was no initial state a( ("face", fn ) ) from reportlab.lib.fonts import ps2tt (self.face, self.bo...
def compileProgram(self, parsedText, program=None): style = self.style1 # standard parameters #program = self.program if program is None: program = [] a = program.append fn = style.fontName # add style information if there was no initial state a( ("face", fn ) ) from reportlab.lib.fonts import ps2tt (self.face, self.bo...
5,377
def compileProgram(self, parsedText, program=None): style = self.style1 # standard parameters #program = self.program if program is None: program = [] a = program.append fn = style.fontName # add style information if there was no initial state a( ("face", fn ) ) from reportlab.lib.fonts import ps2tt (self.face, self.bo...
def compileProgram(self, parsedText, program=None): style = self.style1 # standard parameters #program = self.program if program is None: program = [] a = program.append fn = style.fontName # add style information if there was no initial state a( ("face", fn ) ) from reportlab.lib.fonts import ps2tt (self.face, self.bo...
5,378
def compileProgram(self, parsedText, program=None): style = self.style1 # standard parameters #program = self.program if program is None: program = [] a = program.append fn = style.fontName # add style information if there was no initial state a( ("face", fn ) ) from reportlab.lib.fonts import ps2tt (self.face, self.bo...
defcompileProgram(self,parsedText,program=None):style=self.style1#standardparameters#program=self.programifprogramisNone:program=[]a=program.appendfn=style.fontName#addstyleinformationiftherewasnoinitialstatea(("face",fn))fromreportlab.lib.fontsimportps2tt(self.face,self.bold,self.italic)=ps2tt(fn)a(("size",style.fontS...
5,379
def compileComponent(self, parsedText, program): import types ttext = type(parsedText) #program = self.program if ttext is types.StringType: # handle special characters here... # short cut if parsedText: stext = parsedText.strip() #string.strip(parsedText) if not stext: program.append(" ") # contract whitespace to sing...
def compileComponent(self, parsedText, program): import types ttext = type(parsedText) #program = self.program if ttext in (StringType, UnicodeType): # handle special characters here... # short cut if parsedText: stext = parsedText.strip() #string.strip(parsedText) if not stext: program.append(" ") # contract whitespac...
5,380
def compileComponent(self, parsedText, program): import types ttext = type(parsedText) #program = self.program if ttext is types.StringType: # handle special characters here... # short cut if parsedText: stext = parsedText.strip() #string.strip(parsedText) if not stext: program.append(" ") # contract whitespace to sing...
def compileComponent(self, parsedText, program): import types ttext = type(parsedText) #program = self.program if ttext is types.StringType: # handle special characters here... # short cut if parsedText: stext = parsedText.strip() #string.strip(parsedText) if not stext: program.append(" ") # contract whitespace to sing...
5,381
def compileComponent(self, parsedText, program): import types ttext = type(parsedText) #program = self.program if ttext is types.StringType: # handle special characters here... # short cut if parsedText: stext = parsedText.strip() #string.strip(parsedText) if not stext: program.append(" ") # contract whitespace to sing...
def compileComponent(self, parsedText, program): import types ttext = type(parsedText) #program = self.program if ttext is types.StringType: # handle special characters here... # short cut if parsedText: stext = parsedText.strip() #string.strip(parsedText) if not stext: program.append(" ") # contract whitespace to sing...
5,382
def compileComponent(self, parsedText, program): import types ttext = type(parsedText) #program = self.program if ttext is types.StringType: # handle special characters here... # short cut if parsedText: stext = parsedText.strip() #string.strip(parsedText) if not stext: program.append(" ") # contract whitespace to sing...
def compileComponent(self, parsedText, program): import types ttext = type(parsedText) #program = self.program if ttext is types.StringType: # handle special characters here... # short cut if parsedText: stext = parsedText.strip() #string.strip(parsedText) if not stext: program.append(" ") # contract whitespace to sing...
5,383
def compileComponent(self, parsedText, program): import types ttext = type(parsedText) #program = self.program if ttext is types.StringType: # handle special characters here... # short cut if parsedText: stext = parsedText.strip() #string.strip(parsedText) if not stext: program.append(" ") # contract whitespace to sing...
def compileComponent(self, parsedText, program): import types ttext = type(parsedText) #program = self.program if ttext is types.StringType: # handle special characters here... # short cut if parsedText: stext = parsedText.strip() #string.strip(parsedText) if not stext: program.append(" ") # contract whitespace to sing...
5,384
def compile_ul(self, attdict, content, extra, program, tagname="ul"): # by transformation #print "compile", tagname, attdict atts = attdict.copy() bulletmaker = bulletMaker(tagname, atts, self.context) # now do each element as a separate paragraph import types for e in content: te = type(e) if te is types.StringType: i...
def compile_ul(self, attdict, content, extra, program, tagname="ul"): # by transformation #print "compile", tagname, attdict atts = attdict.copy() bulletmaker = bulletMaker(tagname, atts, self.context) # now do each element as a separate paragraph for e in content: te = type(e) if te is types.StringType: if e.strip(): ...
5,385
def compile_ul(self, attdict, content, extra, program, tagname="ul"): # by transformation #print "compile", tagname, attdict atts = attdict.copy() bulletmaker = bulletMaker(tagname, atts, self.context) # now do each element as a separate paragraph import types for e in content: te = type(e) if te is types.StringType: i...
def compile_ul(self, attdict, content, extra, program, tagname="ul"): # by transformation #print "compile", tagname, attdict atts = attdict.copy() bulletmaker = bulletMaker(tagname, atts, self.context) # now do each element as a separate paragraph import types for e in content: te = type(e) if te in (StringType, Unicod...
5,386
def compile_ul(self, attdict, content, extra, program, tagname="ul"): # by transformation #print "compile", tagname, attdict atts = attdict.copy() bulletmaker = bulletMaker(tagname, atts, self.context) # now do each element as a separate paragraph import types for e in content: te = type(e) if te is types.StringType: i...
def compile_ul(self, attdict, content, extra, program, tagname="ul"): # by transformation #print "compile", tagname, attdict atts = attdict.copy() bulletmaker = bulletMaker(tagname, atts, self.context) # now do each element as a separate paragraph import types for e in content: te = type(e) if te is types.StringType: i...
5,387
def compile_dl(self, attdict, content, extra, program): # by transformation #print "compile", tagname, attdict atts = attdict.copy() # by transformation #print "compile", tagname, attdict atts = attdict.copy() bulletmaker = bulletMaker("dl", atts, self.context) # now do each element as a separate paragraph import types...
def compile_dl(self, attdict, content, extra, program): # by transformation #print "compile", tagname, attdict atts = attdict.copy() # by transformation #print "compile", tagname, attdict atts = attdict.copy() bulletmaker = bulletMaker("dl", atts, self.context) # now do each element as a separate paragraph contentcopy ...
5,388
def compile_dl(self, attdict, content, extra, program): # by transformation #print "compile", tagname, attdict atts = attdict.copy() # by transformation #print "compile", tagname, attdict atts = attdict.copy() bulletmaker = bulletMaker("dl", atts, self.context) # now do each element as a separate paragraph import types...
def compile_dl(self, attdict, content, extra, program): # by transformation #print "compile", tagname, attdict atts = attdict.copy() # by transformation #print "compile", tagname, attdict atts = attdict.copy() bulletmaker = bulletMaker("dl", atts, self.context) # now do each element as a separate paragraph import types...
5,389
def compile_dl(self, attdict, content, extra, program): # by transformation #print "compile", tagname, attdict atts = attdict.copy() # by transformation #print "compile", tagname, attdict atts = attdict.copy() bulletmaker = bulletMaker("dl", atts, self.context) # now do each element as a separate paragraph import types...
def compile_dl(self, attdict, content, extra, program): # by transformation #print "compile", tagname, attdict atts = attdict.copy() # by transformation #print "compile", tagname, attdict atts = attdict.copy() bulletmaker = bulletMaker("dl", atts, self.context) # now do each element as a separate paragraph import types...
5,390
def compile_dl(self, attdict, content, extra, program): # by transformation #print "compile", tagname, attdict atts = attdict.copy() # by transformation #print "compile", tagname, attdict atts = attdict.copy() bulletmaker = bulletMaker("dl", atts, self.context) # now do each element as a separate paragraph import types...
def compile_dl(self, attdict, content, extra, program): # by transformation #print "compile", tagname, attdict atts = attdict.copy() # by transformation #print "compile", tagname, attdict atts = attdict.copy() bulletmaker = bulletMaker("dl", atts, self.context) # now do each element as a separate paragraph import types...
5,391
def compile_dl(self, attdict, content, extra, program): # by transformation #print "compile", tagname, attdict atts = attdict.copy() # by transformation #print "compile", tagname, attdict atts = attdict.copy() bulletmaker = bulletMaker("dl", atts, self.context) # now do each element as a separate paragraph import types...
def compile_dl(self, attdict, content, extra, program): # by transformation #print "compile", tagname, attdict atts = attdict.copy() # by transformation #print "compile", tagname, attdict atts = attdict.copy() bulletmaker = bulletMaker("dl", atts, self.context) # now do each element as a separate paragraph import types...
5,392
def compile_bullet(self, attdict, content, extra, program): from types import StringType ### eventually should allow things like images and graphics in bullets too XXXX if len(content)!=1 or type(content[0]) is not StringType: raise ValueError, "content for bullet must be a single string" text = content[0] self.do_bull...
def compile_bullet(self, attdict, content, extra, program): ### eventually should allow things like images and graphics in bullets too XXXX if len(content)!=1 or type(content[0]) is not StringType: raise ValueError, "content for bullet must be a single string" text = content[0] self.do_bullet(text, program)
5,393
def compile_bullet(self, attdict, content, extra, program): from types import StringType ### eventually should allow things like images and graphics in bullets too XXXX if len(content)!=1 or type(content[0]) is not StringType: raise ValueError, "content for bullet must be a single string" text = content[0] self.do_bull...
def compile_bullet(self, attdict, content, extra, program): from types import StringType ### eventually should allow things like images and graphics in bullets too XXXX if len(content)!=1 or type(content[0]) not in (StringType, UnicodeType): raise ValueError, "content for bullet must be a single string" text = content[...
5,394
def compile_para(self, attdict, content, extra, program, stylename = "para.defaultStyle"): context = self.context stylename = attdict.get("style", stylename) style = context[stylename] newstyle = SimpleStyle(name="rml2pdf internal embedded style", parent=style) newstyle.addAttributes(attdict) bulletText = attdict.get("...
def compile_para(self, attdict, content, extra, program, stylename = "para.defaultStyle"): context = self.context stylename = attdict.get("style", stylename) style = context[stylename] newstyle = SimpleStyle(name="rml2pdf internal embedded style", parent=style) newstyle.addAttributes(attdict) bulletText = attdict.get("...
5,395
def compile_para(self, attdict, content, extra, program, stylename = "para.defaultStyle"): context = self.context stylename = attdict.get("style", stylename) style = context[stylename] newstyle = SimpleStyle(name="rml2pdf internal embedded style", parent=style) newstyle.addAttributes(attdict) bulletText = attdict.get("...
def compile_para(self, attdict, content, extra, program, stylename = "para.defaultStyle"): context = self.context stylename = attdict.get("style", stylename) style = context[stylename] newstyle = SimpleStyle(name="rml2pdf internal embedded style", parent=style) newstyle.addAttributes(attdict) bulletText = attdict.get("...
5,396
def compile_para(self, attdict, content, extra, program, stylename = "para.defaultStyle"): context = self.context stylename = attdict.get("style", stylename) style = context[stylename] newstyle = SimpleStyle(name="rml2pdf internal embedded style", parent=style) newstyle.addAttributes(attdict) bulletText = attdict.get("...
defcompile_para(self,attdict,content,extra,program,stylename="para.defaultStyle"):context=self.contextstylename=attdict.get("style",stylename)style=context[stylename]newstyle=SimpleStyle(name="rml2pdfinternalembeddedstyle",parent=style)newstyle.addAttributes(attdict)bulletText=attdict.get("bulletText",None)mystyle=self...
5,397
def translate(self, nodetuple, controller, context, overrides): (tagname, attdict, content, extra) = nodetuple stylename = tagname+".defaultStyle" stylename = attdict.get("style", stylename) style = context[stylename] mystyle = SimpleStyle(name="rml2pdf internal style", parent=style) mystyle.addAttributes(attdict) bull...
def translate(self, nodetuple, controller, context, overrides): (tagname, attdict, content, extra) = nodetuple stylename = tagname+".defaultStyle" stylename = attdict.get("style", stylename) style = context[stylename] mystyle = SimpleStyle(name="rml2pdf internal style", parent=style) mystyle.addAttributes(attdict) bull...
5,398
def handleSpecialCharacters(engine, text, program=None, greeks=greeks): from string import whitespace # add space prefix if space here if text[0:1] in whitespace: program.append(" ") #print "handling", repr(text) # shortcut if 0 and "&" not in text: result = [] for x in text.split(): result.append(x+" ") if result: las...
def handleSpecialCharacters(engine, text, program=None, greeks=greeks): from string import whitespace # add space prefix if space here if text[0:1] in whitespace: program.append(" ") #print "handling", repr(text) # shortcut if 0 and "&" not in text: result = [] for x in text.split(): result.append(x+" ") if result: las...
5,399