mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-26 01:46:13 +01:00
- use os.path.getmtime() instead of os.stat()
- use named stat members instead of their index number
This commit is contained in:
parent
96e4e0bbab
commit
ae285de206
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user