Did I find the right examples for you? yes no

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
path directory path
resursion True will extract all sub module of mod

        def walk_dirs(path, include=None, include_ext=None, exclude=None, 
        exclude_ext=None, recursion=True, file_only=False):
    """
    path directory path
    resursion True will extract all sub module of mod
    """
    default_exclude = ['.svn', '_svn', '.git']
    default_exclude_ext = ['.pyc', '.pyo', '.bak', '.tmp']
    exclude = exclude or []
    exclude_ext = exclude_ext or []
    include_ext = include_ext or []
    include = include or []

    if not os.path.exists(path):
        raise StopIteration
    
    for r in os.listdir(path):
        if match(r, exclude) or r in default_exclude:
            continue
        if include and r not in include:
            continue
        fpath = os.path.join(path, r)
        if os.path.isdir(fpath):
            if not file_only:
                yield os.path.normpath(fpath).replace('\\', '/')
            if recursion:
                for f in walk_dirs(fpath, include, include_ext, exclude, 
                    exclude_ext, recursion, file_only):
                    yield os.path.normpath(f).replace('\\', '/')
        else:
            ext = os.path.splitext(fpath)[1]
            if ext in exclude_ext or ext in default_exclude_ext:
                continue
            if include_ext and ext not in include_ext:
                continue
            yield os.path.normpath(fpath).replace('\\', '/')
        


src/p/a/parm-1.3/parm/__init__.py   parm(Download)
    def handle(self, options, global_options, *args):
        from utils import extract_dirs, copy_dir, walk_dirs, import_attr
        from md_ext import new_code_comment, toc, include
        from functools import partial
        from shutil import copy2
            _exclude = []
        _exclude.extend([options.directory, conf.template_dirs])
        files = list(walk_dirs('.', exclude=_exclude))
        headers = {}
        relations = {}
    def handle(self, options, global_options, *args):
        from docutils.core import publish_file
        import glob
        import markdown_writer
        from utils import walk_dirs
 
        if not args:
            files = walk_dirs(source, include_ext=options.extension, file_only=True)
        else:
            files = args