src/reportlab/graphics/samples/runall.py
branchpy33
changeset 3794 398ea04239b5
parent 3721 0c93dd8ff567
child 4709 1dcf7b3f7127
equal deleted inserted replaced
3793:cc3f9cc828f7 3794:398ea04239b5
     1 # runs all the GUIedit charts in this directory -
     1 # runs all the GUIedit charts in this directory -
     2 # makes a PDF sample for eaxh existing chart type
     2 # makes a PDF sample for eaxh existing chart type
     3 import sys
     3 import sys
     4 import glob
     4 import glob
     5 import string
       
     6 import inspect
     5 import inspect
     7 import types
     6 import types
     8 
     7 
     9 def moduleClasses(mod):
     8 def moduleClasses(mod):
    10     def P(obj, m=mod.__name__, CT=type):
     9     def P(obj, m=mod.__name__, CT=type):
    16 
    15 
    17 def getclass(f):
    16 def getclass(f):
    18     return moduleClasses(__import__(f))
    17     return moduleClasses(__import__(f))
    19 
    18 
    20 def run(format, VERBOSE=0):
    19 def run(format, VERBOSE=0):
    21     formats = string.split(format, ',')
    20     formats = format.split( ',')
    22     for i in range(0, len(formats)):
    21     for i in range(0, len(formats)):
    23         formats[i] == string.lower(string.strip(formats[i]))
    22         formats[i] == formats[i].strip().lower()
    24     allfiles = glob.glob('*.py')
    23     allfiles = glob.glob('*.py')
    25     allfiles.sort()
    24     allfiles.sort()
    26     for fn in allfiles:
    25     for fn in allfiles:
    27         f = string.split(fn, '.')[0]
    26         f = fn.split('.')[0]
    28         c = getclass(f)
    27         c = getclass(f)
    29         if c != None:
    28         if c != None:
    30             print(c.__name__)
    29             print(c.__name__)
    31             try:
    30             try:
    32                 for fmt in formats:
    31                 for fmt in formats: