Hello all,
After a few days of writing tests and (today) porting the unicode support code, pywikipedia rewrite now fully supports unicode in- and output on windows:
C:\Python27\svn\bin\rewrite>python -i pwb.py
import pywikibot pywikibot.output(u'\u0414\u043e\u0431\u0440\u043e')
Добро
pywikibot.input(u'\u062d\u0631\u0648\u0641_\u064a\u0648\u0646\u0627\u0646\u064a\u0629') حروف_يونانية αβγδ u'\u03b1\u03b2\u03b3\u03b4'
Please update to SVN revision 11646 or download the latest nightly to enjoy [1]!
Best, Merlijn
[1] http://pywikipedia.org/nightly/package/pywikipedia-rewrite/pywikipedia-rewri...
I had to revert this on my machine, as it breaks the entire rewrite installation; oddly, trying the import a second time gives a different error message:
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import pywikibot
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Documents and Settings\HP_Administrator\rewrite\pywikibot__init__.py", line 25, in <module>
from pywikibot.bot import *
File "C:\Documents and Settings\HP_Administrator\rewrite\pywikibot\bot.py", line 41, in <module>
ui = uiModule.UI()
File "C:\Documents and Settings\HP_Administrator\rewrite\pywikibot\userinterfaces\terminal_int erface_win32.py", line 49, in __init__
Win32BaseUI.__init__(self)
File "C:\Documents and Settings\HP_Administrator\rewrite\pywikibot\userinterfaces\terminal_int erface_win32.py", line 43, in __init__
terminal_interface_base.UI.__init__(self)
File "C:\Documents and Settings\HP_Administrator\rewrite\pywikibot\userinterfaces\terminal_int erface_base.py", line 47, in __init__
self.transliteration_target = config.transliteration_target
AttributeError: 'module' object has no attribute 'transliteration_target'
import pywikibot
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Documents and Settings\HP_Administrator\rewrite\pywikibot__init__.py", line 24, in <module>
from pywikibot import config2 as config
ImportError: cannot import name config2
On Wed, Jun 12, 2013, at 05:32 PM, Merlijn van Deen wrote:
Hello all,
After a few days of writing tests and (today) porting the unicode support code, pywikipedia rewrite now fully supports unicode in- and output on windows:
C:\Python27\svn\bin\rewrite>python -i pwb.py
import pywikibot
pywikibot.output(u'\u0414\u043e\u0431\u0440\u043e')
Добро
pywikibot.input(u'\u062d\u0631\u0648\u0641_\u064a\u0648\u0646\u0627\u06 46\u064a\u0629')
حروف_يونانية αβγδ
u'\u03b1\u03b2\u03b3\u03b4'
Please update to SVN revision 11646 or download the latest nightly to enjoy [1]!
Best,
Merlijn
[1] [1]http://pywikipedia.org/nightly/package/pywikipedia-rewrite/pywikiped ia-rewrite-nightly.7z
_______________________________________________
Pywikipedia-l mailing list
[2]Pywikipedia-l@lists.wikimedia.org
[3]https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
-- Russell Blau russblau@imapmail.org
References
1. http://pywikipedia.org/nightly/package/pywikipedia-rewrite/pywikipedia-rewri... 2. mailto:Pywikipedia-l@lists.wikimedia.org 3. https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
Hi Russell,
On 13 June 2013 03:05, Russell Blau russblau@imapmail.org wrote:
** I had to revert this on my machine, as it breaks the entire rewrite installation; oddly, trying the import a second time gives a different error message:
Sorry for that. It seems my edits to config2.py were not committed (I think I committed from the pywikibot/userinterfaces directory, which doesn't show changes higher up - in svn, at least). I have now committed those, as well as the updated tests: r11648 and r11649.
Best, Merlijn
Rewrite rewrite. :-)
Alex
2013/6/13 Merlijn van Deen valhallasw@arctus.nl
Hi Russell,
On 13 June 2013 03:05, Russell Blau russblau@imapmail.org wrote:
** I had to revert this on my machine, as it breaks the entire rewrite installation; oddly, trying the import a second time gives a different error message:
Sorry for that. It seems my edits to config2.py were not committed (I think I committed from the pywikibot/userinterfaces directory, which doesn't show changes higher up - in svn, at least). I have now committed those, as well as the updated tests: r11648 and r11649.
Best, Merlijn
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
Thanks, but there is a problem, it shows
transliteration_target=None test.py -> pywikibot.output(pywikibot.input('a'))
D:\pywikipedia>pwb self\test Traceback (most recent call last): File "D:\pywikipedia\pwb.py", line 50, in <module> execfile(sys.argv[0]) File "D:\pywikipedia\scripts\self\test.py", line 21, in <module> main() File "D:\pywikipedia\scripts\self\test.py", line 17, in main bot.run() File "D:\pywikipedia\scripts\self\test.py", line 13, in run pywikibot.output(pywikibot.input('a')) File "D:\pywikipedia\pywikibot\bot.py", line 450, in input data = ui.input(question, password) File "D:\pywikipedia\pywikibot\userinterfaces\terminal_interface_base.py", line 188, in input self.output(question + ' ') File "D:\pywikipedia\pywikibot\userinterfaces\terminal_interface_base.py", line 168, in output self._print(text, targetStream) File "D:\pywikipedia\pywikibot\userinterfaces\terminal_interface_base.py", line 109, in _print self.printColorized(text, targetStream) File "D:\pywikipedia\pywikibot\userinterfaces\terminal_interface_win32.py", line 60, in printColorized import win32api ImportError: No module named win32api I comment out the import, it seems all right and gives correct in/output.
Justin Cheng
於 13/6/2013 16:10, Alex Brollo 提到:
Rewrite rewrite. :-)
Alex
2013/6/13 Merlijn van Deen <valhallasw@arctus.nl mailto:valhallasw@arctus.nl>
Hi Russell, On 13 June 2013 03:05, Russell Blau <russblau@imapmail.org <mailto:russblau@imapmail.org>> wrote: I had to revert this on my machine, as it breaks the entire rewrite installation; oddly, trying the import a second time gives a different error message: Sorry for that. It seems my edits to config2.py were not committed (I think I committed from the pywikibot/userinterfaces directory, which doesn't show changes higher up - in svn, at least). I have now committed those, as well as the updated tests: r11648 and r11649. Best, Merlijn _______________________________________________ Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org <mailto:Pywikipedia-l@lists.wikimedia.org> https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
On 13 June 2013 10:58, Cheng Yu Tin justincheng12345@gmail.com wrote:
ImportError: No module named win32api
Oops. My only windows box has a full-featured python installed, so that did not show up here (it was left-over from a debug output). I removed the line in r11650.
Thanks for reporting!
Best, Merlijn