rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
h2= Text(self.buffer,font="Serif",font_size=14) | h2= Text(self.buffer,font="FreeSerif",font_size=14) h2.color = StandardColors.Blue | def end_h2(self): self.h2=False if self.buffer and self.buffer.strip()>"": h2= Text(self.buffer,font="Serif",font_size=14) self.pdf.add_text(h2) self.buffer = None |
para = Paragraph(text=self.buffer, font="Serif",font_size=10,) | para = Paragraph(text=self.buffer, font="FreeSerif",font_size=10,) | def end_p(self) : self.p=False para = Paragraph(text=self.buffer, font="Serif",font_size=10,) para.set_justify(True) if self.language: para.language = self.language else: para.language = None para.set_hyphenate(True) self.pdf.add_paragraph(para) self.buffer = None |
self.hiphenate = hyphenate | self.hyphenate = hyphenate | def set_hyphenate(self, hyphenate): self.hiphenate = hyphenate |
stderr = cStringIO.StringIO() stdout = cStringIO.StringIO() | stderr = StringIO.StringIO() stdout = StringIO.StringIO() | def buf_spawn(self, sh, escape, cmd, args, env): stderr = cStringIO.StringIO() stdout = cStringIO.StringIO() command_string = '' for i in args: if(len(command_string)): command_string += ' ' command_string += i try: retval = self.env['PSPAWN'](sh, escape, cmd, args, env, stdout, stderr) except OSError, x: if(x.errno !=... |
'/Ox' | '/Od' | def compile_flags(env): if platform.system() == 'Windows': env['CCFLAGS'].append([ '/EHsc', #exception support '/w', #disable warnings '/Ox' #max optimization ]) else: env['CCFLAGS'].append('-O0') #no optimization #env['CCFLAGS'].append('-O3') #all optimization |
'boost_system', 'boost_filesystem', 'boost_regex', 'boost_thread' | boost.library('boost_system'), boost.library('boost_filesystem'), boost.library('boost_regex'), boost.library('boost_thread') | def setup(env): environment.define_keys(env) #cache dir for object reuse env.CacheDir('.cache') #enable parallel building parallel_build.setup(env) #include path env['CPPPATH'].append('#include') system_include_path(env) boost.include_path(env) #library path env['LIBPATH'].append('#lib') system_library_path(env) bo... |
env.CacheDir('.cache') | def setup(env): environment.define_keys(env) #cache dir for object reuse env.CacheDir('.cache') #enable parallel building parallel_build.setup(env) #include path env['CPPPATH'].append('#include') system_include_path(env) boost.include_path(env) #library path env['LIBPATH'].append('#lib') system_library_path(env) bo... | |
env['CCFLAGS'].append('/Ox') else: env['CCFLAGS'].append('-O3') | def compile_flags(env): if platform.system() == 'Windows': env['CCFLAGS'].append('/EHsc') #exception support env['CCFLAGS'].append('/w') #disable warnings env['CCFLAGS'].append('/Ox') #max optimization else: env['CCFLAGS'].append('-O3') #max optimization | |
wmr = WorkflowModelRelation.objects.get(content_type=ctype_or_obj) | wmr = WorkflowModelRelation.objects.get(content_type=ctype) | def remove_workflow_from_model(ctype): """Removes the workflow from passed content type. After this function has been called the content type has no workflow anymore (the instances might have own ones). ctype The content type from which the passed workflow should be removed. Must be a ContentType instance. """ try: wm... |
app_variable_provider = config.get('variable_provider', None) | app_variable_provider = config.get('tgext_menu_sub_variable_provider', None) | def menu_variable_provider(): menu_vars = Bunch ( url_from_menu = url_from_menu, render_menu = render_menu, render_navbar = render_navbar, render_sidebar = render_sidebar, ) try: from genshi import HTML menu_vars['HTML'] = HTML except ImportError: pass if app_variable_provider: menu_vars.update(app_variable_provider(... |
if os.path.isdir(FT_INC_DIR[0]): | if isdir(FT_INC_DIR[0]): | def libart_version(): K = ('LIBART_MAJOR_VERSION','LIBART_MINOR_VERSION','LIBART_MICRO_VERSION') D = {} for l in open(pjoin(LIBART_DIR,'configure.in'),'r').readlines(): l = l.strip().split('=') if len(l)>1 and l[0].strip() in K: D[l[0].strip()] = l[1].strip() if len(D)==3: break return (sys.platform == 'win32' and '\\"... |
class _isNormalDate(Validator): def normalize(self, x): return ND(x) def test(self, x): try: self.normalize(x) return True except Exception, e: return False | def normalize(self,x): if x in (0,1): return x try: S = string.upper(x) except: raise ValueError, 'Must be boolean' if S in ('YES','TRUE'): return True if S in ('NO','FALSE',None): return False raise ValueError, 'Must be boolean' | |
return self.normalizeTest(x) | return x is not None and self.normalizeTest(x) | def test(self,x): if isinstance(x,NormalDate): return True return self.normalizeTest(x) |
style=dict() style['fontName']='Times-Roman' style['fontSize'] = 12 style['textColor'] = black style['bulletFontName'] = black style['bulletFontName']='Times-Roman' style['bulletFontSize']=12 style['bulletOffsetY']=3 self.style = ParagraphStyle(name='normal', parent=None, **style) | style=ParaFrag() style.fontName ='Times-Roman' style.fontSize = 12 style.textColor = black style.bulletFontName = black style.bulletFontName = 'Times-Roman' style.bulletFontSize = 12 style.bulletOffsetY = 3 style.textTransform = None self.style = style | def setUp(self): style=dict() #ParaFrag() style['fontName']='Times-Roman' style['fontSize'] = 12 style['textColor'] = black style['bulletFontName'] = black style['bulletFontName']='Times-Roman' style['bulletFontSize']=12 style['bulletOffsetY']=3 self.style = ParagraphStyle(name='normal', parent=None, **style) |
txt = "1 & 2" | txt = "1 & 2" | def testNakedAmpersands(self): txt = "1 & 2" parser = ParaParser() parser.caseSensitive = True style, frags, bulletTextFrags = ParaParser().parse(txt, self.style)[1] #print 'parsed OK, frags=', frags from reportlab.platypus.paragraph import Paragraph p = Paragraph(txt, self.style) |
style, frags, bulletTextFrags = ParaParser().parse(txt, self.style)[1] | frags = ParaParser().parse(txt, self.style)[1] | def testNakedAmpersands(self): txt = "1 & 2" parser = ParaParser() parser.caseSensitive = True style, frags, bulletTextFrags = ParaParser().parse(txt, self.style)[1] #print 'parsed OK, frags=', frags from reportlab.platypus.paragraph import Paragraph p = Paragraph(txt, self.style) |
except ImportError: | except AttributeError: | def _isPILImage(im): try: return isinstance(im,Image.Image) except ImportError: return 0 |
raise RuntimeError('Imaging Library not available, unable to import bitmaps only jpegs') | annotateException('\nImaging Library not available, unable to import bitmaps only jpegs\nfileName=%r identity=%s'%(fileName,self.identity())) | def __init__(self, fileName,ident=None): if isinstance(fileName,ImageReader): self.__dict__ = fileName.__dict__ #borgize return self._ident = ident #start wih lots of null private fields, to be populated by #the relevant engine. self.fileName = fileName self._image = None self._width = None self._height = None self._... |
try: 1/0 except: frame = sys.exc_traceback.tb_frame while frame.f_globals["__name__"] == __name__: frame = frame.f_back | frame = sys._getframe(1) | def magicformat(format): """Evaluate and substitute the appropriate parts of the string.""" try: 1/0 except: frame = sys.exc_traceback.tb_frame while frame.f_globals["__name__"] == __name__: frame = frame.f_back return dictformat(format,frame.f_locals, frame.f_globals) |
print magicformat(''' | print(magicformat(''' | def df(n,dp=2,ds='.',ts=','): try: _df = _DF[dp,ds] except KeyError: _df = _DF[dp,ds] = DecimalFormatter(places=dp,decimalSep=ds,thousandSep=ts) return _df(n) |
''') | ''')) def func0(aa=1): def func1(bb=2): print(magicformat('bb=%(bb)s Z=%(Z)r')) func1('BB') func0('AA') | def df(n,dp=2,ds='.',ts=','): try: _df = _DF[dp,ds] except KeyError: _df = _DF[dp,ds] = DecimalFormatter(places=dp,decimalSep=ds,thousandSep=ts) return _df(n) |
RBL = _textBoxLimits(string.split(formatter(xVals[0]),'\n'),fontName, | RBL = _textBoxLimits(formatter(xVals[0]).split('\n'),fontName, | def formatter(tick): return self._dateFormatter(self,tick) |
def __str__(self): n = _color2name(self) return n and ('%r ie %s' % (self,n)) or repr(self) | def __repr__(self): return "Color(%s)" % fp_str(*(self.red, self.green, self.blue,self.alpha)).replace(' ',',') | |
def _color2name(c,D={}): if not D: for n,v in getAllNamedColors().iteritems(): D[(v.red,v.green,v.blue)] = n t = c.red,c.green,c.blue return t in D and D[t] or None | def _lookupName(self,D={}): if not D: for n,v in getAllNamedColors().iteritems(): if not isinstance(v,CMYKColor): t = v.red,v.green,v.blue if t in D: n = n+'/'+D[t] D[t] = n t = self.red,self.green,self.blue return t in D and D[t] or None | def _color2name(c,D={}): if not D: for n,v in getAllNamedColors().iteritems(): D[(v.red,v.green,v.blue)] = n t = c.red,c.green,c.blue return t in D and D[t] or None |
raise ValueError('Non separating color %s' % c) | _enforceError('separating',c,tc) | def _enforceSEP(c): '''pure separating colors only, this makes black a problem''' tc = toColor(c) if not isinstance(tc,CMYKColorSep): raise ValueError('Non separating color %s' % c) return tc |
raise ValueError('Non separating color %s' % c) | _enforceError('separating or black',c,tc) | def _enforceSEP_BLACK(c): '''separating + blacks only''' tc = toColor(c) if not isinstance(tc,CMYKColorSep): if isinstance(tc,Color) and tc.red==tc.blue==tc.green: #ahahahah it's a grey tc = _CMYK_black.clone(density=1-tc.red) elif not (isinstance(tc,CMYKColor) and tc.cyan==tc.magenta==tc.yellow==0): #ie some shade of ... |
raise ValueError('Non separating color %s' % c) | _enforceError('separating or CMYK',c,tc) | def _enforceSEP_CMYK(c): '''separating or cmyk only''' tc = toColor(c) if not isinstance(tc,CMYKColorSep): if isinstance(tc,Color) and tc.red==tc.blue==tc.green: #ahahahah it's a grey tc = _CMYK_black.clone(density=1-tc.red) elif not isinstance(tc,CMYKColor): raise ValueError('Non separating color %s' % c) return tc |
raise ValueError('Non CMYK color %s' % c) | _enforceError('CMYK',c,tc) | def _enforceCMYK(c): '''cmyk outputs only (rgb greys converted)''' tc = toColor(c) if not isinstance(tc,CMYKColor): if isinstance(tc,Color) and tc.red==tc.blue==tc.green: #ahahahah it's a grey tc = _CMYK_black.clone(black=1-tc.red,alpha=tc.alpha) else: raise ValueError('Non CMYK color %s' % c) elif isinstance(tc,CMYKCo... |
if not isinstance(tc,Color): if isinstance(tc,CMYKColor) and tc.cyan==tc.magenta==tc.yellow==0: tc = black.clone(alpha=tc.alpha) tc.red = tc.green = tc.blue = 1-tc.black*tc.density else: raise ValueError('Non RGB color %s' % c) | if isinstance(tc,CMYKColor): if tc.cyan==tc.magenta==tc.yellow==0: v = 1-tc.black*tc.density tc = Color(v,v,v,alpha=tc.alpha) else: _enforceError('RGB',c,tc) | def _enforceRGB(c): tc = toColor(c) if not isinstance(tc,Color): if isinstance(tc,CMYKColor) and tc.cyan==tc.magenta==tc.yellow==0: #ahahahah it's grey tc = black.clone(alpha=tc.alpha) tc.red = tc.green = tc.blue = 1-tc.black*tc.density else: raise ValueError('Non RGB color %s' % c) return tc |
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 (sys.pla... | 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 (sys.pla... | |
FT_LIB='C:/Devel/freetype-2.1.5/objs/freetype214.lib' FT_INCLUDE=None def check_ft_lib(ft_lib=FT_LIB): | INFOLINES=[] def infoline(t): print t INFOLINES.append(t) def check_ft_lib(ft_lib): | def pfxJoin(pfx,*N): R=[] for n in N: R.append(os.path.join(pfx,n)) return R |
pJoin=os.path.join | pjoin=os.path.join | def main(): cwd = os.getcwd() os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) MACROS=[('ROBIN_DEBUG',None)] MACROS=[] from glob import glob from distutils.core import setup, Extension pJoin=os.path.join LIBART_VERSION = libart_version() SOURCES=['_renderPM.c'] DEVEL_DIR=os.curdir LIBART_DIR=pJoin(DEVEL_DIR,'li... |
SOURCES=['_renderPM.c'] DEVEL_DIR=os.curdir LIBART_DIR=pJoin(DEVEL_DIR,'libart_lgpl') LIBART_SRCS=glob(pJoin(LIBART_DIR, 'art_*.c')) GT1_DIR=pJoin(DEVEL_DIR,'gt1') platform = sys.platform LIBS = [] | SOURCES=[pjoin(RENDERPM,'_renderPM.c'), pjoin(LIBART_DIR,'art_vpath_bpath.c'), pjoin(LIBART_DIR,'art_rgb_pixbuf_affine.c'), pjoin(LIBART_DIR,'art_rgb_svp.c'), pjoin(LIBART_DIR,'art_svp.c'), pjoin(LIBART_DIR,'art_svp_vpath.c'), pjoin(LIBART_DIR,'art_svp_vpath_stroke.c'), pjoin(LIBART_DIR,'art_svp_ops.c'), pjoin(LIBART_D... | def main(): cwd = os.getcwd() os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) MACROS=[('ROBIN_DEBUG',None)] MACROS=[] from glob import glob from distutils.core import setup, Extension pJoin=os.path.join LIBART_VERSION = libart_version() SOURCES=['_renderPM.c'] DEVEL_DIR=os.curdir LIBART_DIR=pJoin(DEVEL_DIR,'li... |
if os.path.isdir('/usr/local/include/freetype2'): FT_LIB = ['freetype'] FT_LIB_DIR = ['/usr/local/lib'] FT_MACROS = [('RENDERPM_FT',None)] FT_INC_DIR = ['/usr/local/include','/usr/local/include/freetype2'] | if platform=='win32': FT_LIB=os.environ.get('FREETYPE_LIB','') if not FT_LIB: FT_LIB=config('FREETYPE','lib','') if FT_LIB and not os.path.isfile(FT_LIB): infoline(' FT_LIB=[] if FT_LIB: FT_INC_DIR=os.environ.get('FREETYPE_INC','') if not FT_INC_DIR: FT_INC_DIR=config('FREETYPE','incdir') FT_MACROS = [('RENDERPM_FT',No... | def main(): cwd = os.getcwd() os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) MACROS=[('ROBIN_DEBUG',None)] MACROS=[] from glob import glob from distutils.core import setup, Extension pJoin=os.path.join LIBART_VERSION = libart_version() SOURCES=['_renderPM.c'] DEVEL_DIR=os.curdir LIBART_DIR=pJoin(DEVEL_DIR,'li... |
ft_lib = check_ft_lib() if ft_lib: FT_LIB = [os.path.splitext(os.path.basename(ft_lib))[0]] FT_LIB_DIR = [os.path.dirname(ft_lib)] | FT_LIB_DIR=config('FREETYPE','libdir') FT_INC_DIR=config('FREETYPE','incdir') I,L=inc_lib_dirs() ftv = None for d in I: if isfile(pjoin(d, "ft2build.h")): ftv = 21 FT_INC_DIR=[d,pjoin(d, "freetype2")] break d = pjoin(d, "freetype2") if isfile(pjoin(d, "ft2build.h")): ftv = 21 FT_INC_DIR=[d] break if isdir(pjoin(d, "fre... | def main(): cwd = os.getcwd() os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) MACROS=[('ROBIN_DEBUG',None)] MACROS=[] from glob import glob from distutils.core import setup, Extension pJoin=os.path.join LIBART_VERSION = libart_version() SOURCES=['_renderPM.c'] DEVEL_DIR=os.curdir LIBART_DIR=pJoin(DEVEL_DIR,'li... |
FT_INC_DIR = [FT_INCLUDE or os.path.join(os.path.dirname(os.path.dirname(ft_lib)),'include')] | infoline(' | def main(): cwd = os.getcwd() os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) MACROS=[('ROBIN_DEBUG',None)] MACROS=[] from glob import glob from distutils.core import setup, Extension pJoin=os.path.join LIBART_VERSION = libart_version() SOURCES=['_renderPM.c'] DEVEL_DIR=os.curdir LIBART_DIR=pJoin(DEVEL_DIR,'li... |
FT_LIB = [] FT_LIB_DIR = [] FT_MACROS = [] FT_INC_DIR = [] | FT_LIB=FT_LIB_DIR=FT_INC_DIR=FT_MACROS=[] if not FT_LIB: infoline(' infoline(' infoline(' infoline(' infoline(' | def main(): cwd = os.getcwd() os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) MACROS=[('ROBIN_DEBUG',None)] MACROS=[] from glob import glob from distutils.core import setup, Extension pJoin=os.path.join LIBART_VERSION = libart_version() SOURCES=['_renderPM.c'] DEVEL_DIR=os.curdir LIBART_DIR=pJoin(DEVEL_DIR,'li... |
libraries=[('_renderPM_libart', { 'sources': LIBART_SRCS, 'include_dirs': [DEVEL_DIR,LIBART_DIR,], 'macros': [('LIBART_COMPILATION',None),]+BIGENDIAN('WORDS_BIGENDIAN')+MACROS, } ), ('_renderPM_gt1', { 'sources': pfxJoin(GT1_DIR,'gt1-dict.c','gt1-namecontext.c','gt1-parset1.c','gt1-region.c','parseAFM.c'), 'include_di... | ext_modules = [ Extension( '_renderPM', | def main(): cwd = os.getcwd() os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) MACROS=[('ROBIN_DEBUG',None)] MACROS=[] from glob import glob from distutils.core import setup, Extension pJoin=os.path.join LIBART_VERSION = libart_version() SOURCES=['_renderPM.c'] DEVEL_DIR=os.curdir LIBART_DIR=pJoin(DEVEL_DIR,'li... |
include_dirs=[DEVEL_DIR,LIBART_DIR,GT1_DIR]+FT_INC_DIR, | include_dirs=[RENDERPM,LIBART_DIR,GT1_DIR]+FT_INC_DIR, | def main(): cwd = os.getcwd() os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) MACROS=[('ROBIN_DEBUG',None)] MACROS=[] from glob import glob from distutils.core import setup, Extension pJoin=os.path.join LIBART_VERSION = libart_version() SOURCES=['_renderPM.c'] DEVEL_DIR=os.curdir LIBART_DIR=pJoin(DEVEL_DIR,'li... |
libraries=LIBS+FT_LIB, | libraries=FT_LIB, | def main(): cwd = os.getcwd() os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) MACROS=[('ROBIN_DEBUG',None)] MACROS=[] from glob import glob from distutils.core import setup, Extension pJoin=os.path.join LIBART_VERSION = libart_version() SOURCES=['_renderPM.c'] DEVEL_DIR=os.curdir LIBART_DIR=pJoin(DEVEL_DIR,'li... |
if sys.hexversion<0x2030000 and sys.platform=='win32' and ('install' in sys.argv or 'install_ext' in sys.argv): def MovePYDs(*F): for x in sys.argv: if x[:18]=='--install-platlib=': return src = sys.exec_prefix dst = os.path.join(src,'DLLs') if sys.hexversion>=0x20200a0: src = os.path.join(src,'lib','site-packages') fo... | def main(): cwd = os.getcwd() os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) MACROS=[('ROBIN_DEBUG',None)] MACROS=[] from glob import glob from distutils.core import setup, Extension pJoin=os.path.join LIBART_VERSION = libart_version() SOURCES=['_renderPM.c'] DEVEL_DIR=os.curdir LIBART_DIR=pJoin(DEVEL_DIR,'li... | |
s = s + '\t\tDrawing.__init__(self,width,height)+args,**kw)\n' | s = s + '\t\tDrawing.__init__(self,width,height,*args,**kw)\n' | s = s + '\tdef __init__(self,width=%s,height=%s,*args,**kw):\n' % (self.width,self.height) |
FT_LIB=config('FREETYPE','lib',r'C:\devel\freetype-2.1.5\objs\freetype214.lib') | FT_LIB=config('FREETYPE','lib','') if FT_LIB and not os.path.isfile(FT_LIB): infoline(' FT_LIB=[] | def libart_version(): K = ('LIBART_MAJOR_VERSION','LIBART_MINOR_VERSION','LIBART_MICRO_VERSION') D = {} for l in open(pjoin(LIBART_DIR,'configure.in'),'r').readlines(): l = l.strip().split('=') if len(l)>1 and l[0].strip() in K: D[l[0].strip()] = l[1].strip() if len(D)==3: break return (sys.platform == 'win32' and '\\"... |
FT_LIB = [os.path.splitext(os.path.basename(FT_LIB))[0]] infoline(' | FT_LIB = [os.path.splitext(os.path.basename(FT_LIB))[0]] if os.path.isdir(FT_INC_DIR[0]): infoline(' else: infoline(' FT_LIB=FT_LIB_DIR=FT_INC_DIR=FT_MACROS=[] | def libart_version(): K = ('LIBART_MAJOR_VERSION','LIBART_MINOR_VERSION','LIBART_MICRO_VERSION') D = {} for l in open(pjoin(LIBART_DIR,'configure.in'),'r').readlines(): l = l.strip().split('=') if len(l)>1 and l[0].strip() in K: D[l[0].strip()] = l[1].strip() if len(D)==3: break return (sys.platform == 'win32' and '\\"... |
infoline(' infoline(' infoline(' infoline(' | def libart_version(): K = ('LIBART_MAJOR_VERSION','LIBART_MINOR_VERSION','LIBART_MICRO_VERSION') D = {} for l in open(pjoin(LIBART_DIR,'configure.in'),'r').readlines(): l = l.strip().split('=') if len(l)>1 and l[0].strip() in K: D[l[0].strip()] = l[1].strip() if len(D)==3: break return (sys.platform == 'win32' and '\\"... | |
c = c0.cyan+x*(c1.cyan - c0.cyan)/dx m = c0.magenta+x*(c1.magenta - c0.magenta)/dx y = c0.yellow+x*(c1.yellow - c0.yellow)/dx k = c0.black+x*(c1.black - c0.black)/dx d = c0.density+x*(c1.density - c0.density)/dx a = c0.alpha+x*(c1.alpha - c0.alpha)/dx return CMYKColor(c,m,y,k, density=d, alpha=a) | if cmykDistance(c0,c1)<1e-8: assert c0.spotName == c1.spotName, "Identical cmyk, but different spotName" c = c0.cyan m = c0.magenta y = c0.yellow k = c0.black d = c0.density+x*(c1.density - c0.density)/dx a = c0.alpha+x*(c1.alpha - c0.alpha)/dx return CMYKColor(c,m,y,k, density=d, spotName=c0.spotName, alpha=a) elif c... | 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 interpol... |
spotName=c0.spotName, alpha=c0.alpha) | spotName=c0.spotName, alpha=100*a) | 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 interpol... |
spotName=c1.spotName, alpha=c1.alpha) | spotName=c1.spotName, alpha=a*100) | 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 interpol... |
spotName=c0.spotName, alpha=c0.alpha) | spotName=c0.spotName, alpha=a*100) | 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 interpol... |
return PCMYKColor(c*100,m*100,y*100,k*100, density=d*100, alpha=a) | return PCMYKColor(c*100,m*100,y*100,k*100, density=d*100, alpha=a*100) | 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 interpol... |
chars = string.digits + '-' | chars = '0123456789-' | def decompose(self): dval = ''.join([self.patterns[c]+'i' for c in self.encoded]) self.decomposed = dval[:-1] return self.decomposed |
for i in range(0, len(s)): | for i in xrange(0, len(s)): | def validate(self): vval = "" self.valid = 1 s = string.strip(self.value) for i in range(0, len(s)): c = s[i] if c not in self.chars: self.Valid = 0 continue vval = vval + c |
if self.checksum == -1: if len(s) <= 10: self.checksum = 1 else: self.checksum = 2 if self.checksum > 0: i = 0; v = 1; c = 0 while i < len(s): c = c + v * string.index(self.chars, s[-(i+1)]) i = i + 1; v = v + 1 if v > 10: v = 1 s = s + self.chars[c % 11] if self.checksum > 1: i = 0; v = 1; c = 0 while i < len(s): ... | tcs = self.checksum if tcs<0: self.checksum = tcs = 1+int(len(s)>10) if tcs > 0: s = self._addCSD(s,11) if tcs > 1: s = self._addCSD(s,10) | def encode(self): s = self.validated |
dval = [self.patterns[c]+'i' for c in self.encoded] self.decomposed = ''.join(dval[:-1]) | self.decomposed = ''.join([(self.patterns[c]+'i') for c in self.encoded])[:-1] | def decompose(self): dval = [self.patterns[c]+'i' for c in self.encoded] self.decomposed = ''.join(dval[:-1]) return self.decomposed |
if hasattr(w,'normalizedWidth'): | if hasattr(w,'normalizedValue'): | def cjkFragSplit(frags, maxWidths, calcBounds, encoding='utf8'): '''This attempts to be wordSplit for frags using the dumb algorithm''' from reportlab.rl_config import _FUZZ U = [] #get a list of single glyphs with their widths etc etc for f in frags: text = f.text if not isinstance(text,unicode): text = text.decode(e... |
w = w.normalizedWidth(w) | w = w.normalizedValue(None) | def cjkFragSplit(frags, maxWidths, calcBounds, encoding='utf8'): '''This attempts to be wordSplit for frags using the dumb algorithm''' from reportlab.rl_config import _FUZZ U = [] #get a list of single glyphs with their widths etc etc for f in frags: text = f.text if not isinstance(text,unicode): text = text.decode(e... |
style=ParaFrag() style.fontName='Times-Roman' style.fontSize = 12 style.textColor = black style.bulletFontName = black style.bulletFontName='Times-Roman' style.bulletFontSize=12 style.bulletOffsetY=3 self.style = style | style=dict() style['fontName']='Times-Roman' style['fontSize'] = 12 style['textColor'] = black style['bulletFontName'] = black style['bulletFontName']='Times-Roman' style['bulletFontSize']=12 style['bulletOffsetY']=3 self.style = ParagraphStyle(name='normal', parent=None, **style) | def setUp(self): style=ParaFrag() style.fontName='Times-Roman' style.fontSize = 12 style.textColor = black style.bulletFontName = black style.bulletFontName='Times-Roman' style.bulletFontSize=12 style.bulletOffsetY=3 self.style = style |
M[x] = max(M.get(x,v),v) | M[x] = M.get(x,0)+v | def spanFixDim(V0,V,spanCons,FUZZ=rl_config._FUZZ): #assign required space to variable rows equally to existing calculated values M = {} for (x0,x1),v in spanCons.iteritems(): t = sum([V[x]+M.get(x,0) for x in xrange(x0,x1+1)]) if t>=v-FUZZ: continue #already good enough X = [x for x in xrange(x0,x1+1) if V0[x] is... |
elif hasattr(labelFmt): | elif hasattr(labelFmt,'__call__'): | def _getLabelText(self, rowNo, colNo): '''return formatted label text''' labelFmt = self.barLabelFormat if labelFmt is None: labelText = None elif labelFmt == 'values': labelText = self.barLabelArray[rowNo][colNo] elif type(labelFmt) is str: labelText = labelFmt % self.data[rowNo][colNo] elif hasattr(labelFmt): labelTe... |
def _normalizeLineEnds(text,desired=LINEEND,unlikely='\000\001\002\003'): | def _normalizeLineEnds(text,desired=LINEEND,unlikely='\x00\x01\x02\x03'): | def _normalizeLineEnds(text,desired=LINEEND,unlikely='\000\001\002\003'): """Normalizes different line end character(s). Ensures all instances of CR, LF and CRLF end up as the specified one.""" return (text .replace('\015\012', unlikely) .replace('\015', unlikely) .replace(text, '\012', unlikely) .replace(text, unlik... |
.replace('\015\012', unlikely) .replace('\015', unlikely) .replace(text, '\012', unlikely) .replace(text, unlikely, desired)) | .replace('\r\n', unlikely) .replace('\r', unlikely) .replace('\n', unlikely) .replace(unlikely, desired)) | def _normalizeLineEnds(text,desired=LINEEND,unlikely='\000\001\002\003'): """Normalizes different line end character(s). Ensures all instances of CR, LF and CRLF end up as the specified one.""" return (text .replace('\015\012', unlikely) .replace('\015', unlikely) .replace(text, '\012', unlikely) .replace(text, unlik... |
doc1 = PDFDocument() doc2 = PDFDocument() font = TTFont("Vera", "Vera.ttf") self.assertEquals(font.splitString(u'hello ', doc1), [(0, 'hello ')]) self.assertEquals(font.splitString(u'hello ', doc2), [(0, 'hello ')]) self.assertEquals(font.splitString(u'\u0410\u0411'.encode('UTF-8'), doc1), [(0, '\x80\x81')]) self.asser... | ttfAsciiReadable = rl_config.ttfAsciiReadable try: rl_config.ttfAsciiReadable = 1 doc1 = PDFDocument() doc2 = PDFDocument() font = TTFont("Vera", "Vera.ttf") self.assertEquals(font.splitString(u'hello ', doc1), [(0, 'hello ')]) self.assertEquals(font.splitString(u'hello ', doc2), [(0, 'hello ')]) self.assertEquals(font... | def testParallelConstruction(self): "Test that TTFont can be used for different documents at the same time" doc1 = PDFDocument() doc2 = PDFDocument() font = TTFont("Vera", "Vera.ttf") self.assertEquals(font.splitString(u'hello ', doc1), [(0, 'hello ')]) self.assertEquals(font.splitString(u'hello ', doc2), [(0, 'hello '... |
doc = PDFDocument() font = TTFont("Vera", "Vera.ttf") font.splitString('a', doc) internalName = font.getSubsetInternalName(0, doc)[1:] font.addObjects(doc) pdfFont = doc.idToObject[internalName] self.assertEquals(doc.idToObject['BasicFonts'].dict[internalName], pdfFont) self.assertEquals(pdfFont.Name, internalName) sel... | ttfAsciiReadable = rl_config.ttfAsciiReadable try: rl_config.ttfAsciiReadable = 1 doc = PDFDocument() font = TTFont("Vera", "Vera.ttf") font.splitString('a', doc) internalName = font.getSubsetInternalName(0, doc)[1:] font.addObjects(doc) pdfFont = doc.idToObject[internalName] self.assertEquals(doc.idToObject['BasicFont... | def testAddObjects(self): "Test TTFont.addObjects" # Actually generate some subsets doc = PDFDocument() font = TTFont("Vera", "Vera.ttf") font.splitString('a', doc) # create some subset internalName = font.getSubsetInternalName(0, doc)[1:] font.addObjects(doc) pdfFont = doc.idToObject[internalName] self.asse... |
return int(min(255,max(0,255)))/255. | return int(min(255,max(0,c)))/255. | def rgbVal(self,v): v = v.strip() try: c=eval(v[:]) if not isinstance(c,int): raise ValueError return int(min(255,max(0,255)))/255. except: raise ValueError('bad argument value %r in css color %r' % (v,self.s)) |
R,G,B = map('%' in n[0] and self.pcVal or self.rgbVal,n) | R,G,B = map('%' in n[0] and self.rgbPcVal or self.rgbVal,n) | def __call__(self,s): s = s.strip() hsl = s.startswith('hsl') if not s.startswith('rgb') and not hsl: return None self.s = s rgba = s.startswith('rgba') or s.startswith('hsla') n = s[rgba and 4 or 3:].strip() if not n.startswith('(') or not n.endswith(')'): raise ValueError('improperly formatted css color %r' % s) n =... |
class Canvas(textobject._PDFColorSetter,CanvasStringDrawer): | class Canvas(textobject._PDFColorSetter): | def pushCopy(self): '''the states must be shared across push/pop, but the values not''' x = self.__class__() x._d = self._d.copy() x._c = self._c return x |
raise NormalDateException("unable to setNormalDate(%r)" % normalDate) | raise NormalDateException("unable to setNormalDate(%s)" % repr(normalDate)) | def setNormalDate(self, normalDate): """ accepts date as scalar string/integer (yyyymmdd) or tuple (year, month, day, ...)""" if isinstance(normalDate,int): self.normalDate = normalDate elif isinstance(normalDate,basestring): try: self.normalDate = int(normalDate) except: m = _iso_re.match(normalDate) if m: self.setNor... |
Color(1,1,1) | Color(1,1,1,1) | def HexColor(val, htmlOnly=False, alpha=False): """This function converts a hex string, or an actual integer number, into the corresponding color. E.g., in "#AABBCC" or 0xAABBCC, AA is the red, BB is the green, and CC is the blue (00-FF). An alpha value can also be given in the form #AABBCCDD or 0xAABBCCDD where DD i... |
ValueError: invalid literal for int(): ffffff | ValueError: invalid literal for int() with base 10: 'ffffff' | def HexColor(val, htmlOnly=False, alpha=False): """This function converts a hex string, or an actual integer number, into the corresponding color. E.g., in "#AABBCC" or 0xAABBCC, AA is the red, BB is the green, and CC is the blue (00-FF). An alpha value can also be given in the form #AABBCCDD or 0xAABBCCDD where DD i... |
from reportlab.pdfgen import canvas c = canvas.Canvas("hello.pdf") from reportlab.lib.units import inch c.translate(inch,inch) c.setFont("Helvetica", 80) c.setStrokeColorRGB(0.2,0.5,0.3) c.setFillColorRGB(1,0,1) c.rect(inch,inch,6*inch,9*inch, fill=1) c.rotate(90) c.setFillColorRGB(0,0,0.77) c.drawString(3*inch,... | Example:: from reportlab.pdfgen import canvas c = canvas.Canvas("hello.pdf") from reportlab.lib.units import inch c.translate(inch,inch) c.setFont("Helvetica", 80) c.setStrokeColorRGB(0.2,0.5,0.3) c.setFillColorRGB(1,0,1) c.rect(inch,inch,6*inch,9*inch, fill=1) c.rotate(90) c.setFillColorRGB(0,0,0.77) c.drawStr... | def pushCopy(self): '''the states must be shared across push/pop, but the values not''' x = self.__class__() x._d = self._d.copy() x._c = self._c return x |
if last: | if last or extraspace<=1e-8: | def _justifyDrawParaLine( tx, offset, extraspace, words, last=0): setXPos(tx,offset) text = join(words) if last: #last one, left align tx._textOut(text,1) else: nSpaces = len(words)-1 if nSpaces: tx.setWordSpace(extraspace / float(nSpaces)) tx._textOut(text,1) tx.setWordSpace(0) else: tx._textOut(text,1) setXPos(tx,-o... |
nSpaces = len(words)-1 | nSpaces = len(words)+sum([_nbspCount(w) for w in words])-1 | def _justifyDrawParaLine( tx, offset, extraspace, words, last=0): setXPos(tx,offset) text = join(words) if last: #last one, left align tx._textOut(text,1) else: nSpaces = len(words)-1 if nSpaces: tx.setWordSpace(extraspace / float(nSpaces)) tx._textOut(text,1) tx.setWordSpace(0) else: tx._textOut(text,1) setXPos(tx,-o... |
nSpaces += text.count(' ') | nSpaces += text.count(' ')+_nbspCount(text) | def _putFragLine(cur_x, tx, line): xs = tx.XtraState cur_y = xs.cur_y x0 = tx._x0 autoLeading = xs.autoLeading leading = xs.leading cur_x += xs.leftIndent dal = autoLeading in ('min','max') if dal: if autoLeading=='max': ascent = max(_56*leading,line.ascent) descent = max(_16*leading,-line.descent) else: ascent = line.... |
nSpaces = line.wordCount - 1 if last or not nSpaces or abs(extraSpace)<=1e-8 or line.lineBreak: _putFragLine(offset, tx, line) else: | simple = last or abs(extraSpace)<=1e-8 or line.lineBreak if not simple: nSpaces = line.wordCount+sum([_nbspCount(w.text) for w in line.words if not hasattr(w,'cbDefn')])-1 simple = not nSpaces if not simple: | def _justifyDrawParaLineX( tx, offset, line, last=0): setXPos(tx,offset) extraSpace = line.extraSpace nSpaces = line.wordCount - 1 if last or not nSpaces or abs(extraSpace)<=1e-8 or line.lineBreak: _putFragLine(offset, tx, line) #no space modification else: tx.setWordSpace(extraSpace / float(nSpaces)) _putFragLine(off... |
if S: for i,f in enumerate(S): flowables.insert(i,f) | if S: flowables[0:0] = S | def _addGeneratedContent(flowables,frame): S = getattr(frame,'_generated_content',None) if S: for i,f in enumerate(S): flowables.insert(i,f) del frame._generated_content |
if frame.add(S[0], canv, trySplit=0): self._curPageFlowableCount += 1 self.afterFlowable(S[0]) _addGeneratedContent(flowables,frame) else: | if not frame.add(S[0], canv, trySplit=0): | def handle_flowable(self,flowables): '''try to handle one flowable from the front of list flowables.''' |
del S[0] for i,f in enumerate(S): flowables.insert(i,f) | self._curPageFlowableCount += 1 self.afterFlowable(S[0]) flowables[0:0] = S[1:] _addGeneratedContent(flowables,frame) else: flowables[0:0] = S | def handle_flowable(self,flowables): '''try to handle one flowable from the front of list flowables.''' |
cMin = valueMin cMax = valueMax | def special(T,x,func,bubbleV=bubbleV,bubbleMax=bubbleMax): try: v = T[2] except IndexError: v = bubbleMAx*0.1 bubbleV *= (v/bubbleMax)**0.5 return func(T[x]+bubbleV,T[x]-bubbleV) | |
if abs(v)>fuzz and v>=u+fuzz: | if (abfiz[0] or abs(v)>fuzz) and v>=u+fuzz: | def special(T,x,func,bubbleV=bubbleV,bubbleMax=bubbleMax): try: v = T[2] except IndexError: v = bubbleMAx*0.1 bubbleV *= (v/bubbleMax)**0.5 return func(T[x]+bubbleV,T[x]-bubbleV) |
if abs(v)>fuzz and v<=u-fuzz: | if (abfiz[1] or abs(v)>fuzz) and v<=u-fuzz: | def special(T,x,func,bubbleV=bubbleV,bubbleMax=bubbleMax): try: v = T[2] except IndexError: v = bubbleMAx*0.1 bubbleV *= (v/bubbleMax)**0.5 return func(T[x]+bubbleV,T[x]-bubbleV) |
label = copy.copy(label) | label, olabel = label.__class__(),label label.__dict__.clear() label.__dict__.update(olabel.__dict__) | def makeTickLabels(self): g = Group() if not self.visibleLabels: return g |
if self.drawWidth<=aW+_FUZZ and self.drawHeight<=aH+_FUZZ: return factor = min(float(aW)/self.drawWidth,float(aH)/self.drawHeight) self.drawWidth *= factor self.drawHeight *= factor | if self.drawWidth>aW+_FUZZ or self.drawHeight>aH+_FUZZ: factor = min(float(aW)/self.drawWidth,float(aH)/self.drawHeight) self.drawWidth *= factor self.drawHeight *= factor return self.drawWidth, self.drawHeight | def _restrictSize(self,aW,aH): if self.drawWidth<=aW+_FUZZ and self.drawHeight<=aH+_FUZZ: return factor = min(float(aW)/self.drawWidth,float(aH)/self.drawHeight) self.drawWidth *= factor self.drawHeight *= factor |
return (self.drawWidth, self.drawHeight) | return self.drawWidth, self.drawHeight | def wrap(self, availWidth, availHeight): #the caller may decide it does not fit. return (self.drawWidth, self.drawHeight) |
wI, hI = I.wrap(availWidth,availHeight) I._restrictSize(availWidth,availHeight) | I.wrap(availWidth,availHeight) wI, hI = I._restrictSize(availWidth,availHeight) | def wrap(self,availWidth,availHeight): canv = self.canv if hasattr(self,'_wrapArgs'): if self._wrapArgs==(availWidth,availHeight): return self.width,self.height self._reset() self._wrapArgs = availWidth, availHeight I = self._I wI, hI = I.wrap(availWidth,availHeight) I._restrictSize(availWidth,availHeight) self._wI = w... |
page, level = [ int(x) for x in label.split(',') ] | label = label.split(',') page, level, key = int(label[0]), int(label[1]), eval(label[2],{}) | def drawTOCEntryEnd(canvas, kind, label): '''Callback to draw dots and page numbers after each entry.''' page, level = [ int(x) for x in label.split(',') ] style = self.getLevelStyle(level) if self.dotsMinLevel >= 0 and level >= self.dotsMinLevel: dot = ' . ' else: dot = '' drawPageNumbers(canvas, style, [(page, None)]... |
drawPageNumbers(canvas, style, [(page, None)], availWidth, availHeight, dot) | drawPageNumbers(canvas, style, [(page, key)], availWidth, availHeight, dot) | def drawTOCEntryEnd(canvas, kind, label): '''Callback to draw dots and page numbers after each entry.''' page, level = [ int(x) for x in label.split(',') ] style = self.getLevelStyle(level) if self.dotsMinLevel >= 0 and level >= self.dotsMinLevel: dot = ' . ' else: dot = '' drawPageNumbers(canvas, style, [(page, None)]... |
para = Paragraph('%s<onDraw name="drawTOCEntryEnd" label="%d,%d"/>' % (text, pageNum, level), style) | keyVal = repr(key).replace(',','\\x2c').replace('"','\\x2c') else: keyVal = None para = Paragraph('%s<onDraw name="drawTOCEntryEnd" label="%d,%d,%s"/>' % (text, pageNum, level, keyVal), style) | def drawTOCEntryEnd(canvas, kind, label): '''Callback to draw dots and page numbers after each entry.''' page, level = [ int(x) for x in label.split(',') ] style = self.getLevelStyle(level) if self.dotsMinLevel >= 0 and level >= self.dotsMinLevel: dot = ' . ' else: dot = '' drawPageNumbers(canvas, style, [(page, None)]... |
cachedname = os.path.splitext(filename)[0] + ('.a85' if rl_config.useA85 else '.bin') | cachedname = os.path.splitext(filename)[0] + (rl_config.useA85 and '.a85' or 'bin') | def cachedImageExists(filename): """Determines if a cached image already exists for a given file. Determines if a cached image exists which has the same name and equal or newer date to the given file.""" cachedname = os.path.splitext(filename)[0] + ('.a85' if rl_config.useA85 else '.bin') if os.path.isfile(cachedname)... |
_cKwds='cyan magenta yellow black density spotName knockout alpha'.split() | _cKwds='cyan magenta yellow black density alpha spotName knockout'.split() | def _density_str(self): return fp_str(self.density) |
(self.alpha is not None and (',alpha=%d' % (self.alpha*100)) or ''), | (self.alpha is not None and (',alpha=%s' % (fp_str(self.alpha*100))) or ''), | def __repr__(self): return "%s(%s%s%s%s%s)" % (self.__class__.__name__, fp_str(self.cyan*100, self.magenta*100, self.yellow*100, self.black*100).replace(' ',','), (self.spotName and (',spotName='+repr(self.spotName)) or ''), (self.density!=1 and (',density='+fp_str(self.density*100)) or ''), (self.knockout is not None ... |
S=K[:5] | S=K[:6] | def cKwds(self): K=self._cKwds S=K[:5] for k in self._cKwds: v=getattr(self,k) if k in S: v*=100 yield k,v |
_cKwds='cyan magenta yellow black density spotName alpha'.split() | _cKwds='cyan magenta yellow black density alpha spotName'.split() | def __init__(self, cyan=0, magenta=0, yellow=0, black=0, spotName=None, density=1,alpha=1): CMYKColor.__init__(self,cyan,magenta,yellow,black,spotName,density,knockout=None,alpha=alpha) |
_cKwds='cyan magenta yellow black density spotName alpha'.split() | _cKwds='cyan magenta yellow black density alpha spotName'.split() | def __init__(self, cyan=0, magenta=0, yellow=0, black=0, spotName=None, density=100, alpha=100): PCMYKColor.__init__(self,cyan,magenta,yellow,black,density,spotName,knockout=None,alpha=alpha) |
from reportlab.lib.validators import inherit D.add(String(10,50, 'Basic Shapes', fillColor=colors.black, fontName=inherit)) | D.add(String(10,50, 'Basic Shapes', fillColor=colors.black, fontName='Helvetica')) | def getDrawing06(): """This demonstrates all the basic shapes at once. There are no groups or references. Each solid shape should have a green fill. """ green = colors.green D = Drawing(400, 200) #, fillColor=green) D.add(Line(10,10, 390,190)) D.add(Circle(100,100,20, fillColor=green)) D.add(Circle(200,100,40, fil... |
print 'parsed OK, frags=', frags | def testNakedAmpersands(self): txt = "1 & 2" parser = ParaParser() parser.caseSensitive = True style, frags, bulletTextFrags = ParaParser().parse(txt, self.style)[1] print 'parsed OK, frags=', frags from reportlab.platypus.paragraph import Paragraph p = Paragraph(txt, self.style) #self.assertEquals(map(lambda x:x.t... | |
RBL = _textBoxLimits(formatter(xVals[0]).split('\n'),fontName, | RBL = _textBoxLimits(formatter(firstDate).split('\n'),fontName, | def formatter(tick): return self._dateFormatter(self,tick) |
if self.specifiedTickDates: VC = self._valueClass ticks = [VC(x) for x in self.specifiedTickDates] return ticks,[formatter(d) for d in ticks] | def addTick(i, xVals=xVals, formatter=formatter, ticks=ticks, labels=labels): ticks.insert(0,xVals[i]) labels.insert(0,formatter(xVals[i])) | |
firstDate = xVals[0] lastDate = xVals[-1] | def addTick(i, xVals=xVals, formatter=formatter, ticks=ticks, labels=labels): ticks.insert(0,xVals[i]) labels.insert(0,formatter(xVals[i])) | |
lastYear = lastDate.year() | lastYear = endDate.year() | def addTick(i, xVals=xVals, formatter=formatter, ticks=ticks, labels=labels): ticks.insert(0,xVals[i]) labels.insert(0,formatter(xVals[i])) |
if theDate >= firstDate and theDate <= lastDate: | if theDate >= firstDate and theDate <= endDate: | def addTick(i, xVals=xVals, formatter=formatter, ticks=ticks, labels=labels): ticks.insert(0,xVals[i]) labels.insert(0,formatter(xVals[i])) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.