diff options
author | Jacob Beck <jbeck@colorado.edu> | 2014-10-14 21:37:45 -0600 |
---|---|---|
committer | Jacob Beck <jbeck@colorado.edu> | 2014-10-14 21:37:45 -0600 |
commit | 5fbd4e3b6fcdc9edc04f84134d0ae76f349854a7 (patch) | |
tree | 88e9d9b51477ae21d3c906017b6c377e102e325b /paramiko/sftp_attr.py | |
parent | d9caab12578c242294aea95c7ad3dada361c4455 (diff) | |
download | paramiko-5fbd4e3b6fcdc9edc04f84134d0ae76f349854a7.tar.gz |
Converted all staticmethod/classmethod instances to decorators.
Diffstat (limited to 'paramiko/sftp_attr.py')
-rw-r--r-- | paramiko/sftp_attr.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/paramiko/sftp_attr.py b/paramiko/sftp_attr.py index d12eff8d..cf48f654 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)""" |