Ejemplo n.º 1
0
 def test_04(self):
     ct = jonga.CallTracer(grpflt=r'^[^\.]*')
     fd, pth = tempfile.mkstemp(suffix='.svg')
     os.close(fd)
     with jonga.ContextCallTracer(ct, pth, rmsz=True):
         rec = re.compile(r'^[^\.]*.[^\.]*')
     assert os.path.getsize(pth) > 0
     os.remove(pth)
Ejemplo n.º 2
0
 def test_02(self):
     with jonga.ContextCallTracer(
         jonga.CallTracer(grpflt=r'^[^\.]*')) as cct:
         rec = re.compile(r'^[^\.]*.[^\.]*')
     ct = cct.calltracer()
     assert str(ct) != ''
     ct.reset()
     assert str(ct) == ''
Ejemplo n.º 3
0
#!/usr/bin/env python

import re
import jonga

if __name__ == "__main__":

    # Construct call tracer object with groups defined by the first
    # part (i.e. before the first '.') of the fully qualified name of
    # the function
    ct = jonga.CallTracer(grpflt=r'^[^\.]*')

    # Define graph construction option variables
    size = '14,12'
    fntsz = 9
    fntfm = 'Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans'

    # Use context manager wrapper of call tracer to trace regex compile
    # function and write a corresponding call graph image.
    with jonga.ContextCallTracer(ct,
                                 'example4.svg',
                                 size=size,
                                 fntsz=fntsz,
                                 fntfm=fntfm):
        rc = re.compile(r'^[^\.]*.[^\.]*')