~julian-edwards/maas/mipf-celery-job

« back to all changes in this revision

Viewing changes to utilities/find-imported-module-files

  • Committer: Gavin Panella
  • Date: 2012-10-16 17:01:16 UTC
  • mto: This revision was merged to the branch mainline in revision 1281.
  • Revision ID: gavin.panella@canonical.com-20121016170116-s1py02le8ksy0lso
Now that all standard mods are being collected, top_module_name() is not needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
from python_standard_libs import python_standard_libs
36
36
 
37
37
 
38
 
def top_module_name(name):
39
 
    """Return the top-level module name.
40
 
 
41
 
    e.g. os.path -> os
42
 
    """
43
 
    return name.split(".", 1)[0]
44
 
 
45
 
 
46
38
def find_standard_library_modules(seed=python_standard_libs):
47
39
    """Find all standard-library modules."""
48
40
    finder = ModuleFinder()
71
63
    # library.
72
64
    modules = (
73
65
        module for name, module in finder.modules.items()
74
 
        if top_module_name(name) not in standard_libs
 
66
        if name not in standard_libs
75
67
        )
76
68
    # Collect the absolute paths for each module, eliminating those modules
77
69
    # with no filename.