summaryrefslogtreecommitdiff
path: root/fs/sftpfs.py
diff options
context:
space:
mode:
authorrfkelly0 <rfkelly0@67cdc799-7952-0410-af00-57a81ceafa0f>2009-06-17 02:51:42 +0000
committerrfkelly0 <rfkelly0@67cdc799-7952-0410-af00-57a81ceafa0f>2009-06-17 02:51:42 +0000
commitca8db37ac56c908d912fc83951ab18ba5db35d4a (patch)
treeeddde8570ce3aa82d3e0089fbc7631596d734160 /fs/sftpfs.py
parentea43bde6cd32c517ba5d3dd010b03a1d9d166f70 (diff)
downloadpyfilesystem-ca8db37ac56c908d912fc83951ab18ba5db35d4a.tar.gz
make convert_os_errors() decorate rewrite the resource path if self as an attribute "root_path"
git-svn-id: http://pyfilesystem.googlecode.com/svn/trunk@193 67cdc799-7952-0410-af00-57a81ceafa0f
Diffstat (limited to 'fs/sftpfs.py')
-rw-r--r--fs/sftpfs.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/sftpfs.py b/fs/sftpfs.py
index 9dd1e70..ce62d44 100644
--- a/fs/sftpfs.py
+++ b/fs/sftpfs.py
@@ -40,7 +40,7 @@ class SFTPFS(FS):
class in the paramiko module.
"""
- def __init__(self,connection,root="/",**credentials):
+ def __init__(self,connection,root_path="/",**credentials):
"""SFTPFS constructor.
The only required argument is 'connection', which must be something
@@ -52,7 +52,7 @@ class SFTPFS(FS):
* a paramiko.Transport instance
* a paramiko.Channel instance in "sftp" mode
- The kwd argument 'root' specifies the root directory on the remote
+ The kwd argument 'root_path' specifies the root directory on the remote
machine - access to files outsite this root wil be prevented. Any
other keyword arguments are assumed to be credentials to be used when
connecting the transport.
@@ -71,7 +71,7 @@ class SFTPFS(FS):
if not connection.is_authenticated():
connection.connect(**credentials)
self._transport = connection
- self.root = abspath(normpath(root))
+ self.root_path = abspath(normpath(root_path))
def __del__(self):
self.close()
@@ -111,8 +111,8 @@ class SFTPFS(FS):
self._transport.close()
def _normpath(self,path):
- npath = pathjoin(self.root,relpath(normpath(path)))
- if not isprefix(self.root,npath):
+ npath = pathjoin(self.root_path,relpath(normpath(path)))
+ if not isprefix(self.root_path,npath):
raise PathError(path,msg="Path is outside root: %(path)s")
return npath