bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def _cr_1_1(self,n,repeatRows, cmds): for op, (sc, sr), (ec, er), weight, color in cmds: if sr>=0 and sr>=repeatRows and sr<n and er>=0 and er<n: continue if sr>=repeatRows and sr<n: sr=repeatRows elif sr>=repeatRows and sr>=n: sr=sr+repeatRows-n if er>=repeatRows and er<n: er=repeatRows elif er>=repeatRows and er>=n: ...
def _cr_1_1(self,n,repeatRows, cmds): for c in cmds: c = tuple(c) (sc,sr), (ec,er) = c[1:3] if sr>=0 and sr>=repeatRows and sr<n and er>=0 and er<n: continue if sr>=repeatRows and sr<n: sr=repeatRows elif sr>=repeatRows and sr>=n: sr=sr+repeatRows-n if er>=repeatRows and er<n: er=repeatRows elif er>=repeatRows and er>=...
5,200
def _cr_1_1(self,n,repeatRows, cmds): for op, (sc, sr), (ec, er), weight, color in cmds: if sr>=0 and sr>=repeatRows and sr<n and er>=0 and er<n: continue if sr>=repeatRows and sr<n: sr=repeatRows elif sr>=repeatRows and sr>=n: sr=sr+repeatRows-n if er>=repeatRows and er<n: er=repeatRows elif er>=repeatRows and er>=n: ...
def _cr_1_1(self,n,repeatRows, cmds): for op, (sc, sr), (ec, er), weight, color in cmds: if sr>=0 and sr>=repeatRows and sr<n and er>=0 and er<n: continue if sr>=repeatRows and sr<n: sr=repeatRows elif sr>=repeatRows and sr>=n: sr=sr+repeatRows-n if er>=repeatRows and er<n: er=repeatRows elif er>=repeatRows and er>=n: ...
5,201
def _cr_1_0(self,n,cmds): for op, (sc, sr), (ec, er), weight, color in cmds: if er>=0 and er<n: continue if sr>=0 and sr<n: sr=0 if sr>=n: sr = sr-n if er>=n: er = er-n self._addCommand((op, (sc, sr), (ec, er), weight, color))
def _cr_1_0(self,n,cmds): for c in cmds: c = tuple(c) (sc,sr), (ec,er) = c[1:3] if er>=0 and er<n: continue if sr>=0 and sr<n: sr=0 if sr>=n: sr = sr-n if er>=n: er = er-n self._addCommand((op, (sc, sr), (ec, er), weight, color))
5,202
def _cr_1_0(self,n,cmds): for op, (sc, sr), (ec, er), weight, color in cmds: if er>=0 and er<n: continue if sr>=0 and sr<n: sr=0 if sr>=n: sr = sr-n if er>=n: er = er-n self._addCommand((op, (sc, sr), (ec, er), weight, color))
def _cr_1_0(self,n,cmds): for op, (sc, sr), (ec, er), weight, color in cmds: if er>=0 and er<n: continue if sr>=0 and sr<n: sr=0 if sr>=n: sr = sr-n if er>=n: er = er-n self._addCommand((op, (sc, sr), (ec, er), weight, color))
5,203
def setDash(self, array=[], phase=0): """Two notations. pass two numbers, or an array and phase""" if type(array) == IntType or type(array) == FloatType: self._code.append('[%s %s] 0 d' % (array, phase)) elif type(array) == ListType or type(Array) == TupleType: assert phase <= len(array), "setDash phase must be l.t.e....
def setDash(self, array=[], phase=0): """Two notations. pass two numbers, or an array and phase""" if type(array) == IntType or type(array) == FloatType: self._code.append('[%s %s] 0 d' % (array, phase)) elif type(array) == ListType or type(array) == TupleType: assert phase <= len(array), "setDash phase must be l.t.e....
5,204
def __init__(self,fn='rl_dbgmemo.dbg',mode='w',getScript=1,modules=(),capture_traceback=1, **kw): import time, socket self.fn = fn if mode!='w': return self.store = store = {} if capture_traceback and sys.exc_info() != (None,None,None): import traceback s = getStringIO() traceback.print_exc(None,s) store['__traceback']...
def __init__(self,fn='rl_dbgmemo.dbg',mode='w',getScript=1,modules=(),capture_traceback=1, stdout=None, **kw): import time, socket self.fn = fn if mode!='w': return self.store = store = {} if capture_traceback and sys.exc_info() != (None,None,None): import traceback s = getStringIO() traceback.print_exc(None,s) store['...
5,205
def __init__(self,fn='rl_dbgmemo.dbg',mode='w',getScript=1,modules=(),capture_traceback=1, **kw): import time, socket self.fn = fn if mode!='w': return self.store = store = {} if capture_traceback and sys.exc_info() != (None,None,None): import traceback s = getStringIO() traceback.print_exc(None,s) store['__traceback']...
def __init__(self,fn='rl_dbgmemo.dbg',mode='w',getScript=1,modules=(),capture_traceback=1, **kw): import time, socket self.fn = fn if mode!='w': return self.store = store = {} if capture_traceback and sys.exc_info() != (None,None,None): import traceback s = getStringIO() traceback.print_exc(None,s) store['__traceback']...
5,206
def __init__(self,fn='rl_dbgmemo.dbg',mode='w',getScript=1,modules=(),capture_traceback=1, **kw): import time, socket self.fn = fn if mode!='w': return self.store = store = {} if capture_traceback and sys.exc_info() != (None,None,None): import traceback s = getStringIO() traceback.print_exc(None,s) store['__traceback']...
def __init__(self,fn='rl_dbgmemo.dbg',mode='w',getScript=1,modules=(),capture_traceback=1, **kw): import time, socket self.fn = fn if mode!='w': return self.store = store = {} if capture_traceback and sys.exc_info() != (None,None,None): import traceback s = getStringIO() traceback.print_exc(None,s) store['__traceback']...
5,207
def _show_module_versions(self,k,v): print k[2:] K = v.keys() K.sort() for k in K: vk = v[k] try: m = recursiveImport(k,sys.path[:],1) d = getattr(m,'__version__',None)==vk and 'SAME' or 'DIFFERENT' except: m = None d = '??????unknown??????' print ' %s = %s (%s)' % (k,vk,d)
def _show_module_versions(self,k,v): self._writeln(k[2:]) K = v.keys() K.sort() for k in K: vk = v[k] try: m = recursiveImport(k,sys.path[:],1) d = getattr(m,'__version__',None)==vk and 'SAME' or 'DIFFERENT' except: m = None d = '??????unknown??????' print ' %s = %s (%s)' % (k,vk,d)
5,208
def _show_module_versions(self,k,v): print k[2:] K = v.keys() K.sort() for k in K: vk = v[k] try: m = recursiveImport(k,sys.path[:],1) d = getattr(m,'__version__',None)==vk and 'SAME' or 'DIFFERENT' except: m = None d = '??????unknown??????' print ' %s = %s (%s)' % (k,vk,d)
def _show_module_versions(self,k,v): print k[2:] K = v.keys() K.sort() for k in K: vk = v[k] try: m = recursiveImport(k,sys.path[:],1) d = getattr(m,'__version__',None)==vk and 'SAME' or 'DIFFERENT' except: m = None d = '??????unknown??????' print ' %s = %s (%s)' % (k,vk,d)
5,209
def _banner(self,k,what): print '###################%s %s##################' % (what,k[2:])
def _banner(self,k,what): print '###################%s %s##################' % (what,k[2:])
5,210
def _show_lines(self,k,v): self._start(k) print v self._finish(k)
def _show_lines(self,k,v): self._start(k) self._writeln(v) self._finish(k)
5,211
def _show_payload(self,k,v): if v: import pprint self._start(k) pprint.pprint(v) self._finish(k)
def _show_payload(self,k,v): if v: import pprint self._start(k) pprint.pprint(v,self.stdout) self._finish(k)
5,212
def _show_payload(self,k,v): if v: import pprint self._start(k) pprint.pprint(v) self._finish(k)
def _show_payload(self,k,v): if v: import pprint self._start(k) pprint.pprint(v) self._finish(k)
5,213
def show(self): K = self.store.keys() K.sort() for k in K: if k not in self.specials.keys(): print '%-15s = %s' % (k,self.store[k]) for k in K: if k in self.specials.keys(): apply(self.specials[k],(self,k,self.store[k]))
def show(self): K = self.store.keys() K.sort() for k in K: if k not in self.specials.keys(): self._writeln('%-15s = %s' % (k,self.store[k])) for k in K: if k in self.specials.keys(): apply(self.specials[k],(self,k,self.store[k]))
5,214
def save(self, formats=None, verbose=None, fnRoot=None): "Saves copies of self in desired location and formats" ext = '' fnroot = os.path.join(getattr(self,'outDir','.'), fnRoot or (getattr(self,'fileNamePattern',(self.__class__.__name__+'%03d')) % getattr(self,'chartId',0)))
def save(self, formats=None, verbose=None, fnRoot=None): "Saves copies of self in desired location and formats" ext = '' fnroot = os.path.join(getattr(self,'outDir','.'), fnRoot or (getattr(self,'fileNamePattern',(self.__class__.__name__+'%03d')) % getattr(self,'chartId',0)))
5,215
def save(self, formats=None, verbose=None, fnRoot=None): "Saves copies of self in desired location and formats" ext = '' fnroot = os.path.join(getattr(self,'outDir','.'), fnRoot or (getattr(self,'fileNamePattern',(self.__class__.__name__+'%03d')) % getattr(self,'chartId',0)))
def save(self, formats=None, verbose=None, fnRoot=None): "Saves copies of self in desired location and formats" ext = '' fnroot = os.path.join(getattr(self,'outDir','.'), fnRoot or (getattr(self,'fileNamePattern',(self.__class__.__name__+'%03d')) % getattr(self,'chartId',0)))
5,216
def save(self, formats=None, verbose=None, fnRoot=None): "Saves copies of self in desired location and formats" ext = '' fnroot = os.path.join(getattr(self,'outDir','.'), fnRoot or (getattr(self,'fileNamePattern',(self.__class__.__name__+'%03d')) % getattr(self,'chartId',0)))
def save(self, formats=None, verbose=None, fnRoot=None): "Saves copies of self in desired location and formats" ext = '' fnroot = os.path.join(getattr(self,'outDir','.'), fnRoot or (getattr(self,'fileNamePattern',(self.__class__.__name__+'%03d')) % getattr(self,'chartId',0)))
5,217
def save(self, formats=None, verbose=None, fnRoot=None): "Saves copies of self in desired location and formats" ext = '' fnroot = os.path.join(getattr(self,'outDir','.'), fnRoot or (getattr(self,'fileNamePattern',(self.__class__.__name__+'%03d')) % getattr(self,'chartId',0)))
def save(self, formats=None, verbose=None, fnRoot=None): "Saves copies of self in desired location and formats" ext = '' fnroot = os.path.join(getattr(self,'outDir','.'), fnRoot or (getattr(self,'fileNamePattern',(self.__class__.__name__+'%03d')) % getattr(self,'chartId',0)))
5,218
def save(self, formats=None, verbose=None, fnRoot=None): "Saves copies of self in desired location and formats" ext = '' fnroot = os.path.join(getattr(self,'outDir','.'), fnRoot or (getattr(self,'fileNamePattern',(self.__class__.__name__+'%03d')) % getattr(self,'chartId',0)))
def save(self, formats=None, verbose=None, fnRoot=None): "Saves copies of self in desired location and formats" ext = '' fnroot = os.path.join(getattr(self,'outDir','.'), fnRoot or (getattr(self,'fileNamePattern',(self.__class__.__name__+'%03d')) % getattr(self,'chartId',0)))
5,219
def save(self, formats=None, verbose=None, fnRoot=None): "Saves copies of self in desired location and formats" ext = '' fnroot = os.path.join(getattr(self,'outDir','.'), fnRoot or (getattr(self,'fileNamePattern',(self.__class__.__name__+'%03d')) % getattr(self,'chartId',0)))
def save(self, formats=None, verbose=None, fnRoot=None): "Saves copies of self in desired location and formats" ext = '' fnroot = os.path.join(getattr(self,'outDir','.'), fnRoot or (getattr(self,'fileNamePattern',(self.__class__.__name__+'%03d')) % getattr(self,'chartId',0)))
5,220
def save(self, formats=None, verbose=None, fnRoot=None): "Saves copies of self in desired location and formats" ext = '' fnroot = os.path.join(getattr(self,'outDir','.'), fnRoot or (getattr(self,'fileNamePattern',(self.__class__.__name__+'%03d')) % getattr(self,'chartId',0)))
def save(self, formats=None, verbose=None, fnRoot=None): "Saves copies of self in desired location and formats" ext = '' fnroot = os.path.join(getattr(self,'outDir','.'), fnRoot or (getattr(self,'fileNamePattern',(self.__class__.__name__+'%03d')) % getattr(self,'chartId',0)))
5,221
def buildargs(*args, **kwargs) : """Constructs a printable list of arguments suitable for use in source function calls.""" arguments = "" for arg in args : arguments += "%s, " % repr(arg) for (kw, val) in kwargs.items() : arguments += "%s=%s, " % (kw, repr(val)) if arguments[-2:] == ", " : arguments = arguments[:-2] re...
def buildargs(*args, **kwargs) : """Constructs a printable list of arguments suitable for use in source function calls.""" arguments = "" for arg in args : arguments = arguments + ("%s, " % repr(arg)) for (kw, val) in kwargs.items() : arguments += "%s=%s, " % (kw, repr(val)) if arguments[-2:] == ", " : arguments = argu...
5,222
def buildargs(*args, **kwargs) : """Constructs a printable list of arguments suitable for use in source function calls.""" arguments = "" for arg in args : arguments += "%s, " % repr(arg) for (kw, val) in kwargs.items() : arguments += "%s=%s, " % (kw, repr(val)) if arguments[-2:] == ", " : arguments = arguments[:-2] re...
def buildargs(*args, **kwargs) : """Constructs a printable list of arguments suitable for use in source function calls.""" arguments = "" for arg in args : arguments += "%s, " % repr(arg) for (kw, val) in kwargs.items() : arguments = arguments+ ("%s=%s, " % (kw, repr(val))) if arguments[-2:] == ", " : arguments = argum...
5,223
def __call__(self, *args, **kwargs) : """The fake method is called, print it then call the real one.""" if not self._parent._parent._in : self._precomment() self._parent._parent._PyWrite(" %s.%s(%s)" % (self._parent._name, self._action, apply(buildargs, args, kwargs))) self._postcomment() self._parent._parent._in +=...
def __call__(self, *args, **kwargs) : """The fake method is called, print it then call the real one.""" if not self._parent._parent._in : self._precomment() self._parent._parent._PyWrite(" %s.%s(%s)" % (self._parent._name, self._action, apply(buildargs, args, kwargs))) self._postcomment() self._parent._parent._in = ...
5,224
def __call__(self, *args, **kwargs) : """Real object initialisation is made here, because now we've got the arguments.""" if not self._initdone : self.__class__._number += 1 methodname = apply(self._postinit, args, kwargs) self._parent._PyWrite("\n # create PDF%sObject number %i\n %s = %s.%s(%s)" % (methodname[5:...
def __call__(self, *args, **kwargs) : """Real object initialisation is made here, because now we've got the arguments.""" if not self._initdone : self.__class__._number = self.__class__._number + 1 methodname = apply(self._postinit, args, kwargs) self._parent._PyWrite("\n # create PDF%sObject number %i\n %s = %s....
5,225
def _precomment(self) : """Outputs comments before the method call.""" if self._action == "showPage" : self._parent._PyWrite("\n # Ends page %i" % self._parent._pagenumber) elif self._action == "saveState" : state = {} d = self._parent._object.__dict__ for name in self._parent._object.STATE_ATTRIBUTES: state[name] =...
def _precomment(self) : """Outputs comments before the method call.""" if self._action == "showPage" : self._parent._PyWrite("\n # Ends page %i" % self._parent._pagenumber) elif self._action == "saveState" : state = {} d = self._parent._object.__dict__ for name in self._parent._object.STATE_ATTRIBUTES: state[name] =...
5,226
def _precomment(self) : """Outputs comments before the method call.""" if self._action == "showPage" : self._parent._PyWrite("\n # Ends page %i" % self._parent._pagenumber) elif self._action == "saveState" : state = {} d = self._parent._object.__dict__ for name in self._parent._object.STATE_ATTRIBUTES: state[name] =...
def _precomment(self) : """Outputs comments before the method call.""" if self._action == "showPage" : self._parent._PyWrite("\n # Ends page %i" % self._parent._pagenumber) elif self._action == "saveState" : state = {} d = self._parent._object.__dict__ for name in self._parent._object.STATE_ATTRIBUTES: state[name] =...
5,227
def _postcomment(self) : """Outputs comments after the method call.""" if self._action == "showPage" : self._parent._pagenumber += 1 self._parent._PyWrite("\n # Begins page %i" % self._parent._pagenumber) elif self._action == "endForm" : self._parent._PyWrite("")
def _postcomment(self) : """Outputs comments after the method call.""" if self._action == "showPage" : self._parent._pagenumber = self._parent._pagenumber + 1 self._parent._PyWrite("\n # Begins page %i" % self._parent._pagenumber) elif self._action == "endForm" : self._parent._PyWrite("")
5,228
def goodTest(x,t,tb=0,**kw): try: P=pyRXP.Parser(**kw) r = P(x) rb = 0 except: et, ev, None = sys.exc_info() r = '%s %s' % (et.__name__, str(ev)) rb = 1 s = '' for k,v in kw.items(): s = s+', %s=%s' % (k,str(v)) if type(t) is type(''): t = t.replace('\r','\\r') t = t.replace('\n','\\n') if type(r) is type(''): r = r.r...
def goodTest(x,t,tb=0,**kw): try: P=_pyRXP.Parser(**kw) r = P(x) rb = 0 except: et, ev, None = sys.exc_info() r = '%s %s' % (et.__name__, str(ev)) rb = 1 s = '' for k,v in kw.items(): s = s+', %s=%s' % (k,str(v)) if type(t) is type(''): t = t.replace('\r','\\r') t = t.replace('\n','\\n') if type(r) is type(''): r = r....
5,229
def goodTest(x,t,tb=0,**kw): try: P=pyRXP.Parser(**kw) r = P(x) rb = 0 except: et, ev, None = sys.exc_info() r = '%s %s' % (et.__name__, str(ev)) rb = 1 s = '' for k,v in kw.items(): s = s+', %s=%s' % (k,str(v)) if type(t) is type(''): t = t.replace('\r','\\r') t = t.replace('\n','\\n') if type(r) is type(''): r = r.r...
def goodTest(x,t,tb=0,**kw): try: P=pyRXP.Parser(**kw) r = P(x) rb = 0 except: et, ev, None = sys.exc_info() r = '%s %s' % (et.__name__, str(ev)) rb = 1 s = '' for k,v in kw.items(): s = s+', %s=%s' % (k,str(v)) if type(t) is type(''): t = t.replace('\r','\\r') t = t.replace('\n','\\n') if type(r) is type(''): r = r.r...
5,230
def failTest(x,t,tb=1,**kw): goodTest(x,t,tb,**kw)
def failTest(x,t,tb=1,**kw): goodTest(x,t,tb,**kw)
5,231
def cvs_checkout(d): os.chdir(d) recursive_rmdir(cvsdir) cvs = find_exe('cvs') if cvs is None: print "Can't find cvs anywhere on the path" os.exit(1) os.environ['CVSROOT']=':pserver:%s@cvs1:/cvsroot/reportlab' % USER if release: do_exec(cvs+' tag %s' % release, 'the tag phase') do_exec(cvs+' co reportlab', 'the down...
def cvs_checkout(d): os.chdir(d) recursive_rmdir(cvsdir) cvs = find_exe('cvs') if cvs is None: print "Can't find cvs anywhere on the path" os.exit(1) if release: do_exec(cvs+' tag %s' % release, 'the tag phase') do_exec(cvs+' co reportlab', 'the download phase')
5,232
def _elementWidth(self,v,s): t = type(v) if t in _SeqTypes: w = 0 for e in v: ew = self._elementWidth(e,s) if ew is None: return None w = max(w,ew) return w elif isinstance(v,Flowable) and v._fixedWidth: if hasattr(v, 'width'): return v.width if hasattr(v, 'drawWidth'): return v.drawWidth # Even if something is fixedWi...
def _elementWidth(self,v,s): t = type(v) if t in _SeqTypes: w = 0 for e in v: ew = self._elementWidth(e,s) if ew is None: return None w = max(w,ew) return w elif isinstance(v,Flowable) and v._fixedWidth: if hasattr(v, 'width'): return v.width if hasattr(v, 'drawWidth'): return v.drawWidth # Even if something is fixedWi...
5,233
def cvs_checkout(d): os.chdir(d) cvsdir = os.path.join(d,projdir) recursive_rmdir(cvsdir) recursive_rmdir('docs') cvs = find_exe('cvs') python = find_exe('python') if cvs is None: os.exit(1) os.environ['CVSROOT']=':pserver:%s@cvs.reportlab.sourceforge.net:/cvsroot/reportlab' % USER if release: do_exec(cvs+(' export -...
def cvs_checkout(d): os.chdir(d) cvsdir = os.path.join(d,projdir) recursive_rmdir(cvsdir) recursive_rmdir('docs') cvs = find_exe('cvs') python = find_exe('python') if cvs is None: os.exit(1) os.environ['CVSROOT']=':pserver:%s@cvs.reportlab.sourceforge.net:/cvsroot/reportlab' % USER if release: do_exec(cvs+(' export -...
5,234
def _getFragWords(frags): ''' given a fragment list return a list of lists [[size, (f00,w00), ..., (f0n,w0n)],....,[size, (fm0,wm0), ..., (f0n,wmn)]] each pair f,w represents a style and some string each sublist represents a word ''' R = [] W = [] n = 0 for f in frags: text = f.text del f.text if text!='': S = string.s...
def _getFragWords(frags): ''' given a fragment list return a list of lists [[size, (f00,w00), ..., (f0n,w0n)],....,[size, (fm0,wm0), ..., (f0n,wmn)]] each pair f,w represents a style and some string each sublist represents a word ''' R = [] W = [] n = 0 for f in frags: text = f.text if text!='': S = string.split(text...
5,235
def __init__(self, cyan=0, magenta=0, yellow=0, black=0, spotName=None, density=1): """ Initialize with four colors in range [0-1]. the optional spotName and density may be of use to specific renderers. The spotName is intended for use as an identifier to the rendere not client programs. """ self.cyan = cyan self.magen...
def __init__(self, cyan=0, magenta=0, yellow=0, black=0, spotName=None, density=1): """ Initialize with four colors in range [0-1]. the optional spotName and density may be of use to specific renderers. The spotName is intended for use as an identifier to the rendere not client programs. """ self.cyan = cyan self.magen...
5,236
def __init__(self, cyan=0, magenta=0, yellow=0, black=0, spotName=None, density=1): """ Initialize with four colors in range [0-1]. the optional spotName and density may be of use to specific renderers. The spotName is intended for use as an identifier to the rendere not client programs. """ self.cyan = cyan self.magen...
def __init__(self, cyan=0, magenta=0, yellow=0, black=0, spotName=None, density=1): """ Initialize with four colors in range [0-1]. the optional spotName and density may be of use to specific renderers. The spotName is intended for use as an identifier to the rendere not client programs. """ self.cyan = cyan self.magen...
5,237
def linearlyInterpolatedColor(c0, c1, x0, x1, x): """ Linearly interpolates colors. Can handle RGB, CMYK and PCMYK colors - give ValueError if colours aren't the same. Doesn't currently handle 'Spot Color Interpolation'. """ if c0.__class__ != c1.__class__: raise ValueError, "Color classes must be the same for interpo...
deflinearlyInterpolatedColor(c0,c1,x0,x1,x):"""Linearlyinterpolatescolors.CanhandleRGB,CMYKandPCMYKcolors-giveValueErrorifcoloursaren'tthesame.Doesn'tcurrentlyhandle'SpotColorInterpolation'."""ifc0.__class__!=c1.__class__:raiseValueError,"Colorclassesmustbethesameforinterpolation!"ifx1<x0:x0,x1,c0,c1=x1,x0,c1,c0#normal...
5,238
def linearlyInterpolatedColor(c0, c1, x0, x1, x): """ Linearly interpolates colors. Can handle RGB, CMYK and PCMYK colors - give ValueError if colours aren't the same. Doesn't currently handle 'Spot Color Interpolation'. """ if c0.__class__ != c1.__class__: raise ValueError, "Color classes must be the same for interpo...
def linearlyInterpolatedColor(c0, c1, x0, x1, x): """ Linearly interpolates colors. Can handle RGB, CMYK and PCMYK colors - give ValueError if colours aren't the same. Doesn't currently handle 'Spot Color Interpolation'. """ if c0.__class__ != c1.__class__: raise ValueError, "Color classes must be the same for interpo...
5,239
def linearlyInterpolatedColor(c0, c1, x0, x1, x): """ Linearly interpolates colors. Can handle RGB, CMYK and PCMYK colors - give ValueError if colours aren't the same. Doesn't currently handle 'Spot Color Interpolation'. """ if c0.__class__ != c1.__class__: raise ValueError, "Color classes must be the same for interpo...
def linearlyInterpolatedColor(c0, c1, x0, x1, x): """ Linearly interpolates colors. Can handle RGB, CMYK and PCMYK colors - give ValueError if colours aren't the same. Doesn't currently handle 'Spot Color Interpolation'. """ if c0.__class__ != c1.__class__: raise ValueError, "Color classes must be the same for interpo...
5,240
def _getDrawingDimensions(self): #find width of boxes+spacers tx=(self.numberOfBoxes*self.boxWidth) if self.numberOfBoxes>1: tx=tx+((self.numberOfBoxes-1)*self.boxSpacing) #add padding tx=tx+self.leftPadding+self.rightPadding #find height of grid+triangles ty=self.boxHeight+self.triangleHeight #add padding (and offset)...
def_getDrawingDimensions(self):#findwidthofboxes+spacerstx=(self.numberOfBoxes*self.boxWidth)ifself.numberOfBoxes>1:tx=tx+((self.numberOfBoxes-1)*self.boxSpacing)#addpaddingtx=tx+self.leftPadding+self.rightPadding#findheightofgrid+trianglesty=self.boxHeight+self.triangleHeight#addpadding(andoffset)ty=ty+self.topPadding...
5,241
def _getDrawingDimensions(self): #find width of boxes+spacers tx=(self.numberOfBoxes*self.boxWidth) if self.numberOfBoxes>1: tx=tx+((self.numberOfBoxes-1)*self.boxSpacing) #add padding tx=tx+self.leftPadding+self.rightPadding #find height of grid+triangles ty=self.boxHeight+self.triangleHeight #add padding (and offset)...
def _getDrawingDimensions(self): #find width of boxes+spacers tx=(self.numberOfBoxes*self.boxWidth) if self.numberOfBoxes>1: tx=tx+((self.numberOfBoxes-1)*self.boxSpacing) #add padding tx=tx+self.leftPadding+self.rightPadding #find height of grid+triangles ty=self.boxHeight+self.triangleHeight #add padding (and offset)...
5,242
def _getDrawingDimensions(self): #find width of boxes+spacers tx=(self.numberOfBoxes*self.boxWidth) if self.numberOfBoxes>1: tx=tx+((self.numberOfBoxes-1)*self.boxSpacing) #add padding tx=tx+self.leftPadding+self.rightPadding #find height of grid+triangles ty=self.boxHeight+self.triangleHeight #add padding (and offset)...
def_getDrawingDimensions(self):#findwidthofboxes+spacerstx=(self.numberOfBoxes*self.boxWidth)ifself.numberOfBoxes>1:tx=tx+((self.numberOfBoxes-1)*self.boxSpacing)#addpaddingtx=tx+self.leftPadding+self.rightPadding#findheightofgrid+trianglesty=self.boxHeight+self.triangleHeight#addpadding(andoffset)ty=ty+self.topPadding...
5,243
def _getDrawingDimensions(self): #find width of boxes+spacers tx=(self.numberOfBoxes*self.boxWidth) if self.numberOfBoxes>1: tx=tx+((self.numberOfBoxes-1)*self.boxSpacing) #add padding tx=tx+self.leftPadding+self.rightPadding #find height of grid+triangles ty=self.boxHeight+self.triangleHeight #add padding (and offset)...
def_getDrawingDimensions(self):#findwidthofboxes+spacerstx=(self.numberOfBoxes*self.boxWidth)ifself.numberOfBoxes>1:tx=tx+((self.numberOfBoxes-1)*self.boxSpacing)#addpaddingtx=tx+self.leftPadding+self.rightPadding#findheightofgrid+trianglesty=self.boxHeight+self.triangleHeight#addpadding(andoffset)ty=ty+self.topPadding...
5,244
def _getDrawingDimensions(self): #find width of boxes+spacers tx=(self.numberOfBoxes*self.boxWidth) if self.numberOfBoxes>1: tx=tx+((self.numberOfBoxes-1)*self.boxSpacing) #add padding tx=tx+self.leftPadding+self.rightPadding #find height of grid+triangles ty=self.boxHeight+self.triangleHeight #add padding (and offset)...
def_getDrawingDimensions(self):#findwidthofboxes+spacerstx=(self.numberOfBoxes*self.boxWidth)ifself.numberOfBoxes>1:tx=tx+((self.numberOfBoxes-1)*self.boxSpacing)#addpaddingtx=tx+self.leftPadding+self.rightPadding#findheightofgrid+trianglesty=self.boxHeight+self.triangleHeight#addpadding(andoffset)ty=ty+self.topPadding...
5,245
def draw(self): g = Group() ys = self.bottomPadding+(self.triangleHeight/2)+self.sourceLabelOffset+self.sourceLabelFontSize if self.background: x,y = self._getDrawingDimensions() g.add(Rect(-self.leftPadding,-ys,x,y, strokeColor=None, strokeWidth=0, fillColor=self.background))
def draw(self): g = Group() ys = self.bottomPadding+(self.triangleHeight/2)+self.sourceLabelOffset+self.sourceLabelFontSize if self.background: x,y = self._getDrawingDimensions() g.add(Rect(-self.leftPadding,-ys,x,y, strokeColor=None, strokeWidth=0, fillColor=self.background))
5,246
def draw(self): g = Group() ys = self.bottomPadding+(self.triangleHeight/2)+self.sourceLabelOffset+self.sourceLabelFontSize if self.background: x,y = self._getDrawingDimensions() g.add(Rect(-self.leftPadding,-ys,x,y, strokeColor=None, strokeWidth=0, fillColor=self.background))
def draw(self): g = Group() ys = self.bottomPadding+(self.triangleHeight/2)+self.sourceLabelOffset+self.sourceLabelFontSize if self.background: x,y = self._getDrawingDimensions() g.add(Rect(-self.leftPadding,-ys,x,y, strokeColor=None, strokeWidth=0, fillColor=self.background))
5,247
def draw(self): g = Group() ys = self.bottomPadding+(self.triangleHeight/2)+self.sourceLabelOffset+self.sourceLabelFontSize if self.background: x,y = self._getDrawingDimensions() g.add(Rect(-self.leftPadding,-ys,x,y, strokeColor=None, strokeWidth=0, fillColor=self.background))
def draw(self): g = Group() ys = self.bottomPadding+(self.triangleHeight/2)+self.sourceLabelOffset+self.sourceLabelFontSize if self.background: x,y = self._getDrawingDimensions() g.add(Rect(-self.leftPadding,-ys,x,y, strokeColor=None, strokeWidth=0, fillColor=self.background))
5,248
def draw(self): g = Group() ys = self.bottomPadding+(self.triangleHeight/2)+self.sourceLabelOffset+self.sourceLabelFontSize if self.background: x,y = self._getDrawingDimensions() g.add(Rect(-self.leftPadding,-ys,x,y, strokeColor=None, strokeWidth=0, fillColor=self.background))
def draw(self): g = Group() ys = self.bottomPadding+(self.triangleHeight/2)+self.sourceLabelOffset+self.sourceLabelFontSize if self.background: x,y = self._getDrawingDimensions() g.add(Rect(-self.leftPadding,-ys,x,y, strokeColor=None, strokeWidth=0, fillColor=self.background))
5,249
def recursiveImport(modulename, baseDir=None, noCWD=0, debug=0): """Dynamically imports possible packagized module, or raises ImportError""" import imp parts = string.split(modulename, '.') name = parts[0] if baseDir is None: path = sys.path[:] else: if type(baseDir) not in SeqTypes: path = [baseDir] else: path = list...
def recursiveImport(modulename, baseDir=None, noCWD=0, debug=0): """Dynamically imports possible packagized module, or raises ImportError""" import imp parts = string.split(modulename, '.') name = parts[0] if baseDir is None: path = sys.path[:] else: if type(baseDir) not in SeqTypes: path = [baseDir] else: path = list...
5,250
def _className(self): '''Return a shortened class name''' try: name = self.__class__.__name__ i=string.rfind(name,'.') if i>=0: return name[i+1:] return name except AttributeError: return str(self)
def _className(self): '''Return a shortened class name''' try: name = self.__class__.__name__ i=string.rfind(name,'.') if i>=0: return name[i+1:] return name except AttributeError: return str(self)
5,251
def _className(self): '''Return a shortened class name''' try: name = self.__class__.__name__ i=string.rfind(name,'.') if i>=0: return name[i+1:] return name except AttributeError: return str(self)
def _className(self): '''Return a shortened class name''' try: name = self.__class__.__name__ i=string.rfind(name,'.') if i>=0: return name[i+1:] return name except AttributeError: return str(self)
5,252
def _className(self): '''Return a shortened class name''' try: name = self.__class__.__name__ i=string.rfind(name,'.') if i>=0: return name[i+1:] return name except AttributeError: return str(self)
def _className(self): '''Return a shortened class name''' try: name = self.__class__.__name__ i=string.rfind(name,'.') if i>=0: return name[i+1:] return name except AttributeError: return str(self)
5,253
def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word li...
def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word li...
5,254
def libart_version(): K = ('LIBART_MAJOR_VERSION','LIBART_MINOR_VERSION','LIBART_MICRO_VERSION') D = {} for l in open('libart_lgpl/configure.in','r').readlines(): l = string.split(string.strip(l),'=') if len(l)>1 and string.strip(l[0]) in K: D[string.strip(l[0])] = string.strip(l[1]) if len(D)==3: break return '\\"%s\\...
def libart_version(): K = ('LIBART_MAJOR_VERSION','LIBART_MINOR_VERSION','LIBART_MICRO_VERSION') D = {} for l in open('libart_lgpl/configure.in','r').readlines(): l = string.split(string.strip(l),'=') if len(l)>1 and string.strip(l[0]) in K: D[string.strip(l[0])] = string.strip(l[1]) if len(D)==3: break return '\\"%s\\...
5,255
def describe(aColor): # finds nearest match to one you provide. Useful when # trying to replicate a web page and you only have the # RGB values namedColors = getAllNamedColors() closest = (10, None, None) #big number, name, color for (name, color) in namedColors.items(): distance = colorDistance(aColor, color) if dis...
def describe(aColor,mode=0): # finds nearest match to one you provide. Useful when # trying to replicate a web page and you only have the # RGB values namedColors = getAllNamedColors() closest = (10, None, None) #big number, name, color for (name, color) in namedColors.items(): distance = colorDistance(aColor, color)...
5,256
def describe(aColor): # finds nearest match to one you provide. Useful when # trying to replicate a web page and you only have the # RGB values namedColors = getAllNamedColors() closest = (10, None, None) #big number, name, color for (name, color) in namedColors.items(): distance = colorDistance(aColor, color) if dis...
def describe(aColor): # finds nearest match to one you provide. Useful when # trying to replicate a web page and you only have the # RGB values namedColors = getAllNamedColors() closest = (10, None, None) #big number, name, color for (name, color) in namedColors.items(): distance = colorDistance(aColor, color) if dis...
5,257
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group() # crossbox specific bits box = shapes.Rect(self.x, self.y, s, s, fillColor = None, strokeColor = self.boxColor, strokeWidth=2) g.add(box) crossLine1 = shapes.Line(self.x+(s*0.15), self.y+(s*0.15), self.x+(s*...
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group() # crossbox specific bits box = shapes.Rect(self.x+1, self.y+1, s-2, s-2, fillColor = None, strokeColor = self.boxColor, strokeWidth=2) g.add(box) crossLine1 = shapes.Line(self.x+(s*0.15), self.y+(s*0.15), se...
5,258
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group() # tickbox specific bits box = shapes.Rect(self.x, self.y, s, s, fillColor = None, strokeColor = self.boxColor, strokeWidth=2) g.add(box)
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group() # tickbox specific bits box = shapes.Rect(self.x+1, self.y+1, s-2, s-2, fillColor = None, strokeColor = self.boxColor, strokeWidth=2) g.add(box)
5,259
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group()
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group()
5,260
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group()
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group()
5,261
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group()
def draw(self): # general widget bits s = self.size # abbreviate as we will use this a lot g = shapes.Group()
5,262
def sort(self): self._data.sort(_cmpFakeItem) #for t in self._data: print t
def sort(self): self._data.sort(_cmpFakeItem) #for t in self._data: print t
5,263
def calcBarPositions(self): VerticalBarChart.calcBarPositions(self) seriesCount = self._seriesCount if self.categoryAxis.style=='parallel_3d': _3d_depth = seriesCount*self.barWidth+(seriesCount-1)*self.barSpacing else: _3d_depth = self.barWidth _3d_depth *= self._normFactor self._3d_dx = self._theta_x*_3d_depth self._3...
def calcBarPositions(self): VerticalBarChart.calcBarPositions(self) seriesCount = self._seriesCount if self.categoryAxis.style=='parallel_3d': _3d_depth = seriesCount*self.barWidth+(seriesCount+1)*self.barSpacing else: _3d_depth = self.barWidth _3d_depth *= self._normFactor self._3d_dx = self._theta_x*_3d_depth self._3...
5,264
def calcBarPositions(self): VerticalBarChart.calcBarPositions(self) seriesCount = self._seriesCount if self.categoryAxis.style=='parallel_3d': _3d_depth = seriesCount*self.barWidth+(seriesCount-1)*self.barSpacing else: _3d_depth = self.barWidth _3d_depth *= self._normFactor self._3d_dx = self._theta_x*_3d_depth self._3...
def calcBarPositions(self): VerticalBarChart.calcBarPositions(self) seriesCount = self._seriesCount if self.categoryAxis.style=='parallel_3d': _3d_depth = seriesCount*self.barWidth+(seriesCount-1)*self.barSpacing else: _3d_depth = self.barWidth + 2*self.barSpacing _3d_depth *= self._normFactor self._3d_dx = self._theta...
5,265
def calcBarPositions(self): VerticalBarChart.calcBarPositions(self) seriesCount = self._seriesCount if self.categoryAxis.style=='parallel_3d': _3d_depth = seriesCount*self.barWidth+(seriesCount-1)*self.barSpacing else: _3d_depth = self.barWidth _3d_depth *= self._normFactor self._3d_dx = self._theta_x*_3d_depth self._3...
def calcBarPositions(self): VerticalBarChart.calcBarPositions(self) seriesCount = self._seriesCount if self.categoryAxis.style=='parallel_3d': _3d_depth = seriesCount*self.barWidth+(seriesCount-1)*self.barSpacing else: _3d_depth = self.barWidth _3d_depth *= self._normFactor self._3d_dx = self._theta_x*_3d_depth self._3...
5,266
def _calc_z0(self,rowNo): if self.categoryAxis.style=='parallel_3d': z0 = self._normFactor*rowNo*(self.barWidth+self.barSpacing) else: z0 = 0 return z0
def _calc_z0(self,rowNo): if self.categoryAxis.style=='parallel_3d': z0 = self._normFactor*(rowNo*(self.barWidth+self.barSpacing)+self.barSpacing) else: z0 = 0 return z0
5,267
def _calc_z0(self,rowNo): if self.categoryAxis.style=='parallel_3d': z0 = self._normFactor*rowNo*(self.barWidth+self.barSpacing) else: z0 = 0 return z0
def _calc_z0(self,rowNo): if self.categoryAxis.style=='parallel_3d': z0 = self._normFactor*rowNo*(self.barWidth+self.barSpacing) else: z0 = self._normFactor*self.barSpacing return z0
5,268
def _makeBar(self,g,x,y,width,height,rowNo,style): z0 = self._calc_z0(rowNo) z1 = z0 + self.barWidth*self._normFactor if height<0: y += height height = -height x += z0*self._theta_x y += z0*self._theta_y g.add((0,z0,z1,x,y,width,height,rowNo,style))
def _makeBar(self,g,x,y,width,height,rowNo,style): z0 = self._calc_z0(rowNo) z1 = z0 + self.barWidth*self._normFactor if height<0: y += height height = -height x += z0*self.theta_x y += z0*self.theta_y g.add((0,z0,z1,x,y,width,height,rowNo,style))
5,269
def _addBarLabel(self, g, rowNo, colNo, x, y, width, height): z0 = self._calc_z0(rowNo) z1 = z0 x += z0*self._theta_x y += z0*self._theta_y g.add((1,z0,z1,x,y,width,height,rowNo,colNo))
def _addBarLabel(self, g, rowNo, colNo, x, y, width, height): z0 = self._calc_z0(rowNo) z1 = z0 x += z0*self.theta_x y += z0*self.theta_y g.add((1,z0,z1,x,y,width,height,rowNo,colNo))
5,270
def makeBars(self): from utils3d import _draw_3d_bar fg = _FakeGroup() self._makeBars(fg,fg) fg.sort() g = Group() theta_x = self._theta_x theta_y = self._theta_y for t in fg.value(): if t[0]==1: z0,z1,x,y,width,height,rowNo,colNo = t[1:] VerticalBarChart._addBarLabel(self,g,rowNo,colNo,x,y,width,height) elif t[0]==0: ...
def makeBars(self): from utils3d import _draw_3d_bar fg = _FakeGroup() self._makeBars(fg,fg) fg.sort() g = Group() theta_x = self.theta_x theta_y = self.theta_y for t in fg.value(): if t[0]==1: z0,z1,x,y,width,height,rowNo,colNo = t[1:] VerticalBarChart._addBarLabel(self,g,rowNo,colNo,x,y,width,height) elif t[0]==0: z0...
5,271
def start_image(self, args): self._curImage = pythonpoint.PPImage() self._curImage.filename = self._arg('image',args,'filename') if args['width'] <> 'None': self._curImage.width = self.ceval('image',args,'width') if args['height'] <> 'None': self._curImage.height = self.ceval('image',args,'height')
def start_image(self, args): self._curImage = pythonpoint.PPImage() self._curImage.filename = self._arg('image',args,'filename') self._curImage.width = self.ceval('image',args,'width') self._curImage.height = self.ceval('image',args,'height')
5,272
def calcPositions(self): HorizontalLineChart.calcPositions(self) nSeries = self._seriesCount zSpace = self.zSpace zDepth = self.zDepth if self.categoryAxis.style=='parallel_3d': _3d_depth = nSeries*zDepth+(n+1)*self.zSpace else: _3d_depth = zDepth + 2*zSpace self._3d_dx = self.theta_x*_3d_depth self._3d_dy = self.theta...
def calcPositions(self): HorizontalLineChart.calcPositions(self) nSeries = self._seriesCount zSpace = self.zSpace zDepth = self.zDepth if self.categoryAxis.style=='parallel_3d': _3d_depth = nSeries*zDepth+(nSeries+1)*self.zSpace else: _3d_depth = zDepth + 2*zSpace self._3d_dx = self.theta_x*_3d_depth self._3d_dy = self...
5,273
def _getConfigureData(self): cA = self.categoryAxis data = self.data if cA.style!='parallel': _data = data data = max(map(len,_data))*[0] for d in _data: for i in xrange(len(d)): data[i] += d[i] or 0 data = _data + [data] self._configureData = data
def _getConfigureData(self): cA = self.categoryAxis data = self.data if cA.style!='parallel': _data = data data = max(map(len,_data))*[0] for d in _data: for i in xrange(len(d)): data[i] += d[i] or 0 data = list(_data) + [data] self._configureData = data
5,274
def getrc(defns,depth=1): from sys import getrefcount, _getframe f = _getframe(depth) G0 = f.f_globals L = f.f_locals if L is not G0: LL = [L] while 1: f = f.f_back G = f.f_globals L = f.f_locals if G is not G0 or G is L: break LL.append(L) L = {} for l in reversed(LL): L.update(l) else: L = L.copy() G0 = G0.copy() ret...
def getrc(defns,depth=1): from sys import getrefcount, _getframe f = _getframe(depth) G0 = f.f_globals L = f.f_locals if L is not G0: LL = [L] while 1: f = f.f_back G = f.f_globals L = f.f_locals if G is not G0 or G is L: break LL.append(L) L = {} for l in reversed(LL): L.update(l) else: L = L.copy() G0 = G0.copy() ret...
5,275
def checkrc(defns,rcv0): rcv1 = getrc(defns,2) return ' '.join(["%s %d-->%d" % (x,v,w) for x,v,w in zip(defns.split(),rcv0,rcv1) if v!=w])
def checkrc(defns,rcv0): rcv1 = getrc(defns,2) return ' '.join(["%s %s-->%s" % (x,v,w) for x,v,w in zip(defns.split(),rcv0.split(),rcv1.split()) if v!=w])
5,276
eg(""" def __init__(self,filename, pagesize=(595.27,841.89), bottomup = 1, pageCompression=0, encoding=rl_config.defaultEncoding, verbosity=0): """)
eg(""" def __init__(self,filename, pagesize=(595.27,841.89), bottomup = 1, pageCompression=0, encoding=rl_config.defaultEncoding, verbosity=0): """)
5,277
def PIL_imagedata(self): if not zlib: warnOnce('zlib not available') return image = self.image myimage = image.convert('RGB') imgwidth, imgheight = myimage.size
def PIL_imagedata(self): if not zlib: warnOnce('zlib not available') return image = self.image myimage = image.convert('RGB') imgwidth, imgheight = myimage.size
5,278
def __init__(self): self.fillColor = white self.strokeColor = None self.strokeWidth = 0.1 self.background = ReportLabBlue self.shadow = 0.5 self.height = 86 self.width = 129 self.x = self.y = self.angle = self.skewY = self._dx = 0 self.skewX = 10 self._dy = 35.5 self.showPage = 1
def __init__(self): self.fillColor = white self.strokeColor = None self.strokeWidth = 0.1 self.background = ReportLabBlue self.shadow = 0.5 self.height = 86 self.width = 130 self.x = self.y = self.angle = self.skewY = self._dx = 0 self.skewX = 10 self._dy = 35.5 self.showPage = 1
5,279
def draw(self): fillColor = self.fillColor strokeColor = self.strokeColor g = Group() bg = self.background shadow = self.shadow x, y = self.x, self.y if bg: shadow = Color(bg.red*shadow,bg.green*shadow,bg.blue*shadow) self._paintLogo(g,dy=-2.5, dx=2,fillColor=shadow) self._paintLogo(g,fillColor=fillColor,strokeColor=st...
def draw(self): fillColor = self.fillColor strokeColor = self.strokeColor g = Group() bg = self.background shadow = self.shadow x, y = self.x, self.y if bg: shadow = Color(bg.red*shadow,bg.green*shadow,bg.blue*shadow) self._paintLogo(g,dy=-2.5, dx=2,fillColor=shadow) self._paintLogo(g,fillColor=fillColor,strokeColor=st...
5,280
def draw(self): fillColor = self.fillColor strokeColor = self.strokeColor g = Group() bg = self.background shadow = self.shadow x, y = self.x, self.y if bg: shadow = Color(bg.red*shadow,bg.green*shadow,bg.blue*shadow) self._paintLogo(g,dy=-2.5, dx=2,fillColor=shadow) self._paintLogo(g,fillColor=fillColor,strokeColor=st...
def draw(self): fillColor = self.fillColor strokeColor = self.strokeColor g = Group() bg = self.background shadow = self.shadow x, y = self.x, self.y if bg: shadow = Color(bg.red*shadow,bg.green*shadow,bg.blue*shadow) self._paintLogo(g,dy=-2.5, dx=2,fillColor=shadow) self._paintLogo(g,fillColor=fillColor,strokeColor=st...
5,281
def markfilename(filename,creatorcode=None,filetype=None,ext='PDF'): try: if creatorcode is None or filetype is None and ext is not None: try: creatorcode, filetype = _KNOWN_MAC_EXT[ext] except: return macfs.FSSpec(filename).SetCreatorType(creatorcode,filetype) macostools.touched(filename) except: pass
def markfilename(filename,creatorcode=None,filetype=None,ext='PDF'): try: if creatorcode is None or filetype is None and ext is not None: try: creatorcode, filetype = _KNOWN_MAC_EXT[string.upper(ext)] except: return macfs.FSSpec(filename).SetCreatorType(creatorcode,filetype) macostools.touched(filename) except: pass
5,282
def draw(self): pass
def draw(self): pass
5,283
def __repr__(self): return "PageBreak()"
def __repr__(self): return "PageBreak()"
5,284
def split(self, availWidth, availHeight): canv = self.canv C = self._content x = i = H = pS = 0 n = len(C) I2W = {} for x in xrange(n): c = C[x] I = c._ptoinfo if I not in I2W.keys(): T = I.trailer Hdr = I.header tW, tH = _listWrapOn(T, availWidth, self.canv) tSB = T[0].getSpaceBefore() I2W[I] = T,tW,tH,tSB else: T,tW,...
def split(self, availWidth, availHeight): canv = self.canv C = self._content x = i = H = pS = hx = 0 n = len(C) I2W = {} for x in xrange(n): c = C[x] I = c._ptoinfo if I not in I2W.keys(): T = I.trailer Hdr = I.header tW, tH = _listWrapOn(T, availWidth, self.canv) tSB = T[0].getSpaceBefore() I2W[I] = T,tW,tH,tSB else: ...
5,285
def split(self, availWidth, availHeight): canv = self.canv C = self._content x = i = H = pS = 0 n = len(C) I2W = {} for x in xrange(n): c = C[x] I = c._ptoinfo if I not in I2W.keys(): T = I.trailer Hdr = I.header tW, tH = _listWrapOn(T, availWidth, self.canv) tSB = T[0].getSpaceBefore() I2W[I] = T,tW,tH,tSB else: T,tW,...
def split(self, availWidth, availHeight): canv = self.canv C = self._content x = i = H = pS = 0 n = len(C) I2W = {} for x in xrange(n): c = C[x] I = c._ptoinfo if I not in I2W.keys(): T = I.trailer Hdr = I.header tW, tH = _listWrapOn(T, availWidth, self.canv) tSB = T[0].getSpaceBefore() I2W[I] = T,tW,tH,tSB else: T,tW,...
5,286
def split(self, availWidth, availHeight): canv = self.canv C = self._content x = i = H = pS = 0 n = len(C) I2W = {} for x in xrange(n): c = C[x] I = c._ptoinfo if I not in I2W.keys(): T = I.trailer Hdr = I.header tW, tH = _listWrapOn(T, availWidth, self.canv) tSB = T[0].getSpaceBefore() I2W[I] = T,tW,tH,tSB else: T,tW,...
def split(self, availWidth, availHeight): canv = self.canv C = self._content x = i = H = pS = 0 n = len(C) I2W = {} for x in xrange(n): c = C[x] I = c._ptoinfo if I not in I2W.keys(): T = I.trailer Hdr = I.header tW, tH = _listWrapOn(T, availWidth, self.canv) tSB = T[0].getSpaceBefore() I2W[I] = T,tW,tH,tSB else: T,tW,...
5,287
def split(self, availWidth, availHeight): canv = self.canv C = self._content x = i = H = pS = 0 n = len(C) I2W = {} for x in xrange(n): c = C[x] I = c._ptoinfo if I not in I2W.keys(): T = I.trailer Hdr = I.header tW, tH = _listWrapOn(T, availWidth, self.canv) tSB = T[0].getSpaceBefore() I2W[I] = T,tW,tH,tSB else: T,tW,...
def split(self, availWidth, availHeight): canv = self.canv C = self._content x = i = H = pS = 0 n = len(C) I2W = {} for x in xrange(n): c = C[x] I = c._ptoinfo if I not in I2W.keys(): T = I.trailer Hdr = I.header tW, tH = _listWrapOn(T, availWidth, self.canv) tSB = T[0].getSpaceBefore() I2W[I] = T,tW,tH,tSB else: T,tW,...
5,288
def split(self, availWidth, availHeight): canv = self.canv C = self._content x = i = H = pS = 0 n = len(C) I2W = {} for x in xrange(n): c = C[x] I = c._ptoinfo if I not in I2W.keys(): T = I.trailer Hdr = I.header tW, tH = _listWrapOn(T, availWidth, self.canv) tSB = T[0].getSpaceBefore() I2W[I] = T,tW,tH,tSB else: T,tW,...
def split(self, availWidth, availHeight): canv = self.canv C = self._content x = i = H = pS = 0 n = len(C) I2W = {} for x in xrange(n): c = C[x] I = c._ptoinfo if I not in I2W.keys(): T = I.trailer Hdr = I.header tW, tH = _listWrapOn(T, availWidth, self.canv) tSB = T[0].getSpaceBefore() I2W[I] = T,tW,tH,tSB else: T,tW,...
5,289
def split(self, availWidth, availHeight): canv = self.canv C = self._content x = i = H = pS = 0 n = len(C) I2W = {} for x in xrange(n): c = C[x] I = c._ptoinfo if I not in I2W.keys(): T = I.trailer Hdr = I.header tW, tH = _listWrapOn(T, availWidth, self.canv) tSB = T[0].getSpaceBefore() I2W[I] = T,tW,tH,tSB else: T,tW,...
def split(self, availWidth, availHeight): canv = self.canv C = self._content x = i = H = pS = 0 n = len(C) I2W = {} for x in xrange(n): c = C[x] I = c._ptoinfo if I not in I2W.keys(): T = I.trailer Hdr = I.header tW, tH = _listWrapOn(T, availWidth, self.canv) tSB = T[0].getSpaceBefore() I2W[I] = T,tW,tH,tSB else: T,tW,...
5,290
def split(self, availWidth, availHeight): canv = self.canv C = self._content x = i = H = pS = 0 n = len(C) I2W = {} for x in xrange(n): c = C[x] I = c._ptoinfo if I not in I2W.keys(): T = I.trailer Hdr = I.header tW, tH = _listWrapOn(T, availWidth, self.canv) tSB = T[0].getSpaceBefore() I2W[I] = T,tW,tH,tSB else: T,tW,...
def split(self, availWidth, availHeight): canv = self.canv C = self._content x = i = H = pS = 0 n = len(C) I2W = {} for x in xrange(n): c = C[x] I = c._ptoinfo if I not in I2W.keys(): T = I.trailer Hdr = I.header tW, tH = _listWrapOn(T, availWidth, self.canv) tSB = T[0].getSpaceBefore() I2W[I] = T,tW,tH,tSB else: T,tW,...
5,291
def asString(self, format, verbose=None): """Converts to an 8 bit string in given format.""" assert format in ['pdf','ps','eps','gif','png','jpg','jpeg','bmp','ppm','tiff','tif','py','pict','pct'], 'Unknown file format "%s"' % format from reportlab import rl_config #verbose = verbose is not None and (verbose,) or (geta...
def asString(self, format, verbose=None, preview=0): """Converts to an 8 bit string in given format.""" assert format in ['pdf','ps','eps','gif','png','jpg','jpeg','bmp','ppm','tiff','tif','py','pict','pct'], 'Unknown file format "%s"' % format from reportlab import rl_config #verbose = verbose is not None and (verbose...
5,292
def asString(self, format, verbose=None): """Converts to an 8 bit string in given format.""" assert format in ['pdf','ps','eps','gif','png','jpg','jpeg','bmp','ppm','tiff','tif','py','pict','pct'], 'Unknown file format "%s"' % format from reportlab import rl_config #verbose = verbose is not None and (verbose,) or (geta...
def asString(self, format, verbose=None): """Converts to an 8 bit string in given format.""" assert format in ['pdf','ps','eps','gif','png','jpg','jpeg','bmp','ppm','tiff','tif','py','pict','pct'], 'Unknown file format "%s"' % format from reportlab import rl_config #verbose = verbose is not None and (verbose,) or (geta...
5,293
def start_seq(self, attr): #if it has a template, use that; otherwise try for id; #otherwise take default sequence if attr.has_key('template'): templ = attr['template'] self.handle_data(templ % self.getSequencer()) return elif attr.has_key('id'): id = attr['id'] else: id = None output = self._seq.nextf(id) self.handle_...
def start_seq(self, attr): #if it has a template, use that; otherwise try for id; #otherwise take default sequence if attr.has_key('template'): templ = attr['template'] self.handle_data(templ % self._seq) return elif attr.has_key('id'): id = attr['id'] else: id = None output = self._seq.nextf(id) self.handle_data(outpu...
5,294
def __init__(self,verbose=0): # the sequencing stuff presumes access to a sequencer. # this may be set with setSequencer(); if a <seq> tag # is encountered and it has not been set, a default # sequencer will be provided. self._seq = None if _xmllib_newStyle: xmllib.XMLParser.__init__(self,verbose=verbose) else: xmllib...
def __init__(self,verbose=0): # the sequencing stuff presumes access to a sequencer. # this may be set with setSequencer(); if a <seq> tag # is encountered and it has not been set, a default # sequencer will be provided. self._seq = None if _xmllib_newStyle: xmllib.XMLParser.__init__(self,verbose=verbose) else: xmllib...
5,295
def parse(self, text, style): """Given a formatted string will return a list of ParaFrag objects with their calculated widths. If errors occur None will be returned and the self.errors holds a list of the error messages. """
def parse(self, text, style): """Given a formatted string will return a list of ParaFrag objects with their calculated widths. If errors occur None will be returned and the self.errors holds a list of the error messages. """
5,296
def _setOpt(name, value, conv=None): '''set a module level value from environ/default''' from os import environ ename = 'RL_'+name if environ.has_key(ename): value = environ[ename] if conv: value = conv(value) globals()[name] = value
def _setOpt(name, value, conv=None): '''set a module level value from environ/default''' from os import environ ename = 'RL_'+name if environ.has_key(ename): value = environ[ename] if conv: value = conv(value) globals()[name] = value
5,297
def addStar(x,y,size,angle,g=g,w=s/20,x0=x,y0=y+s/2): s = Star() s.fillColor=colors.yellow s.angle = angle s.size = size*w s.x = x*w+x0 s.y = y*w+y0 g.add(s)
def addStar(x,y,size,angle,g=g,w=s/20,x0=x,y0=y+s/2): s = Star() s.fillColor=colors.yellow s.angle = angle s.size = size*w*2 s.x = x*w+x0 s.y = y*w+y0 g.add(s)
5,298
def addStar(x,y,size,angle,g=g,w=s/20,x0=x,y0=y+s/2): s = Star() s.fillColor=colors.yellow s.angle = angle s.size = size*w s.x = x*w+x0 s.y = y*w+y0 g.add(s)
def addStar(x,y,size,angle,g=g,w=s/20,x0=x,y0=y+s/2): s = Star() s.fillColor=colors.yellow s.angle = angle s.size = size*w s.x = x*w+x0 s.y = y*w+y0 g.add(s)
5,299