summaryrefslogtreecommitdiffstats
path: root/pactest/pmfile.py
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2007-02-21 07:33:13 +0100
committerAaron Griffin <aaron@archlinux.org>2007-02-21 07:33:13 +0100
commit786cd38c0a1cfeff96e5c755852a7e1c7f5e7d75 (patch)
tree3dbf7d7a1a314665602df9e1c0465afd3f2728e1 /pactest/pmfile.py
parenta8dd8d5770094ad8c925a56d47c3607c96363a51 (diff)
downloadpacman-786cd38c0a1cfeff96e5c755852a7e1c7f5e7d75.tar.gz
pacman-786cd38c0a1cfeff96e5c755852a7e1c7f5e7d75.tar.xz
* Indentation changes - 4 spaces for python, we standardized this before (and
it's a PEP) * Modified some sync tests
Diffstat (limited to 'pactest/pmfile.py')
-rwxr-xr-xpactest/pmfile.py55
1 files changed, 28 insertions, 27 deletions
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: