aboutsummaryrefslogtreecommitdiff
path: root/paramiko/sftp_attr.py
diff options
context:
space:
mode:
authorJeremy T. Bouse <jbouse@debian.org>2015-03-12 21:35:59 -0400
committerJeremy T. Bouse <jbouse@debian.org>2015-03-12 21:35:59 -0400
commit01653e8710c38f3066078b2773ad47ccb3670c58 (patch)
tree8284e75857a06945167186d09dd9021fd24c2ee1 /paramiko/sftp_attr.py
parent74794f84c2d9906aea5024dfccd90482fff9bab3 (diff)
parentf784a533d6e1d09e89dc254f3493b491e19c94f0 (diff)
downloadpython-paramiko-01653e8710c38f3066078b2773ad47ccb3670c58.tar
python-paramiko-01653e8710c38f3066078b2773ad47ccb3670c58.tar.gz
Merge tag 'upstream/1.15.2'
Upstream version 1.15.2
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)"""