~mterry/duplicity/1031277

« back to all changes in this revision

Viewing changes to duplicity/backend.py

  • Committer: Kenneth Loafman
  • Date: 2012-05-16 11:35:39 UTC
  • mfrom: (855.1.1 duplicity_bzr2)
  • Revision ID: kenneth@loafman.com-20120516113539-tellfw5bzdwdvjyj
Merged in lp:~ed.so/duplicity/backend_fixes

- fixed ssh/gio backend import warnings
 + ssh paramiko backend imports paramiko lazily now
 + gio backend is not imported automatically but on request when --gio option is used
- added a warning when --ssh-backend is used with an incorrect value

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
        if fn.endswith("backend.py"):
75
75
            fn = fn[:-3]
76
76
            imp = "duplicity.backends.%s" % (fn,)
 
77
            # ignore gio as it is explicitly loaded in commandline.parse_cmdline_options()
 
78
            if fn == "giobackend": continue
77
79
            try:
78
80
                __import__(imp)
79
81
                res = "Succeeded"
155
157
    elif not pu.scheme in _backends:
156
158
        raise UnsupportedBackendScheme(url_string)
157
159
    else:
158
 
        return _backends[pu.scheme](pu)
 
160
        try:
 
161
            return _backends[pu.scheme](pu)
 
162
        except ImportError:
 
163
            raise BackendException(_("Could not initialize backend: %s") % str(sys.exc_info()[1]))
159
164
 
160
165
 
161
166
_urlparser_initialized = False