Did I find the right examples for you? yes no

All Samples(22)  |  Call(11)  |  Derive(0)  |  Import(11)
Yield all of the importable Python files in `dirname`, recursively.

To be importable, the files have to be in a directory with a __init__.py,
except for `dirname` itself, which isn't required to have one.  The
assumption is that `dirname` was specified directly, so the user knows
best, but subdirectories are checked for a __init__.py to be sure we only
find the importable files.

        def find_python_files(dirname):
    """Yield all of the importable Python files in `dirname`, recursively.

    To be importable, the files have to be in a directory with a __init__.py,
    except for `dirname` itself, which isn't required to have one.  The
    assumption is that `dirname` was specified directly, so the user knows
    best, but subdirectories are checked for a __init__.py to be sure we only
    find the importable files.

    """
    for i, (dirpath, dirnames, filenames) in enumerate(os.walk(dirname)):
        if i > 0 and '__init__.py' not in filenames:
            # If a directory doesn't have __init__.py, then it isn't
            # importable and neither are its files
            del dirnames[:]
            continue
        for filename in filenames:
            # We're only interested in files that look like reasonable Python
            # files: Must end with .py or .pyw, and must not have certain funny
            # characters that probably mean they are editor junk.
            if re.match(r"^[^.#~!$@%^&*()+=,]+\.pyw?$", filename):
                yield os.path.join(dirpath, filename)
        


src/m/i/microblog-HEAD/flask/lib/python2.7/site-packages/coverage/control.py   microblog(Download)
from coverage.debug import DebugControl
from coverage.files import FileLocator, TreeMatcher, FnmatchMatcher
from coverage.files import PathAliases, find_python_files, prep_patterns
from coverage.html import HtmlReporter
from coverage.misc import CoverageException, bool_or_none, join_regex
        # Find files that were never executed at all.
        for src in self.source:
            for py_file in find_python_files(src):
                py_file = self.file_locator.canonical_filename(py_file)
 

src/n/u/nupic-linux64-HEAD/lib64/python2.6/site-packages/coverage/control.py   nupic-linux64(Download)
from coverage.debug import DebugControl
from coverage.files import FileLocator, TreeMatcher, FnmatchMatcher
from coverage.files import PathAliases, find_python_files, prep_patterns
from coverage.html import HtmlReporter
from coverage.misc import CoverageException, bool_or_none, join_regex
        # Find files that were never executed at all.
        for src in self.source:
            for py_file in find_python_files(src):
                py_file = self.file_locator.canonical_filename(py_file)
 

src/c/o/coverage-3.7.1/coverage/control.py   coverage(Download)
from coverage.debug import DebugControl
from coverage.files import FileLocator, TreeMatcher, FnmatchMatcher
from coverage.files import PathAliases, find_python_files, prep_patterns
from coverage.html import HtmlReporter
from coverage.misc import CoverageException, bool_or_none, join_regex
        # Find files that were never executed at all.
        for src in self.source:
            for py_file in find_python_files(src):
                py_file = self.file_locator.canonical_filename(py_file)
 

src/c/o/coveragepy-HEAD/coverage/control.py   coveragepy(Download)
from coverage.debug import DebugControl
from coverage.files import FileLocator, TreeMatcher, FnmatchMatcher
from coverage.files import PathAliases, find_python_files, prep_patterns
from coverage.html import HtmlReporter
from coverage.misc import CoverageException, bool_or_none, join_regex
        # Find files that were never executed at all.
        for src in self.source:
            for py_file in find_python_files(src):
                py_file = self.file_locator.canonical_filename(py_file)
 

src/n/o/noc-0.7(3)/contrib/src/coverage/coverage/control.py   noc(Download)
from coverage.data import CoverageData
from coverage.files import FileLocator, TreeMatcher, FnmatchMatcher
from coverage.files import PathAliases, find_python_files
from coverage.html import HtmlReporter
from coverage.misc import CoverageException, bool_or_none, join_regex
            # Find files that were never executed at all.
            for src in self.source:
                for py_file in find_python_files(src):
                    self.data.touch_file(py_file)
 

src/r/o/rolf-HEAD/ve/lib/python2.7/site-packages/coverage/control.py   rolf(Download)
from coverage.data import CoverageData
from coverage.files import FileLocator, TreeMatcher, FnmatchMatcher
from coverage.files import PathAliases, find_python_files
from coverage.html import HtmlReporter
from coverage.misc import CoverageException, bool_or_none, join_regex
            # Find files that were never executed at all.
            for src in self.source:
                for py_file in find_python_files(src):
                    self.data.touch_file(py_file)
 

src/a/n/antisocial-HEAD/ve/lib/python2.7/site-packages/coverage/control.py   antisocial(Download)
from coverage.data import CoverageData
from coverage.files import FileLocator, TreeMatcher, FnmatchMatcher
from coverage.files import PathAliases, find_python_files
from coverage.html import HtmlReporter
from coverage.misc import CoverageException, bool_or_none, join_regex
            # Find files that were never executed at all.
            for src in self.source:
                for py_file in find_python_files(src):
                    self.data.touch_file(py_file)
 

src/p/l/play-HEAD/coverage/control.py   play(Download)
from coverage.data import CoverageData
from coverage.files import FileLocator, TreeMatcher, FnmatchMatcher
from coverage.files import PathAliases, find_python_files
from coverage.html import HtmlReporter
from coverage.misc import CoverageException, bool_or_none, join_regex
            # Find files that were never executed at all.
            for src in self.source:
                for py_file in find_python_files(src):
                    self.data.touch_file(py_file)
 

src/i/n/input-lib-HEAD/packages/coverage/coverage/control.py   input-lib(Download)
from coverage.data import CoverageData
from coverage.files import FileLocator, TreeMatcher, FnmatchMatcher
from coverage.files import find_python_files
from coverage.html import HtmlReporter
from coverage.misc import CoverageException, bool_or_none
            # Find files that were never executed at all.
            for src in self.source:
                for py_file in find_python_files(src):
                    self.data.touch_file(py_file)
 

src/c/o/coverage-3.7.1/tests/test_files.py   coverage(Download)
 
from coverage.files import FileLocator, TreeMatcher, FnmatchMatcher
from coverage.files import PathAliases, find_python_files, abs_file
from coverage.backward import set                   # pylint: disable=W0622
from coverage.misc import CoverageException
        self.make_file("sub/lab/exp.py")            # nope: no __init__.py
        self.make_file("sub/windows.pyw")
        py_files = set(find_python_files("sub"))
        self.assert_same_files(py_files, [
            "sub/a.py", "sub/b.py",

  1 | 2  Next