diff options
author | Robey Pointer <robey@lag.net> | 2005-04-10 00:39:18 +0000 |
---|---|---|
committer | Robey Pointer <robey@lag.net> | 2005-04-10 00:39:18 +0000 |
commit | 7e40c6f2bed7447cbee329102e22434784658bf8 (patch) | |
tree | 7d451f0cc88b336468ffc073e2427510232f6dfc | |
parent | 6e6f1cec7a31b9c53878e83bb19b609b6090da71 (diff) |
[project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-159]
clean up SFTPAttributes.__repr__
clean up SFTPAttributes repr() a bit.
-rw-r--r-- | paramiko/sftp_attr.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/paramiko/sftp_attr.py b/paramiko/sftp_attr.py index 5c76e31c..5123c914 100644 --- a/paramiko/sftp_attr.py +++ b/paramiko/sftp_attr.py @@ -81,6 +81,9 @@ class SFTPAttributes (object): def __repr__(self): return '<SFTPAttributes: %s>' % self._debug_str() + def __str__(self): + return self._debug_str() + ### internals... @@ -148,12 +151,12 @@ class SFTPAttributes (object): if hasattr(self, 'st_uid') or hasattr(self, 'st_gid'): out += 'uid=%d gid=%d ' % (getattr(self, 'st_uid', 0), getattr(self, 'st_gid', 0)) if hasattr(self, 'st_mode'): - out += 'mode=' + oct(self.st_mode) + out += 'mode=' + oct(self.st_mode) + ' ' if hasattr(self, 'st_atime') or hasattr(self, 'st_mtime'): out += 'atime=%d mtime=%d ' % (getattr(self, 'st_atime', 0), getattr(self, 'st_mtime', 0)) for k, v in self.attr.iteritems(): - out += '"%s"=%s ' % (str(k), repr(v)) + out += '"%s"=%r ' % (str(k), v) out += ']' return out |