/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-06 23:41:35 UTC
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100506234135-yivbzczw1sejxnxc
Lock methods on ``Tree``, ``Branch`` and ``Repository`` are now
expected to return an object which can be used to unlock them. This reduces
duplicate code when using cleanups. The previous 'tokens's returned by
``Branch.lock_write`` and ``Repository.lock_write`` are now attributes
on the result of the lock_write. ``repository.RepositoryWriteLockResult``
and ``branch.BranchWriteLockResult`` document this. (Robert Collins)

``log._get_info_for_log_files`` now takes an add_cleanup callable.
(Robert Collins)

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