← Back to team overview

duplicity-team team mailing list archive

[Merge] lp:~ed.so/duplicity/move_netloc into lp:duplicity

 

edso has proposed merging lp:~ed.so/duplicity/move_netloc into lp:duplicity.

Requested reviews:
  duplicity-team (duplicity-team)

For more details, see:
https://code.launchpad.net/~ed.so/duplicity/move_netloc/+merge/244964

- move netloc usage definitions into respective backends
- fix "[Question #259173]: rsync backend fails" 
  https://answers.launchpad.net/duplicity/+question/259173
-- 
Your team duplicity-team is requested to review the proposed merge of lp:~ed.so/duplicity/move_netloc into lp:duplicity.
=== modified file 'duplicity/backend.py'
--- duplicity/backend.py	2014-12-12 14:39:54 +0000
+++ duplicity/backend.py	2014-12-17 10:39:12 +0000
@@ -72,17 +72,9 @@
 # This looks similar to urlparse's 'uses_netloc' list, but urlparse doesn't use
 # that list for parsing, only creating urls.  And doesn't include our custom
 # schemes anyway.  So we keep our own here for our own use.
-uses_netloc = ['ftp',
-               'ftps',
-               'hsi',
-               's3',
-               'scp', 'ssh', 'sftp',
-               'webdav', 'webdavs',
-               'gdocs',
-               'http', 'https',
-               'imap', 'imaps',
-               'mega',
-               'copy']
+#
+# NOTE: this is filled by the respective backends during registering
+uses_netloc = []
 
 
 def import_backends():

=== modified file 'duplicity/backends/botobackend.py'
--- duplicity/backends/botobackend.py	2014-04-28 02:49:39 +0000
+++ duplicity/backends/botobackend.py	2014-12-17 10:39:12 +0000
@@ -31,3 +31,4 @@
 duplicity.backend.register_backend("gs", BotoBackend)
 duplicity.backend.register_backend("s3", BotoBackend)
 duplicity.backend.register_backend("s3+http", BotoBackend)
+duplicity.backend.uses_netloc.extend([ 'gs', 's3', 's3+http' ])

=== modified file 'duplicity/backends/copycombackend.py'
--- duplicity/backends/copycombackend.py	2014-12-12 14:39:54 +0000
+++ duplicity/backends/copycombackend.py	2014-12-17 10:39:12 +0000
@@ -317,3 +317,4 @@
 '''
 
 duplicity.backend.register_backend('copy', CopyComBackend)
+duplicity.backend.uses_netloc.extend([ 'copy' ] )

=== modified file 'duplicity/backends/gdocsbackend.py'
--- duplicity/backends/gdocsbackend.py	2014-04-21 19:21:45 +0000
+++ duplicity/backends/gdocsbackend.py	2014-12-17 10:39:12 +0000
@@ -183,3 +183,4 @@
         return result
 
 duplicity.backend.register_backend('gdocs', GDocsBackend)
+duplicity.backend.uses_netloc.extend([ 'gdocs' ])

=== modified file 'duplicity/backends/hsibackend.py'
--- duplicity/backends/hsibackend.py	2014-12-12 14:39:54 +0000
+++ duplicity/backends/hsibackend.py	2014-12-17 10:39:12 +0000
@@ -53,3 +53,4 @@
         self.subprocess_popen(commandline)
 
 duplicity.backend.register_backend("hsi", HSIBackend)
+duplicity.backend.uses_netloc.extend([ 'hsi' ])

=== modified file 'duplicity/backends/imapbackend.py'
--- duplicity/backends/imapbackend.py	2014-12-12 14:39:54 +0000
+++ duplicity/backends/imapbackend.py	2014-12-17 10:39:12 +0000
@@ -257,5 +257,6 @@
         self.conn.close()
         self.conn.logout()
 
-duplicity.backend.register_backend("imap", ImapBackend);
-duplicity.backend.register_backend("imaps", ImapBackend);
+duplicity.backend.register_backend("imap", ImapBackend)
+duplicity.backend.register_backend("imaps", ImapBackend)
+duplicity.backend.uses_netloc.extend([ 'imap', 'imaps' ])

=== modified file 'duplicity/backends/megabackend.py'
--- duplicity/backends/megabackend.py	2014-04-26 12:35:04 +0000
+++ duplicity/backends/megabackend.py	2014-12-17 10:39:12 +0000
@@ -123,3 +123,4 @@
         return result
 
 duplicity.backend.register_backend('mega', MegaBackend)
+duplicity.backend.uses_netloc.extend([ 'mega' ])

=== modified file 'duplicity/backends/rsyncbackend.py'
--- duplicity/backends/rsyncbackend.py	2014-12-12 14:39:54 +0000
+++ duplicity/backends/rsyncbackend.py	2014-12-17 10:39:12 +0000
@@ -154,3 +154,4 @@
         os.rmdir (dir)
 
 duplicity.backend.register_backend("rsync", RsyncBackend)
+duplicity.backend.uses_netloc.extend([ 'rsync' ])

=== modified file 'duplicity/backends/webdavbackend.py'
--- duplicity/backends/webdavbackend.py	2014-12-12 14:39:54 +0000
+++ duplicity/backends/webdavbackend.py	2014-12-17 10:39:12 +0000
@@ -422,5 +422,9 @@
         finally:
             if response: response.close()
 
+duplicity.backend.register_backend("http", WebDAVBackend)
+duplicity.backend.register_backend("https", WebDAVBackend)
 duplicity.backend.register_backend("webdav", WebDAVBackend)
 duplicity.backend.register_backend("webdavs", WebDAVBackend)
+duplicity.backend.uses_netloc.extend([ 'http', 'https', 'webdav', 'webdavs' ] )
+


Follow ups