-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 18.02.2012 14:00, BinĂ¡ris wrote:
2012/2/18 Dr. Trigon <dr.trigon@surfeu.ch mailto:dr.trigon@surfeu.ch>
Meanwhile I just can tell you how I handle that - I use a script that sets (sys.argv[1:]) to the value I want.
Could you show me an example, how do you mean that?
https://fisheye.toolserver.org/browse/drtrigon/pywikipedia/bot_control.py?hb...
and then later in the used bot scripts 'pywikibot.handleArgs()' is called to extract them.
Another question to me (when lookin at '_decodeArg') is; have you tried to add another encoding there? To me it seems as your console has to use another one in order to be able to handle Cyrillic letters. I think we have ti fix '_decodeArg'.
Well, this is not about Cyrillic; Cyrillic was just the first reason to begin to deal with the question. I don't know how to set the consol to Cyrillic under a Hungarian Windows 7, and how to keep my own caharcters meanwhile, too. Is that possible at all?
The trick I want to do is to write a Python script that uses other scripts. All my Python scripts are encoded as Unicode without BOM, that's safe and uniform. From that point I have to pass Hungarian (or even German) letters as Unicode.
The script mentioned above 'bot_control.py' does exactly that. It is the script that gets called from e.g. cronjob and then executes the given bot script in order. I wrote this basically because of timing since I wanted to be sure the first bot was done before running the second. But be warned the code is somehow ugly... ;) This is also because it implements additional things like 'logging' module for log and others which should be implemented in pywikipedia instead of patched together with a "dirty" script... (as mentioned earlier on this list by others) But I would be happy if we could adopt it to fit your needs too.