Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > dd931c7df1eb838d0d7c52fb37df3c9f > files > 340

python-pychart-1.39-5mdv2010.0.noarch.rpm

import glob
import os.path

def list_sources(dir):
    """Return the list of Python source files under demos/ directory.
    Parameter "dir" specifies the locatino of the demos/ directory."""
    
    l = glob.glob(dir + "/*.py")
    r = []
    for path in l:
        basename = os.path.basename(path)
        if basename in ("tocslib.py", "twographs.py", "chartdemo.py",
                        "list_sources.py"):
            continue
        if basename.startswith(",,"):
            # tla/baz temp file.
            continue
        r.append(basename)
    r.sort()        
    return r

if __name__ == '__main__':
    # When invoked from the cmdline, just print the list of files to
    # the stdout.
    r = list_sources(".")
    print " ".join(r)