Lines Matching refs:package
113 from package import name_leafs"""
116 # "not been tested with dotted package names -- use at your own "\
303 def does_tree_import(package, name, node):
304 """ Returns true if name is imported from package at the
307 None for the package and 'foo' for the name. """
308 binding = find_binding(name, find_root(node), package)
315 def touch_import(package, name, node):
324 if does_tree_import(package, name, root):
348 if package is None:
354 import_ = FromImport(package, [Leaf(token.NAME, name, prefix=" ")])
361 def find_binding(name, node, package=None):
363 If optional argument package is supplied, only imports will
371 n = find_binding(name, make_suite(child.children[-1]), package)
374 n = find_binding(name, make_suite(child.children[-1]), package)
377 n = find_binding(name, make_suite(child.children[2]), package)
384 n = find_binding(name, make_suite(child.children[i+4]), package)
388 elif _is_import_binding(child, name, package):
391 ret = find_binding(name, child, package)
397 if not package:
414 def _is_import_binding(node, name, package=None):
416 will import * from package. None is returned otherwise.
419 if node.type == syms.import_name and not package:
437 if package and str(node.children[1]).strip() != package:
440 if package and _find("as", n):
451 elif package and n.type == token.STAR: