[Hejes-devel] [947] actually, i just redid the parametrization.
hejes-devel at nytud.hu
hejes-devel at nytud.hu
Wed Sep 18 13:33:20 CEST 2013
Revision: 947
Author: hussami
Date: 2013-09-18 13:33:20 +0200 (Wed, 18 Sep 2013)
Log Message:
-----------
actually, i just redid the parametrization. so now you have the second and third
command-line option: min and max id that we care about.
Modified Paths:
--------------
trunk/misc/osiris_xml/ohanalyze.py
Modified: trunk/misc/osiris_xml/ohanalyze.py
===================================================================
--- trunk/misc/osiris_xml/ohanalyze.py 2013-09-18 11:10:23 UTC (rev 946)
+++ trunk/misc/osiris_xml/ohanalyze.py 2013-09-18 11:33:20 UTC (rev 947)
@@ -320,9 +320,11 @@
return result
- def readDB(self):
+ def readDB(self, minid = 0, maxid = -1):
# query = "select id, actual, norm from ohdict where id > 1000 and id not in (253, 1617, 10954, 10962, 14118, 21042, 26766, 28090, 31341, 35355, 41501, 41502, 41503, 53195, 63253, 66216, 66217, 68562, 69228, 69229, 72479, 72480, 72481, 72482, 72483, 72484, 72565, 79810, 79812, 81608, 81609, 82178, 82181, 104301, 107148, 110649, 112890) order by id asc limit 100";
- query = "select id, actual, norm from ohdict where id > 0"
+ query = "select id, actual, norm from ohdict where id >= {0}".format(minid)
+ if maxid > 0:
+ query += " and id <= {0}".format(maxid)
self.db.execute(query)
result = self.db.fetchall()
@@ -363,9 +365,9 @@
fin = self.outputSplit(row[0], filterednorm, crtl, fmt)
print fin
-
-if len(sys.argv) < 2:
- print "usage: " + sys.argv[0] + " format (2 - Zsofi, 3 - SQL)"
+numargs = len(sys.argv)
+if numargs < 2:
+ print "Usage: "+sys.argv[0]+" format (2 - Zsofi, 3 - SQL) [min ID] [max ID]"
exit()
if sys.argv[1] != "2" and sys.argv[1] != "3":
@@ -373,11 +375,19 @@
exit()
fmt = int(sys.argv[1])
+minid = 0
+if numargs >= 3:
+ minid = int(sys.argv[2])
+maxid = 0
+if numargs >= 4:
+ maxid = int(sys.argv[3])
+
+
dumpmsgs = False
oh = OHAnalyze(False)
-eltlist = oh.readDB()
+eltlist = oh.readDB(minid, maxid)
oh.analyze(eltlist, fmt)
oh.bye()
More information about the Hejes-devel
mailing list