index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Aaron Griffin <aaron@archlinux.org> | 2007-02-21 06:33:13 +0000 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2007-02-21 06:33:13 +0000 |
commit | 786cd38c0a1cfeff96e5c755852a7e1c7f5e7d75 (patch) | |
tree | 3dbf7d7a1a314665602df9e1c0465afd3f2728e1 /pactest/pmfile.py | |
parent | a8dd8d5770094ad8c925a56d47c3607c96363a51 (diff) |
-rwxr-xr-x | pactest/pmfile.py | 55 |
diff --git a/pactest/pmfile.py b/pactest/pmfile.py index d78b09fa..597c0992 100755 --- a/pactest/pmfile.py +++ b/pactest/pmfile.py @@ -24,42 +24,43 @@ from util import * class pmfile: - """File object - """ + """File object + """ - def __init__(self, root, name): - self.name = name - self.root = root + def __init__(self, root, name): + self.name = name + self.root = root - filename = os.path.join(self.root, self.name) - self.checksum = getmd5sum(filename) - self.mtime = getmtime(filename) + filename = os.path.join(self.root, self.name) + self.checksum = getmd5sum(filename) + self.mtime = getmtime(filename) - def __str__(self): - return "%s (%s / %lu)" % (self.name, self.checksum, self.mtime) + def __str__(self): + return "%s (%s / %lu)" % (self.name, self.checksum, self.mtime) - def ismodified(self): - """ - """ + def ismodified(self): + """ + """ - retval = 0 + retval = 0 - filename = os.path.join(self.root, self.name) - checksum = getmd5sum(filename) - mtime = getmtime(filename) + filename = os.path.join(self.root, self.name) + checksum = getmd5sum(filename) + mtime = getmtime(filename) - if debug: - print "ismodified(%s)" % self.name - print "old: %s / %s" % (self.checksum, self.mtime) - print "new: %s / %s" % (checksum, mtime) + if debug: + print "ismodified(%s)" % self.name + print "old: %s / %s" % (self.checksum, self.mtime) + print "new: %s / %s" % (checksum, mtime) - if not self.checksum == checksum \ - or not (self.mtime[1], self.mtime[2]) == (mtime[1], mtime[2]): - retval = 1 + if not self.checksum == checksum \ + or not (self.mtime[1], self.mtime[2]) == (mtime[1], mtime[2]): + retval = 1 - return retval + return retval if __name__ == "__main__": - f = pmfile("/tmp", "foobar") - print f + f = pmfile("/tmp", "foobar") + print f +# vim: set ts=4 sw=4 et: |