rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
if cmd[0] == 'BACKGROUND': self._bkgrndcmds.append(cmd) if cmd[0] == 'ROWBACKGROUNDS': self._bkgrndcmds.append(cmd) if cmd[0] == 'COLBACKGROUNDS': | if cmd[0] in ('BACKGROUND','ROWBACKGROUNDS','COLBACKGROUNDS'): | 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... | 928d797a32fecff3127515e56b53b05033ae789d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/928d797a32fecff3127515e56b53b05033ae789d/tables.py |
elif cmd == 'BACKGROUND': canv.setFillColor(colors.toColor(arg)) canv.rect(x0, y0, w, h, stroke=0,fill=1) | 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)... | 928d797a32fecff3127515e56b53b05033ae789d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/928d797a32fecff3127515e56b53b05033ae789d/tables.py | |
else: canv.setFillColor(colors.toColor(arg)) canv.rect(x0, y0, w, h, stroke=0,fill=1) | 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)... | 928d797a32fecff3127515e56b53b05033ae789d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/928d797a32fecff3127515e56b53b05033ae789d/tables.py | |
path = os.path.basename(sys.argv[0]) path = os.path.splitext(path)[0] + "-%s.log" % expl | path = "test_docstrings-%s.log" % expl | def _writeLogFile(self, objType): "Write log file for different kind of documentable objects." cwd = os.getcwd() | 9ee49bf3a9bf7d615f2b4127ec006150dfdbfc82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/9ee49bf3a9bf7d615f2b4127ec006150dfdbfc82/test_docstrings.py |
lo = lo + ' bgCol= lineNum marcs help multiPage noOutline config= input= mode=' | lo = lo + ' bgCol= verbose lineNum marcs help multiPage noOutline config= input= mode=' | def updateWithContentsOfArgv(self, argv): "Update options as specified in a (command line) argument vector." # Specify accepted short option names (UNIX style). shortOpts = 'hv' | 7c4e5f9a7ac0d61c0fc6dc782c83bc5c447d3771 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7c4e5f9a7ac0d61c0fc6dc782c83bc5c447d3771/py2pdf.py |
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... | 7c4e5f9a7ac0d61c0fc6dc782c83bc5c447d3771 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7c4e5f9a7ac0d61c0fc6dc782c83bc5c447d3771/py2pdf.py | ||
noValOpts = 'landscape stdout lineNum marcs help multiPage noOutline' | noValOpts = 'h v verbose landscape stdout lineNum marcs help multiPage noOutline' | 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... | 7c4e5f9a7ac0d61c0fc6dc782c83bc5c447d3771 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7c4e5f9a7ac0d61c0fc6dc782c83bc5c447d3771/py2pdf.py |
line = string.join(args, ' ') | s = 'py2pdf.py' | 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... | 7c4e5f9a7ac0d61c0fc6dc782c83bc5c447d3771 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7c4e5f9a7ac0d61c0fc6dc782c83bc5c447d3771/py2pdf.py |
line = line + ' -%s=%s' % (k, v) | s = s + ' -%s' % k if k not in noValOpts: s = s + ' %s' % v | 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... | 7c4e5f9a7ac0d61c0fc6dc782c83bc5c447d3771 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7c4e5f9a7ac0d61c0fc6dc782c83bc5c447d3771/py2pdf.py |
if k in noValOpts: line = line + ' --%s' % k else: line = line + ' --%s=%s' % (k, v) print line | s = s + ' --%s' % k if k not in noValOpts: s = s + '=%s' % v s = s + ' ' + string.join(args, ' ') s = string.split(s, ' ') main(s) | 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... | 7c4e5f9a7ac0d61c0fc6dc782c83bc5c447d3771 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7c4e5f9a7ac0d61c0fc6dc782c83bc5c447d3771/py2pdf.py |
if (h > self._aH and not trySplit): | if (not rl_config.allowTableBoundsErrors) and (h > self._aH and not trySplit): | 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... | 47034ffcf00f5d611fece45d38b03759cbee8d56 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/47034ffcf00f5d611fece45d38b03759cbee8d56/frames.py |
slf.contents.insert(i,n) | self.contents.insert(i,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: slf.contents.insert(i,n) self._addNamedNode(name,n) | ed908168209f3cbb7c6144c0099f5d6ed8fd9f51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ed908168209f3cbb7c6144c0099f5d6ed8fd9f51/shapes.py |
'fontname':'Times-Roman', | 'fontName':'Times-Roman', | def prepareCanvas(self, canvas): """You can ask a LineStyle to set up the canvas for drawing the lines.""" canvas.setLineWidth(1) #etc. etc. | c6f096615961f3cc92a6eae7567071585913489d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c6f096615961f3cc92a6eae7567071585913489d/styles.py |
from string import letters as LETTERS, whitespace as WHITESPACE | from string import letters as LETTERS, whitespace as WHITESPACE, atoi | def Paragraph(text, style, bulletText=None, frags=None) | 22c96d47bac7e0dd9cb4e4762c175c7e57ef3fe6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/22c96d47bac7e0dd9cb4e4762c175c7e57ef3fe6/para.py |
heightremaining = maxheight-leading | heightremaining = maxheight if leading: self.leading = leading | 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[:] #... | 22c96d47bac7e0dd9cb4e4762c175c7e57ef3fe6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/22c96d47bac7e0dd9cb4e4762c175c7e57ef3fe6/para.py |
textobject.setFont(self.fontName, self.fontSize) | def runOpCodes(self, program, canvas, textobject): "render the line(s)" | 22c96d47bac7e0dd9cb4e4762c175c7e57ef3fe6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/22c96d47bac7e0dd9cb4e4762c175c7e57ef3fe6/para.py | |
third element of the unnumberred list third element of the unnumberred list third element of the unnumberred list | third element of the unnumberred list & third element of the unnumberred list & third element of the unnumberred list &exist; --> ∃ | def translate(self, nodetuple, controller, context, overrides): thepara = ("para", {}, [nodetuple], None) return theParaMapper.translate(thepara, controller, context, overrides) | 22c96d47bac7e0dd9cb4e4762c175c7e57ef3fe6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/22c96d47bac7e0dd9cb4e4762c175c7e57ef3fe6/para.py |
parsedpara = rparsexml.parsexmlSimple(testparagraph) | parsedpara = rparsexml.parsexmlSimple(testparagraph,entityReplacer=None) | 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... | 22c96d47bac7e0dd9cb4e4762c175c7e57ef3fe6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/22c96d47bac7e0dd9cb4e4762c175c7e57ef3fe6/para.py |
greeks = { 'alpha':'a', 'beta':'b', 'chi':'c', 'Delta':'D', 'delta':'d', 'epsiv':'e', 'eta':'h', 'Gamma':'G', 'gamma':'g', 'iota':'i', 'kappa':'k', 'Lambda':'L', 'lambda':'l', 'mu':'m', 'nu':'n', 'Omega':'W', 'omega':'w', 'omicron':'x', 'Phi':'F', 'phi':'f', 'phiv':'j', 'Pi':'P', 'pi':'p', 'piv':'v', 'Psi':'Y', 'psi':... | def handleSpecialCharacters(engine, text, program=None): from paraparser import greeks, symenc | 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... | 22c96d47bac7e0dd9cb4e4762c175c7e57ef3fe6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/22c96d47bac7e0dd9cb4e4762c175c7e57ef3fe6/para.py |
if greeks.has_key(name): | if name[0]==' try: if name[1] == 'x': n = atoi(name[2:], 16) else: n = atoi(name[1:]) except atoi_error: n = -1 if 0<=n<=255: fragment = chr(n)+fragment[semi+1:] elif symenc.has_key(n): fragment = fragment[semi+1:] (f,b,i) = engine.shiftfont(program, face="symbol") program.append(symenc[n]) engine.shiftfont(program, fa... | 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... | 22c96d47bac7e0dd9cb4e4762c175c7e57ef3fe6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/22c96d47bac7e0dd9cb4e4762c175c7e57ef3fe6/para.py |
program.append(" ") | program.append(" ") | 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... | 22c96d47bac7e0dd9cb4e4762c175c7e57ef3fe6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/22c96d47bac7e0dd9cb4e4762c175c7e57ef3fe6/para.py |
parsedpara = rparsexml.parsexmlSimple(text) | parsedpara = rparsexml.parsexmlSimple(text,entityReplacer=None) | 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: # ... | 22c96d47bac7e0dd9cb4e4762c175c7e57ef3fe6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/22c96d47bac7e0dd9cb4e4762c175c7e57ef3fe6/para.py |
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: # ... | 22c96d47bac7e0dd9cb4e4762c175c7e57ef3fe6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/22c96d47bac7e0dd9cb4e4762c175c7e57ef3fe6/para.py | ||
if hasattr(self,'noImageCaching') and canvas.noImageCaching: | if hasattr(self,'noImageCaching') and self.noImageCaching \ or hasattr(canvas,'noImageCaching') and canvas.noImageCaching: | 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""" | cdce40738635484ea7ce10b25149f798af92b729 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/cdce40738635484ea7ce10b25149f798af92b729/pdfimages.py |
import string | from types import StringType, UnicodeType, InstanceType, TupleType, ListType, FloatType from string import letters as LETTERS, whitespace as WHITESPACE | def Paragraph(text, style, bulletText=None, frags=None) | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py | ||
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY | 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[:] #... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py | |
raise ValueError, "indents %s %s too wide for space %s" % (self.indent, self.rightIndent, maxwidth) | raise ValueError, "indents %s %s too wide for space %s" % (self.indent, self.rightIndent, \ maxwidth) | 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[:] #... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
(lineIsFull, line, cursor, currentLength, usedIndent, maxLength, justStrings) = self.fitLine(remainder, maxwidth) | (lineIsFull, line, cursor, currentLength, \ usedIndent, maxLength, justStrings) = self.fitLine(remainder, maxwidth) | 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[:] #... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
from types import StringType, TupleType, InstanceType, FloatType | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py | |
if topcode is StringType or topcode is InstanceType: | if topcode in (StringType, UnicodeType, InstanceType): | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
opcode = opcode.strip() | opcode = opcode.strip() | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
if type(colorname) is StringType: | if type(colorname) in (StringType, UnicodeType): | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
if type(fontsize) is StringType: | if type(fontsize) in (StringType, UnicodeType): | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
from types import StringType, InstanceType | 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 | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py | |
if first and (te is StringType or te is InstanceType): | if first and (te in (StringType, UnicodeType, InstanceType)): | 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 | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
from types import InstanceType, StringType, TupleType, FloatType | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py | |
elif te is StringType or te is InstanceType: | elif te in (StringType, UnicodeType, InstanceType): | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
if (te is InstanceType or te is StringType): | if (te in (StringType, UnicodeType, InstanceType)): | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py | ||
from types import FloatType, StringType, InstanceType from string import join | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py | |
if te is StringType and index<maxindex-1: | if te in (StringType, UnicodeType) and index<maxindex-1: | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
while index<maxindex and (tnexte is FloatType or tnexte is StringType): | while index<maxindex and (tnexte in (FloatType, StringType, UnicodeType)): | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
elif tnexte is StringType: | elif tnexte in (StringType, UnicodeType): | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
s = string.join(thestrings) | s = ' '.join(thestrings) | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
from types import FloatType, TupleType, StringType, InstanceType | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py | |
if tthis is StringType or tnext is StringType or this is InstanceType or tnext is InstanceType: | if tthis in (StringType, UnicodeType) or \ tnext in (StringType, UnicodeType) or \ this is InstanceType or tnext is InstanceType: | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
from types import StringType, TupleType, InstanceType, FloatType | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py | |
if topcode is StringType or topcode is InstanceType: | if topcode in (StringType, UnicodeType, InstanceType): | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
if topcode is StringType: | if topcode in (StringType, UnicodeType): | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
if type(colorname) is StringType: | if type(colorname) in (StringType, UnicodeType): | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
if type(fontsize) is StringType: | if type(fontsize) in (StringType, UnicodeType): | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
from types import StringType | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py | |
if type(x) is StringType: | if type(x) in (StringType, UnicodeType): | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
text = string.join(strings) | text = ' '.join(strings) | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
from types import StringType | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py | |
if type(x) is StringType: | if type(x) in (StringType, UnicodeType): | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
text = string.join(strings) | text = ' '.join(strings) | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
if string.upper(text) in ("Y", "YES", "TRUE", "1"): | if text.upper() in ("Y", "YES", "TRUE", "1"): | 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 | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
elif string.upper(text) in ("N", "NO", "FALSE", "0"): | elif text.upper() in ("N", "NO", "FALSE", "0"): | 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 | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY up = string.upper(text) | up = text.upper() | 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 | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
text = string.strip(text) | text = text.strip() | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
text = string.lower(text) | text = text.lower() | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
numberText = string.strip(numberText) | numberText = numberText.strip() | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
from string import split, strip s = strip(s) | s = s.strip() | 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 | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
sl = split(s, ",") sl = map(strip, sl) sl = map(converter, sl) | sl = s.split(',') sl = [s.strip() for s in sl] sl = [converter(s) for s in 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 = split(s, ",") sl = map(strip, sl) sl = map(converter, sl) return sl | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
if text[0] in string.letters: | if text[0] in LETTERS: | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
"li.defaultStyle": "Definition" | "ul.defaultStyle": "UnorderedList", "ol.defaultStyle": "OrderedList", "li.defaultStyle": "Definition", | 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) | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
words = string.split(simpletext) | words = simpletext.split() | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
lines.append( (string.join(currentline), currentlength, len(currentline)) ) | lines.append( (' '.join(currentline), currentlength, len(currentline)) ) | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
lines.append( (string.join(currentline), currentlength, len(currentline) )) | lines.append( (' '.join(currentline), currentlength, len(currentline) )) | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
remainder = self.remainder = string.join(words[cursor:]) | remainder = self.remainder = ' '.join(words[cursor:]) | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py | |
if context is None: context = defaultContext() self.context = context | self.context = buildContext(context) | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
self.face = "times" self.size = 10 | self.face = style.fontName self.size = style.fontSize | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
(formattedProgram, remainder, laststate, heightused) = p.format(availableWidth, availableHeight, program, leading) | (formattedProgram, remainder, \ laststate, heightused) = p.format(availableWidth, availableHeight, program, leading) | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
self.remainder = Para(self.style1, parsedText=None, bulletText=None, state=laststate) | self.remainder = Para(self.style1, parsedText=None, bulletText=None, \ state=laststate, context=self.context) | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
from types import StringType, InstanceType | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py | |
if tx is StringType or tx is InstanceType: | if tx in (StringType, UnicodeType, InstanceType): | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py | ||
if ttext is types.StringType: | if ttext in (StringType, UnicodeType): | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
stext = parsedText.strip() | stext = parsedText.strip() | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
elif ttext is types.ListType: | elif ttext is ListType: | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
elif ttext is types.TupleType: | elif ttext is TupleType: | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
t = string.join(L, "") | t = ''.join(L) | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
import types | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py | |
if te is types.StringType: if e.strip(): | if te in (StringType, UnicodeType): if e.strip(): | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
elif te is types.TupleType: | elif te is TupleType: | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py | |
if te is types.StringType: if e.strip(): | if te in (StringType, UnicodeType): if e.strip(): | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
elif te is types.TupleType: | elif te is TupleType: | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
raise ValueError, "don't expect %s here inside list, expect 'dd' or 'dt'" % repr(tagname) | raise ValueError, "don't expect %s here inside list, expect 'dd' or 'dt'" % \ repr(tagname) | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
if len(content1)!=1: raise ValueError, "only simple strings supported in dd content currently: "+repr(content1) bullet = content1[0] if type(bullet) is not types.StringType: raise ValueError, "only simple strings supported in dd content currently: "+repr(content1) | self.compile_para(attdict1, content1, extra, program) | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
from types import StringType | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py | |
if len(content)!=1 or type(content[0]) is not StringType: | if len(content)!=1 or type(content[0]) not in (StringType, UnicodeType): | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
thepara = Para(newstyle, content, context=context, bulletText=bulletText) | thepara = Para(newstyle, content, context=context, bulletText=bulletText) | 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("... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
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("... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py | ||
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("... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py | ||
if type(text) is types.StringType and "&" not in text: | if type(text) in (StringType, UnicodeType) and "&" not in text: | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
semi = string.find(fragment, ";") | semi = fragment.find(";") | 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... | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.