Make it possible to crawl more than one list at a time, without doing all
authorMagnus Hagander <magnus@hagander.net>
Sun, 22 Jan 2012 11:06:32 +0000 (12:06 +0100)
committerMagnus Hagander <magnus@hagander.net>
Sun, 22 Jan 2012 11:06:32 +0000 (12:06 +0100)
tools/search/crawler/listcrawler.py

index e528ab5cc403472aa72322122e7f5df379945664..02091284d141f040b545f6bfad927dd1020d1b13 100755 (executable)
@@ -19,8 +19,9 @@ def doit(opt):
        curs = conn.cursor()
 
        if opt.list:
-               curs.execute("SELECT id,name FROM lists WHERE name=%(name)s", {
-                               'name': opt.list,
+               # Multiple lists can be specified with a comma separator (no spaces)
+               curs.execute("SELECT id,name FROM lists WHERE name=ANY(%(names)s)", {
+                               'names': opt.list.split(','),
                                })
        else:
                curs.execute("SELECT id,name FROM lists WHERE active ORDER BY id")