This commit is contained in:
Jean-Francois Dockes 2014-09-11 08:40:09 +02:00
parent 7b4c1d8859
commit 1c0d3bd8cf
74 changed files with 3893 additions and 2522 deletions

View file

@ -34,11 +34,11 @@ for doc in query:
for fld in ('title', 'testfield', 'filename'):
print("getattr(doc, %s) -> [%s]"%(fld,utf8string(getattr(doc, fld))))
print("doc.get(%s) -> [%s]"%(fld,utf8string(doc.get(fld))))
print("\nfor fld in doc.keys():")
for fld in doc.keys():
print("\nfor fld in sorted(doc.keys()):")
for fld in sorted(doc.keys()):
print(utf8string("[%s] -> [%s]" % (fld, getattr(doc, fld))))
print("\nfor k,v in doc.items().items():")
for k,v in doc.items().items():
print("\nfor k,v in sorted(doc.items().items()):")
for k,v in sorted(doc.items().items(), key=lambda itm: itm[0]):
print(utf8string("[%s] -> [%s]" % (k, v)))
print("\nAccented query:")

View file

@ -10,7 +10,7 @@ doc.get(testfield) -> [testfieldvalue1]
getattr(doc, filename) -> [htmlfield1.html]
doc.get(filename) -> [htmlfield1.html]
for fld in doc.keys():
for fld in sorted(doc.keys()):
[abstract] -> [ ThisIsTheFieldHtmlTestFile]
[caption] -> [HTML fields test file: été à noël]
[dbytes] -> [27]
@ -24,29 +24,29 @@ for fld in doc.keys():
[pcbytes] -> [267]
[rcludi] -> [/home/dockes/projets/fulltext/testrecoll/html/htmlfield1.html|]
[relevancyrating] -> [100%]
[sig] -> [2671383154417]
[sig] -> [2671402138880]
[testfield] -> [testfieldvalue1]
[title] -> [HTML fields test file: été à noël]
[url] -> [file:///home/dockes/projets/fulltext/testrecoll/html/htmlfield1.html]
for k,v in doc.items().items():
[testfield] -> [testfieldvalue1]
[ipath] -> []
[url] -> [file:///home/dockes/projets/fulltext/testrecoll/html/htmlfield1.html]
for k,v in sorted(doc.items().items()):
[abstract] -> [ ThisIsTheFieldHtmlTestFile]
[pcbytes] -> [267]
[caption] -> [HTML fields test file: été à noël]
[dbytes] -> [27]
[fbytes] -> [267]
[filename] -> [htmlfield1.html]
[mtype] -> [text/html]
[caption] -> [HTML fields test file: été à noël]
[fmtime] -> [01383154417]
[dbytes] -> [27]
[sig] -> [2671383154417]
[ipath] -> []
[mtime] -> [01383154417]
[title] -> [HTML fields test file: été à noël]
[mtype] -> [text/html]
[origcharset] -> [utf-8]
[pcbytes] -> [267]
[rcludi] -> [/home/dockes/projets/fulltext/testrecoll/html/htmlfield1.html|]
[relevancyrating] -> [100%]
[origcharset] -> [utf-8]
[sig] -> [2671402138880]
[testfield] -> [testfieldvalue1]
[title] -> [HTML fields test file: été à noël]
[url] -> [file:///home/dockes/projets/fulltext/testrecoll/html/htmlfield1.html]
Accented query:
User query [title:"été à noël"]

View file

@ -7,6 +7,8 @@ else:
ISP3 = False
def utf8string(s):
if s is None:
return "None"
if ISP3:
return s
else: