Re: [patch] Websearch: add a newline before printing Marc tags

2009-10-15 Thread Ferran Jorba
Hello Tibor,

> Please note that for offline non-XML MARC processing, you may want to
> prefer the `Text MARC' output format (tm) rather than the `HTML MARC'
> (hm) one.
>
> $ wget -O z.txt 'http://invenio-demo.cern.ch/search?p=ellis&of=tm'

Oh, that's great!  I didn't know this one.  I see that it even works
with 0.92.1.

Thanks again,

Ferran


Re: [patch] Websearch: add a newline before printing Marc tags

2009-10-15 Thread Tibor Simko
Hi Ferran:

On Thu, 15 Oct 2009, Ferran Jorba wrote:
> could you please apply this tiny patch?

Thanks, committed.

Please note that for offline non-XML MARC processing, you may want to
prefer the `Text MARC' output format (tm) rather than the `HTML MARC'
(hm) one.

$ wget -O z.txt 'http://invenio-demo.cern.ch/search?p=ellis&of=tm'

Best regards
-- 
Tibor Simko ** CERN Document Server ** 


[patch] Websearch: add a newline before printing Marc tags

2009-10-15 Thread Ferran Jorba
Hi Tibor,

could you please apply this tiny patch?  I've refreshed it to apply
cleanly to current git tree.

Thanks,

Ferran
Websearch: add a newline before printing Marc tags

 The output of Marc format in search_engine.py is useful for offline
 processing.  Adding a newline before  simplifies it.
---

Index: cds-invenio/modules/websearch/lib/search_engine.py
===
--- cds-invenio.orig/modules/websearch/lib/search_engine.py	2009-10-15 10:22:58.0 +0200
+++ cds-invenio/modules/websearch/lib/search_engine.py	2009-10-15 10:29:38.0 +0200
@@ -3371,16 +3371,16 @@
 
 elif format == "hm":
 if record_exist_p == -1:
-out += "" + cgi.escape(get_fieldvalues_alephseq_like(recID, ["001", CFG_OAI_ID_FIELD, "980"])) + ""
+out += "\n" + cgi.escape(get_fieldvalues_alephseq_like(recID, ["001", CFG_OAI_ID_FIELD, "980"])) + ""
 else:
-out += "" + cgi.escape(get_fieldvalues_alephseq_like(recID, ot)) + ""
+out += "\n" + cgi.escape(get_fieldvalues_alephseq_like(recID, ot)) + ""
 
 elif format.startswith("h") and ot:
 ## user directly asked for some tags to be displayed only
 if record_exist_p == -1:
-out += "" + get_fieldvalues_alephseq_like(recID, ["001", CFG_OAI_ID_FIELD, "980"]) + ""
+out += "\n" + get_fieldvalues_alephseq_like(recID, ["001", CFG_OAI_ID_FIELD, "980"]) + ""
 else:
-out += "" + get_fieldvalues_alephseq_like(recID, ot) + ""
+out += "\n" + get_fieldvalues_alephseq_like(recID, ot) + ""
 
 elif format == "hd":
 # HTML detailed format