/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to tools/package_mf.py

  • Committer: Robert Collins
  • Date: 2010-05-05 00:05:29 UTC
  • mto: This revision was merged to the branch mainline in revision 5206.
  • Revision ID: robertc@robertcollins.net-20100505000529-ltmllyms5watqj5u
Make 'pydoc bzrlib.tests.build_tree_shape' useful.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
class CustomModuleFinder(modulefinder.ModuleFinder):
25
25
    """Custom module finder for processing python packages,
26
 
    e.g. brz plugins packages.
 
26
    e.g. bzr plugins packages.
27
27
 
28
28
    :param  path:   list of directories to search for modules;
29
29
                    if not specified, python standard library only is used.
32
32
    def __init__(self, path=None, debug=0, excludes=[], replace_paths=[]):
33
33
        if path is None:
34
34
            path = [os.path.dirname(os.__file__)]    # only python std lib
35
 
        modulefinder.ModuleFinder.__init__(
36
 
            self, path, debug, excludes, replace_paths)
 
35
        modulefinder.ModuleFinder.__init__(self, path, debug, excludes,
 
36
            replace_paths)
37
37
 
38
38
    def run_package(self, package_path):
39
39
        """Recursively process each module in package with run_script method.
59
59
 
60
60
    def get_result(self):
61
61
        """Return 2-tuple: (list of packages, list of modules)"""
62
 
        keys = sorted(self.modules.keys())
 
62
        keys = self.modules.keys()
 
63
        keys.sort()
63
64
        mods = []
64
65
        packs = []
65
66
        for key in keys:
81
82
 
82
83
    packs, mods = mf.get_result()
83
84
 
84
 
    print('Packages:')
85
 
    print(packs)
 
85
    print 'Packages:'
 
86
    print packs
86
87
 
87
 
    print('Modules:')
88
 
    print(mods)
 
88
    print 'Modules:'
 
89
    print mods