summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2010-01-01 02:50:56 +0200
committerLars Wirzenius <liw@liw.fi>2010-01-01 02:50:56 +0200
commit34b139012bc2f6d0dbadc9a43f492d66610d3200 (patch)
treeafec45652f1caaca3559cf1719ecdbfdeddfc5ba
parent637153eef8c8af093caa13fb13a73380a8623bf1 (diff)
downloadsummain-34b139012bc2f6d0dbadc9a43f492d66610d3200.tar.gz
Refactor: Removed FilesystemObject.format_mode since it is so
simple. Don't want to write a separate method for each field.
-rw-r--r--summainlib.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/summainlib.py b/summainlib.py
index 53851fe..501c3ec 100644
--- a/summainlib.py
+++ b/summainlib.py
@@ -35,16 +35,13 @@ class FilesystemObject(object):
self.values = dict()
self['Name'] = filename
self['Mtime'] = self.format_time(stat_result.st_mtime)
- self['Mode'] = self.format_mode(stat_result.st_mode)
+ self['Mode'] = '%o' % stat_result.st_mode
self['Ino'] = '%d' % stat_result.st_ino
def format_time(self, timestamp):
return time.strftime('%Y-%m-%d %H:%M:%S +0000',
time.gmtime(timestamp))
- def format_mode(self, mode):
- return '%o' % mode
-
def hook_name(self, value):
return urllib.quote(value)