aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPriit Laes <plaes@plaes.org>2010-08-03 00:21:53 +0300
committerPriit Laes <plaes@plaes.org>2010-08-03 00:21:53 +0300
commitc9ebadcdcfbffc75032e3d697da260cd932ed2ec (patch)
treebb01624b3f2024c4aaa80088a8f125d6d81e0367
parentFix typo: s/pcv/cpv (diff)
downloadgsoc2010-grumpy-c9ebadcdcfbffc75032e3d697da260cd932ed2ec.tar.gz
gsoc2010-grumpy-c9ebadcdcfbffc75032e3d697da260cd932ed2ec.tar.bz2
gsoc2010-grumpy-c9ebadcdcfbffc75032e3d697da260cd932ed2ec.zip
Added Package.sync() method
-rw-r--r--grumpy/models.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/grumpy/models.py b/grumpy/models.py
index a3b5772..6fc2d49 100644
--- a/grumpy/models.py
+++ b/grumpy/models.py
@@ -172,6 +172,10 @@ class Package(db.Model):
def __repr__(self):
return '<%s> - %s' % (self.__class__.__name__, self.key)
+ def sync(self, ebuild_src, mtime=time.time()):
+ """Update package values from ebuild_src."""
+ self.__init__(ebuild_src, mtime)
+
# def rename(self, newcat, newpkg):
# """Rename package and its ebuilds"""
# cp = "%s/%s" % (newpkg, newcat)