Did I find the right examples for you? yes no

All Samples(7)  |  Call(4)  |  Derive(0)  |  Import(3)
Returns a list of the files 'fn' depends on.

        def find_dependencies(fn, verbose, process_pragmas, ignore_unused=False):
    "Returns a list of the files 'fn' depends on."
    file_errors = []

    ast, _ = parse_python_source(fn)
    if ast is None:
        return [], file_errors
    found_imports = get_ast_imports(ast)
    if found_imports is None:
        return [], file_errors
    
    # Filter out the unused imports if requested.
    if ignore_unused:
        found_imports, unused_imports = filter_unused_imports(ast, found_imports)
        for modname, rname, lname, lineno, level, pragma in unused_imports:
            file_errors.append((ERROR_UNUSED, lname))

    output_code = (verbose >= 2)
    source_lines = None
    if output_code:
        source_lines = open(fn, 'rU').read().splitlines()

    files = []
    assert not isdir(fn)
    dn = dirname(fn)
    seenset = set()
    for x in found_imports:
        mod, rname, lname, lineno, level, pragma = x
        if process_pragmas and pragma == 'OPTIONAL':
            if rname is None:
                msg = WARNING_OPTIONAL % (lineno, mod)
            else:
                msg = '%s.%s' % (mod, rname)
            logging.warning(msg)
            continue

        sig = (mod, rname)
        if sig in seenset:
            continue
        seenset.add(sig)

        modfile, errors = find_dotted_module(mod, rname, dn, level)
        if errors:
            file_errors.extend(errors)
            for err, name in errors:
                if err is ERROR_IMPORT:
                    efun = logging.warning
                else:
                    efun = logging.debug
                efun(err % (lineno, name))
                if output_code:
                    efun(ERROR_SOURCE % source_lines[lineno-1].rstrip())

        if modfile is None:
            continue
        files.append(realpath(modfile))

    return files, file_errors
        


src/b/a/Bazinga-0.2.4/bazinga/__init__.py   Bazinga(Download)
from nose.plugins import Plugin
import os
from snakefood.find import find_dependencies
import sys
 
    def inspectDependencies(self, path):
        try:
            files, _ = find_dependencies(path, verbose=False, process_pragmas=False)
        except TypeError, err:
            if path not in self._ignored_files:

src/a/u/autonose-HEAD/autonose/shared/file_state.py   autonose(Download)
	def _get_direct_dependency_paths(file_):
		log.debug("fetching dependencies for %s" % (file_,))
		files, errors = snakefood.find.find_dependencies(file_, verbose=False, process_pragmas=False)
		if len(errors) > 0:
			map(log.debug, errors)

src/s/n/snakefood-1.4/lib/python/snakefood/gendeps.py   snakefood(Download)
from snakefood.util import iter_pyfiles, setup_logging, def_ignores, is_python
from snakefood.depends import output_depends
from snakefood.find import find_dependencies
from snakefood.find import ERROR_IMPORT, ERROR_SYMBOL, ERROR_UNUSED
from snakefood.fallback.collections import defaultdict
            if is_python(fn):
                files, errors = find_dependencies(
                    fn, opts.verbose, opts.do_pragmas, opts.ignore_unused)
                allerrors.extend(errors)
            else:

src/m/a/marine-integrations-HEAD/mi/idk/egg_generator.py   marine-integrations(Download)
from snakefood.util import iter_pyfiles, setup_logging, def_ignores, is_python
from snakefood.depends import output_depends, read_depends
from snakefood.find import find_dependencies
from snakefood.find import find_imports
from snakefood.find import ERROR_IMPORT, ERROR_SYMBOL, ERROR_UNUSED
 
                if is_python(fn):
                    files, errors = find_dependencies(fn, 0, 0)
                    log.debug("dependency file count: %d" % len(files))
                    allerrors.extend(errors)