[Pkg-debile-commits] [debile-master] 20/126: add job info

Sylvestre Ledru sylvestre at alioth.debian.org
Mon Aug 19 14:56:07 UTC 2013


This is an automated email from the git hooks/post-receive script.

sylvestre pushed a commit to branch scan-build-html
in repository debile-master.

commit 6a0cc1b65750db9c3e19b8b5dce9ce9d16c473b5
Author: Paul Tagliamonte <tag at pault.ag>
Date:   Sun May 26 08:54:31 2013 -0400

    add job info
---
 lucy/models/job.py |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lucy/models/job.py b/lucy/models/job.py
index d1bd484..9dca033 100644
--- a/lucy/models/job.py
+++ b/lucy/models/job.py
@@ -7,12 +7,16 @@ from lucy.models import LucyObject
 class Job(LucyObject):
     _type = 'jobs'
 
-    def __init__(self, type, package, builder=None, finished_at=None,
-                 assigned_at=None, **kwargs):
+    def __init__(self, type, package, package_type, builder=None,
+                 finished_at=None, assigned_at=None, **kwargs):
 
-        try:
+        if package_type not in ["source", "binary"]:
+            raise ValueError("package_type needs to be binary or source")
+
+        if package_type == "source":
             package = Source.load(package)['_id']
-        except KeyError:
+
+        if package_type == "binary":
             package = Binary.load(package)['_id']
 
         if builder:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-debile/debile-master.git



More information about the Pkg-debile-commits mailing list