~mwilck/duplicity/duplicity

« back to all changes in this revision

Viewing changes to duplicity/backends/ncftpbackend.py

  • Committer: Aaron A Whitehouse
  • Date: 2016-07-02 17:12:58 UTC
  • mfrom: (1111 duplicity-src8)
  • mto: This revision was merged to the branch mainline in revision 1113.
  • Revision ID: lists@whitehouse.kiwi.nz-20160702171258-xhnf5v5g542fcfhq
Merge with trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
import os.path
23
23
import urllib
 
24
import re
24
25
 
25
26
import duplicity.backend
26
27
from duplicity import globals
92
93
            self.flags += " -P '%s'" % (parsed_url.port)
93
94
 
94
95
    def _put(self, source_path, remote_filename):
95
 
        remote_path = os.path.join(urllib.unquote(self.parsed_url.path.lstrip('/')), remote_filename).rstrip()
 
96
        remote_path = os.path.join(urllib.unquote(re.sub('^/', '', self.parsed_url.path)), remote_filename).rstrip()
96
97
        commandline = "ncftpput %s -m -V -C '%s' '%s'" % \
97
98
            (self.flags, source_path.name, remote_path)
98
99
        self.subprocess_popen(commandline)
99
100
 
100
101
    def _get(self, remote_filename, local_path):
101
 
        remote_path = os.path.join(urllib.unquote(self.parsed_url.path), remote_filename).rstrip()
 
102
        remote_path = os.path.join(urllib.unquote(re.sub('^/', '', self.parsed_url.path)), remote_filename).rstrip()
102
103
        commandline = "ncftpget %s -V -C '%s' '%s' '%s'" % \
103
104
            (self.flags, self.parsed_url.hostname, remote_path.lstrip('/'), local_path.name)
104
105
        self.subprocess_popen(commandline)