[Pkg-debile-commits] [debile-master] 75/126: add grouping

Sylvestre Ledru sylvestre at alioth.debian.org
Mon Aug 19 14:56:18 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 a27b92da5f6b5d4436e911e7e76edb61e63f1a51
Author: Paul Tagliamonte <tag at pault.ag>
Date:   Sun Jun 9 16:05:45 2013 -0400

    add grouping
---
 eg/config.json          |    6 ++++++
 lucy/incoming.py        |    5 +++++
 lucy/models/__init__.py |   11 +++++++++--
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/eg/config.json b/eg/config.json
index 6b8fa05..dd12472 100644
--- a/eg/config.json
+++ b/eg/config.json
@@ -58,6 +58,12 @@
             "email": "tag at pault.ag",
             "gpg": "57DC4BD33F73E0CDBA98D22AF7EBEE8EB7982329",
             "name": "Paul R. Tagliamonte"
+        },
+        {
+            "_id": "rebuilder",
+            "email": "paultag at debian.org",
+            "gpg": "2EA5C67F0A37D37C64C7B5EDC0A1FC9FD80D7B69",
+            "name": "Archive Rebuilder"
         }
     ]
 }
diff --git a/lucy/incoming.py b/lucy/incoming.py
index 759d690..1638a53 100644
--- a/lucy/incoming.py
+++ b/lucy/incoming.py
@@ -48,9 +48,14 @@ def accept_source(config, changes):
 
     dsc = os.path.basename(changes.get_dsc())
 
+    group = None
+    if 'X-Lucy-Group' in changes:
+        group = changes['X-Lucy-Group']
+
     obj = Source(source=changes['source'],
                  version=changes['version'],
                  owner=who['_id'],
+                 group=group,
                  dsc=dsc)
     obj.save()
 
diff --git a/lucy/models/__init__.py b/lucy/models/__init__.py
index 8ae332e..d36a0d0 100644
--- a/lucy/models/__init__.py
+++ b/lucy/models/__init__.py
@@ -44,9 +44,16 @@ class LucyObject(dict):
         return cls.from_dict(obj)
 
     @classmethod
-    def query(cls, what):
+    def query(cls, what, sort=None, sort_order=1, limit=None):
         table = _get_table(cls._type)
-        for x in table.find(what):
+        pointer = table.find(what)
+        if sort:
+            pointer = pointer.sort(sort, sort_order)
+
+        if limit:
+            pointer = pointer.limit(limit)
+
+        for x in pointer:
             yield cls(**x)
 
     @classmethod

-- 
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