~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/export/__init__.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:
20
20
"""
21
21
 
22
22
import os
23
 
import bzrlib.errors as errors
 
23
from bzrlib import (
 
24
    errors,
 
25
    pyutils,
 
26
    )
24
27
 
25
28
# Maps format name => export function
26
29
_exporters = {}
55
58
    When requesting a specific type of export, load the respective path.
56
59
    """
57
60
    def _loader(tree, dest, root, subdir, filtered, per_file_timestamps):
58
 
        mod = __import__(module, globals(), locals(), [funcname])
59
 
        func = getattr(mod, funcname)
 
61
        func = pyutils.get_named_object(module, funcname)
60
62
        return func(tree, dest, root, subdir, filtered=filtered,
61
63
                    per_file_timestamps=per_file_timestamps)
62
64
    register_exporter(scheme, extensions, _loader)