~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Vincent Ladeuil
  • Date: 2010-10-15 11:25:40 UTC
  • mfrom: (5436.2.9 hooks-refactoring)
  • mto: This revision was merged to the branch mainline in revision 5500.
  • Revision ID: v.ladeuil+lp@free.fr-20101015112540-vhgyone6ou1g0foo
Merge lp:~spiv/bzr/hooks-refactoring with tweaks

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
    lockable_files,
46
46
    lockdir,
47
47
    osutils,
 
48
    pyutils,
48
49
    remote,
49
50
    repository,
50
51
    revision as _mod_revision,
3092
3093
    def _load(full_name):
3093
3094
        mod_name, factory_name = full_name.rsplit('.', 1)
3094
3095
        try:
3095
 
            mod = __import__(mod_name, globals(), locals(),
3096
 
                    [factory_name])
 
3096
            factory = pyutils.get_named_object(mod_name, factory_name)
3097
3097
        except ImportError, e:
3098
3098
            raise ImportError('failed to load %s: %s' % (full_name, e))
3099
 
        try:
3100
 
            factory = getattr(mod, factory_name)
3101
3099
        except AttributeError:
3102
3100
            raise AttributeError('no factory %s in module %r'
3103
 
                % (full_name, mod))
 
3101
                % (full_name, sys.modules[mod_name]))
3104
3102
        return factory()
3105
3103
 
3106
3104
    def helper():