From ae285de206d447c3ec9299f8abc5ca21b06def8c Mon Sep 17 00:00:00 2001 From: "Dr. Peter Poeml" Date: Fri, 16 Jun 2006 12:19:02 +0000 Subject: [PATCH] - use os.path.getmtime() instead of os.stat() - use named stat members instead of their index number --- osc/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osc/core.py b/osc/core.py index ffef9fda..b6f9edac 100755 --- a/osc/core.py +++ b/osc/core.py @@ -146,7 +146,7 @@ class Package: def addfile(self, n): st = os.stat(os.path.join(self.dir, n)) - f = File(n, None, st[6], st[8]) + f = File(n, None, st.st_size, st.st_mtime) self.filelist.append(f) self.filenamelist.append(n) self.filenamelist_unvers.remove(n) @@ -787,12 +787,12 @@ def edit_meta(prj, pac): f.write(''.join(m)) f.close() - timestamp = os.stat(filename).st_mtime + timestamp = os.path.getmtime(filename) editor = os.getenv('EDITOR', default='vim') os.system('%s %s' % (editor, filename)) - if os.stat(filename).st_mtime == timestamp: + if os.path.getmtime(filename) == timestamp: print 'File unchanged. Not saving.' os.unlink(filename)