aboutsummaryrefslogtreecommitdiff
path: root/paramiko/sftp_attr.py
diff options
context:
space:
mode:
Diffstat (limited to 'paramiko/sftp_attr.py')
-rw-r--r--paramiko/sftp_attr.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/paramiko/sftp_attr.py b/paramiko/sftp_attr.py
index d12eff8..cf48f65 100644
--- a/paramiko/sftp_attr.py
+++ b/paramiko/sftp_attr.py
@@ -60,6 +60,7 @@ class SFTPAttributes (object):
self.st_mtime = None
self.attr = {}
+ @classmethod
def from_stat(cls, obj, filename=None):
"""
Create an `.SFTPAttributes` object from an existing ``stat`` object (an
@@ -79,13 +80,12 @@ class SFTPAttributes (object):
if filename is not None:
attr.filename = filename
return attr
- from_stat = classmethod(from_stat)
def __repr__(self):
return '<SFTPAttributes: %s>' % self._debug_str()
### internals...
-
+ @classmethod
def _from_msg(cls, msg, filename=None, longname=None):
attr = cls()
attr._unpack(msg)
@@ -94,7 +94,6 @@ class SFTPAttributes (object):
if longname is not None:
attr.longname = longname
return attr
- _from_msg = classmethod(_from_msg)
def _unpack(self, msg):
self._flags = msg.get_int()
@@ -159,6 +158,7 @@ class SFTPAttributes (object):
out += ']'
return out
+ @staticmethod
def _rwx(n, suid, sticky=False):
if suid:
suid = 2
@@ -168,7 +168,6 @@ class SFTPAttributes (object):
else:
out += '-xSs'[suid + (n & 1)]
return out
- _rwx = staticmethod(_rwx)
def __str__(self):
"""create a unix-style long description of the file (like ls -l)"""