Meanwhile I hacked the code and forced a pt, for now :) But this might be useful. Thanks :)
On Mon, Aug 1, 2011 at 6:58 PM, Timo <[email protected]> wrote: > Hi, > > if you just want to change the link addresses, this will probably work: > - Put custom_nfo.py and mwrender.nfo.py into the same directory. > - Put nfo.json to the directory where the wikiconf.txt is. > - Open nfo.json with a text editor and change the address. > - Set the executable flag for mwrender.nfo.py > - Set “lang = en” in your wikiconf.txt > - Do the rendering using mwrender.nfo.py instead of mw-render with the > same parameters. > > > Best wishes, > > Timo > > > > Am Montag, den 01.08.2011, 13:44 +0100 schrieb Alberto Simões: >> Hello >> >> Further developments: >> >> edited mwlib/apps/__init__.py and mwlib/cdbwiki.py and replaced en >> by pt. Redo the database, same behavior... >> >> On Mon, Aug 1, 2011 at 12:27 PM, ambs <[email protected]> wrote: >> > Hello >> > >> > I am in a kind of hurry to have this working. We are preparing an >> > information extraction task from Portuguese wikipedia and we need a >> > XHTML version of it :S >> > >> > Well, on to my problem. >> > >> > Used mw-buildcdb -i ptdump.xml -o cdb >> > >> > The cdb/wikiconf.txt file says: lang = en >> > >> > If I keep it that way, most pages are converted correctly. >> > If I change the 'en' to 'pt' (to get links rendered correctly) I have >> > a lot of pages failing (see error bellow). >> > >> > Any hint on what might be going on? >> > >> > Thank you >> > Alberto >> > >> > >> > Traceback (most recent call last): >> > File "/opt/python/bin/mw-render", line 8, in <module> >> > load_entry_point('mwlib==0.12.14', 'console_scripts', 'mw-render') >> > () >> > File "/opt/python/lib/python2.7/site-packages/mwlib-0.12.14-py2.7- >> > linux-x86_64 >> > .egg/mwlib/apps/render.py", line 214, in main >> > return Main()() >> > File "/opt/python/lib/python2.7/site-packages/mwlib-0.12.14-py2.7- >> > linux-x86_64 >> > .egg/mwlib/apps/render.py", line 177, in __call__ >> > writer(env, output=tmpout, status_callback=self.status, >> > **writer_options) >> > File "/opt/python/lib/python2.7/site-packages/mwlib-0.12.14-py2.7- >> > linux-x86_64 >> > .egg/mwlib/xhtmlwriter.py", line 707, in xhtmlwriter >> > book = writerbase.build_book(env, >> > status_callback=buildbook_status) >> > File "/opt/python/lib/python2.7/site-packages/mwlib-0.12.14-py2.7- >> > linux-x86_64 >> > .egg/mwlib/writerbase.py", line 43, in build_book >> > a = wiki.getParsedArticle(title=item.title, >> > revision=item.revision) >> > File "/opt/python/lib/python2.7/site-packages/mwlib-0.12.14-py2.7- >> > linux-x86_64 >> > .egg/mwlib/nuwiki.py", line 342, in getParsedArticle >> > return uparser.parseString(title=title, raw=raw, wikidb=self, >> > lang=self.site >> > info["general"]["lang"]) >> > File "/opt/python/lib/python2.7/site-packages/mwlib-0.12.14-py2.7- >> > linux-x86_64 >> > .egg/mwlib/refine/uparser.py", line 34, in parseString >> > input = te.expandTemplates(True) >> > File "evaluate.py", line 291, in >> > mwlib.templ.evaluate.Expander.expandTemplates >> > (mwlib/templ/evaluate.c:5656) >> > File "evaluate.py", line 278, in >> > mwlib.templ.evaluate.Expander._expand (mwlib/ >> > templ/evaluate.c:5301) >> > File "evaluate.py", line 28, in mwlib.templ.evaluate.flatten (mwlib/ >> > templ/eval >> > uate.c:1024) >> > File "evaluate.py", line 30, in mwlib.templ.evaluate.flatten (mwlib/ >> > templ/eval >> > uate.c:1055) >> > File "nodes.py", line 205, in mwlib.templ.nodes.Template.flatten >> > (mwlib/templ/ >> > nodes.c:4315) >> > File "nodes.py", line 282, in mwlib.templ.nodes.Template._flatten >> > (mwlib/templ >> > /nodes.c:5601) >> > File "evaluate.py", line 30, in mwlib.templ.evaluate.flatten (mwlib/ >> > templ/eval >> > uate.c:1055) >> > File "nodes.py", line 205, in mwlib.templ.nodes.Template.flatten >> > (mwlib/templ/ >> > nodes.c:4315) >> > File "nodes.py", line 282, in mwlib.templ.nodes.Template._flatten >> > (mwlib/templ >> > /nodes.c:5601) >> > File "evaluate.py", line 28, in mwlib.templ.evaluate.flatten (mwlib/ >> > templ/eval >> > uate.c:1024) >> > File "evaluate.py", line 30, in mwlib.templ.evaluate.flatten (mwlib/ >> > templ/eval >> > uate.c:1055) >> > File "nodes.py", line 205, in mwlib.templ.nodes.Template.flatten >> > (mwlib/templ/ >> > nodes.c:4315) >> > File "nodes.py", line 282, in mwlib.templ.nodes.Template._flatten >> > (mwlib/templ >> > /nodes.c:5601) >> > File "evaluate.py", line 28, in mwlib.templ.evaluate.flatten (mwlib/ >> > templ/eval >> > uate.c:1024) >> > File "evaluate.py", line 30, in mwlib.templ.evaluate.flatten (mwlib/ >> > templ/evaluate.c:1055) >> > File "nodes.py", line 30, in mwlib.templ.nodes.IfNode.flatten (mwlib/ >> > templ/nodes.c:1391) >> > File "evaluate.py", line 28, in mwlib.templ.evaluate.flatten (mwlib/ >> > templ/evaluate.c:1024) >> > File "evaluate.py", line 30, in mwlib.templ.evaluate.flatten (mwlib/ >> > templ/evaluate.c:1055) >> > File "nodes.py", line 191, in mwlib.templ.nodes.Variable.flatten >> > (mwlib/templ/nodes.c:4075) >> > File "evaluate.py", line 152, in >> > mwlib.templ.evaluate.ArgumentList.get (mwlib/templ/evaluate.c:3202) >> > File "evaluate.py", line 28, in mwlib.templ.evaluate.flatten (mwlib/ >> > templ/evaluate.c:1024) >> > File "evaluate.py", line 30, in mwlib.templ.evaluate.flatten (mwlib/ >> > templ/evaluate.c:1055) >> > File "nodes.py", line 205, in mwlib.templ.nodes.Template.flatten >> > (mwlib/templ/nodes.c:4315) >> > File "nodes.py", line 268, in mwlib.templ.nodes.Template._flatten >> > (mwlib/templ/nodes.c:5399) >> > File "/opt/python/lib/python2.7/site-packages/mwlib-0.12.14-py2.7- >> > linux-x86_64.egg/mwlib/templ/magics.py", line 559, in __call__ >> > res = m(args) or '' # FIXME: catch TypeErros >> > File "/opt/python/lib/python2.7/site-packages/mwlib-0.12.14-py2.7- >> > linux-x86_64.egg/mwlib/templ/magics.py", line 440, in IFEXIST >> > exists = >> > bool(self.wikidb.normalize_and_get_image_path(name.split(":")[1])) >> > File "/opt/python/lib/python2.7/site-packages/mwlib-0.12.14-py2.7- >> > linux-x86_64.egg/mwlib/nuwiki.py", line 268, in __getattr__ >> > raise AttributeError() >> > >> > -- >> > You received this message because you are subscribed to the Google Groups >> > "mwlib" group. >> > To post to this group, send email to [email protected]. >> > To unsubscribe from this group, send email to >> > [email protected]. >> > For more options, visit this group at >> > http://groups.google.com/group/mwlib?hl=en. >> > >> > >> >> >> >> -- >> Alberto Simões >> > > -- > You received this message because you are subscribed to the Google Groups > "mwlib" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/mwlib?hl=en. > > -- Alberto Simões -- You received this message because you are subscribed to the Google Groups "mwlib" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/mwlib?hl=en.
