Bugs item #1817623, was opened at 2007-10-22 08:40
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1817623&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: interwiki
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: AnMaster (anmaster)
Assigned to: Nobody/Anonymous (nobody)
Summary: interwiki.py crash "Language aa does not exist..."
Initial Comment:
$ python -O interwiki.py -start:! -whenneeded
Checked for running processes. 1 processes currently running, including the current process.
Missing main page name
NOTE: Number of pages queued is 0, trying to add 60 more.
Retrieving Allpages special page for gentoo:en from %21, namespace 0
Getting 60 pages from gentoo:en...
Sleeping for 27.1 seconds, 2007-10-22 08:37:17
NOTE: [[en:2005-08 Screenshots]] does not have any interwiki links
NOTE: [[en:2005-09 Screenshots]] does not have any interwiki links
NOTE: [[en:2005-10 Screenshots]] does not have any interwiki links
NOTE: [[en:2005-11 Screenshots]] does not have any interwiki links
<snip>
NOTE: [[en:Admin Support Systems]] does not have any interwiki links
NOTE: [[en:Advanced Emerge World]] does not have any interwiki links
NOTE: [[en:Ae-current-ebuilds]] does not have any interwiki links
======Post-processing [[en:Ae-current-ebuilds]]======
Updating links on page [[en:Ae-current-ebuilds]].
No changes needed
Dump en (gentoo) saved
Traceback (most recent call last):
File "interwiki.py", line 1580, in ?
bot.run()
File "interwiki.py", line 1357, in run
self.queryStep()
File "interwiki.py", line 1336, in queryStep
subj.finish(self)
File "interwiki.py", line 904, in finish
site = wikipedia.getSite(code = siteCode)
File "/home/arvid/wikibots/gentoo-wiki/wikipedia.py", line 4922, in getSite
_sites[key] = Site(code=code, fam=fam, user=user, persistent_http=persistent_http)
File "/home/arvid/wikibots/gentoo-wiki/wikipedia.py", line 3566, in __init__
raise KeyError("Language %s does not exist in family %s"%(self.lang,self.family.name))
KeyError: 'Language aa does not exist in family gentoo'
And indeed gentoo-wiki.com does not have such a language.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1817623&group_…
Revision: 4473
Author: russblau
Date: 2007-10-19 12:52:12 +0000 (Fri, 19 Oct 2007)
Log Message:
-----------
Daniel, please test your code before committing. ;)
Modified Paths:
--------------
trunk/pywikipedia/userinterfaces/terminal_interface.py
Modified: trunk/pywikipedia/userinterfaces/terminal_interface.py
===================================================================
--- trunk/pywikipedia/userinterfaces/terminal_interface.py 2007-10-19 10:47:17 UTC (rev 4472)
+++ trunk/pywikipedia/userinterfaces/terminal_interface.py 2007-10-19 12:52:12 UTC (rev 4473)
@@ -18,7 +18,7 @@
def getDefaultTextColorInWindows():
"""
This method determines the default text color and saves its color
- code inside the variable self._windowsDefaultColor.
+ code inside the variable windowsColors['default'].
Based on MIT-licensed code by Andre Burgaud published at
http://starship.python.net/crew/theller/wiki/ColorConsole
@@ -143,7 +143,7 @@
# print the rest of the text
targetStream.write(text.encode(config.console_encoding, 'replace'))
# just to be sure, reset the color
- ctypes.windll.kernel32.SetConsoleTextAttribute(std_out_handle, _windowsDefaultColor)
+ ctypes.windll.kernel32.SetConsoleTextAttribute(std_out_handle, windowsColors['default'])
else:
# ctypes is only available since Python 2.5, and we won't
# try to colorize without it. Instead we add *** after the text as a whole
Bugs item #1805528, was opened at 2007-10-01 11:55
Message generated for change (Settings changed) made by wikipedian
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1805528&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Marcin Cieslak (saperski)
Assigned to: Nobody/Anonymous (nobody)
Summary: wikisource_family.py: Add Polish translation
Initial Comment:
When accessing Polish wikisource (pl.wikisource.org) tools report that wikisource family is not up to date
WARNING: Outdated family file wikisource: namespace['pl'][2] is 'Wikipedysta', but should be 'Wikiskryba'
WARNING: Outdated family file wikisource: namespace['pl'][3] is 'Dyskusja wikipedysty', but should be 'Dyskusja Wikiskryby'
Probably other translations should be added as well (because now "User"/"User talk" become defaults).
Index: families/wikisource_family.py
===================================================================
--- families/wikisource_family.py (revision 4394)
+++ families/wikisource_family.py (working copy)
@@ -25,6 +25,16 @@
if lang not in self.langs:
self.langs[lang] = lang+'.wikisource.org'
+ self.namespaces[2] = {
+ '_default': self.namespaces[2]['_default'],
+ 'pl': 'Wikiskryba',
+ }
+
+ self.namespaces[3] = {
+ '_default': self.namespaces[2]['_default'],
+ 'pl': 'Dyskusja Wikiskryby',
+ }
+
self.namespaces[4] = {
'_default': [u'Wikisource', self.namespaces[4]['_default']],
'ang': u'Wicifruma',
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1805528&group_…
Bugs item #1816352, was opened at 2007-10-19 10:33
Message generated for change (Comment added) made by wikipedian
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1816352&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: John Vandenberg (zeroj)
Assigned to: Nobody/Anonymous (nobody)
Summary: replace.py regex '(?ms)^(.*)$'
Initial Comment:
In order to use replace.py to "append" text, the regex needs to match the entire page using '(?ms)^(.*)$' '\1 text to add'. I thought that this was working a while ago, and I documented it as an example on [[m:Replace.py]] on September 24.
This doesnt appear to be working now, with the code infinitely looping: it continually matches the page and appends the replacement text.
The attached patch makes any regex that matches the entire page a special case.
----------------------------------------------------------------------
>Comment By: Daniel Herding (wikipedian)
Date: 2007-10-19 12:41
Message:
Logged In: YES
user_id=880694
Originator: NO
Thanks for your report. This bug didn't only occur when the full text is
matched. Take for example this regex, which seems to do the same as yours,
but is much simpler:
python replace.py -regex "$" "foobar" -page:asdf
I found a more elegant solution to this bug, it is now in SVN. Instead of
while True:
there is now a real loop termination condition:
while index < len(text):
This seems to solve this problem.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1816352&group_…
Revision: 4469
Author: wikipedian
Date: 2007-10-19 09:33:57 +0000 (Fri, 19 Oct 2007)
Log Message:
-----------
ring_bell now defaults to False because some users (especially on Windows) considered it annoying
Modified Paths:
--------------
trunk/pywikipedia/config.py
Modified: trunk/pywikipedia/config.py
===================================================================
--- trunk/pywikipedia/config.py 2007-10-19 09:30:46 UTC (rev 4468)
+++ trunk/pywikipedia/config.py 2007-10-19 09:33:57 UTC (rev 4469)
@@ -105,7 +105,7 @@
transliterate = True
# Should the system bell be ringed if the bot expects user input?
-ring_bell = True
+ring_bell = False
# Colorization can be used to markup important text parts of the output.
# On Linux/Unix terminals, ANSI escape codes are used for this. On Windows,
Revision: 4468
Author: wikipedian
Date: 2007-10-19 09:30:46 +0000 (Fri, 19 Oct 2007)
Log Message:
-----------
auto-detect Windows command line text color
Modified Paths:
--------------
trunk/pywikipedia/config.py
trunk/pywikipedia/userinterfaces/terminal_interface.py
Modified: trunk/pywikipedia/config.py
===================================================================
--- trunk/pywikipedia/config.py 2007-10-18 18:41:58 UTC (rev 4467)
+++ trunk/pywikipedia/config.py 2007-10-19 09:30:46 UTC (rev 4468)
@@ -97,28 +97,6 @@
# tkinter isn't yet ready
userinterface = 'terminal'
-# What color should we used for text? This should match your
-# operating system's default color for console text.
-# Note: This setting is only required for Windows users.
-# Possibilities:
-# 0 = Black
-# 1 = Blue
-# 2 = Green
-# 3 = Aqua
-# 4 = Red
-# 5 = Purple
-# 6 = Yellow
-# 7 = White
-# 8 = Gray
-# 9 = Light Blue
-# 10 = Light Green
-# 11 = Light Aqua
-# 12 = Light Red
-# 13 = Light Purple
-# 14 = Light Yellow
-# 15 = Bright White
-defaultcolor = 7
-
# Should we transliterate characters that do not exist in the console
# character set?
# True: whenever possible
Modified: trunk/pywikipedia/userinterfaces/terminal_interface.py
===================================================================
--- trunk/pywikipedia/userinterfaces/terminal_interface.py 2007-10-18 18:41:58 UTC (rev 4467)
+++ trunk/pywikipedia/userinterfaces/terminal_interface.py 2007-10-19 09:30:46 UTC (rev 4468)
@@ -1,3 +1,8 @@
+#
+# (C) Pywikipedia bot team, 2003-2007
+#
+# Distributed under the terms of the MIT license.
+#
__version__ = '$Id$'
import config, transliteration
@@ -10,6 +15,48 @@
except ImportError:
ctypes_found = False
+def getDefaultTextColorInWindows():
+ """
+ This method determines the default text color and saves its color
+ code inside the variable self._windowsDefaultColor.
+
+ Based on MIT-licensed code by Andre Burgaud published at
+ http://starship.python.net/crew/theller/wiki/ColorConsole
+ """
+ if sys.platform != 'win32' or not ctypes_found:
+ return -1
+ SHORT = ctypes.c_short
+ WORD = ctypes.c_ushort
+
+ # wincon.h
+ class COORD(ctypes.Structure):
+ _fields_ = [
+ ("X", SHORT),
+ ("Y", SHORT)
+ ]
+
+ class SMALL_RECT(ctypes.Structure):
+ _fields_ = [
+ ("Left", SHORT),
+ ("Top", SHORT),
+ ("Right", SHORT),
+ ("Bottom", SHORT)
+ ]
+
+ class CONSOLE_SCREEN_BUFFER_INFO(ctypes.Structure):
+ _fields_ = [
+ ("dwSize", COORD),
+ ("dwCursorPosition", COORD),
+ ("wAttributes", WORD),
+ ("srWindow", SMALL_RECT),
+ ("dwMaximumWindowSize", COORD)
+ ]
+
+ std_out_handle = ctypes.windll.kernel32.GetStdHandle(-11)
+ csbi = CONSOLE_SCREEN_BUFFER_INFO()
+ ctypes.windll.kernel32.GetConsoleScreenBufferInfo(std_out_handle, ctypes.byref(csbi))
+ return csbi.wAttributes & 0x0007
+
# TODO: other colors:
#0 = Black
#1 = Blue
@@ -39,7 +86,7 @@
}
windowsColors = {
- 'default': config.defaultcolor,
+ 'default': getDefaultTextColorInWindows(),
'lightblue': 9,
'lightgreen': 10,
'lightaqua': 11,
@@ -55,9 +102,6 @@
def __init__(self):
pass
- # NOTE: We use sys.stdout.write() instead of print because print adds a
- # newline.
-
def printColorizedInUnix(self, text, targetStream):
lastColor = None
for key, value in unixColors.iteritems():
@@ -99,7 +143,7 @@
# print the rest of the text
targetStream.write(text.encode(config.console_encoding, 'replace'))
# just to be sure, reset the color
- ctypes.windll.kernel32.SetConsoleTextAttribute(std_out_handle, windowsColors['default'])
+ ctypes.windll.kernel32.SetConsoleTextAttribute(std_out_handle, _windowsDefaultColor)
else:
# ctypes is only available since Python 2.5, and we won't
# try to colorize without it. Instead we add *** after the text as a whole