Python module: add Doc object method to retrieve binary path

This commit is contained in:
Jean-Francois Dockes
2012-05-25 08:25:42 +02:00
parent 244b9a6ecd
commit c764e310dc
2 changed files with 83 additions and 20 deletions
+2 -2
View File
@@ -16,7 +16,6 @@ def Usage():
sys.exit(1);
def doquery(db, q):
"""Parse and execute query on open db"""
# Get query object
query = db.query()
# Parse/run input query string
@@ -27,8 +26,9 @@ def doquery(db, q):
while query.next >= 0 and query.next < nres:
doc = query.fetchone()
print query.next, ":",
for k in ("title", "url", "mtime"):
for k in ("title", "mtime", "author"):
print k, ":", getattr(doc, k).encode('utf-8')
print "Bin URL :", doc.getbinurl()
abs = db.makeDocAbstract(doc, query).encode('utf-8')
print abs
print