Patches item #2033435, was opened at 2008-07-31 12:47
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=2033435&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: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Woo-Jin Kim (kwj2772)
Assigned to: Nobody/Anonymous (nobody)
Summary: checkimages.py - support ko.wikipedia
Initial Comment:
I've modified checkimages.py and operating in kowikipedia.
This script will support Korean.
script source:
http://ko.wikipedia.org/wiki/%EC%82%AC%EC%9A%A9%EC%9E%90:%EA%B9%80%EC%9A%B0…
Thank you!
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=2033435&group_…
Patches item #2033223, was opened at 2008-07-31 00:48
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=2033223&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: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Tgr (tgr_)
Assigned to: Nobody/Anonymous (nobody)
Summary: solve_disambiguation.py: redirects as disambiguation pages
Initial Comment:
The Hungarian Wikipedia is experimenting with a new disambiguation system where primary meanings also have an unambiguous page name, and the base name is a redirect to the primary meaning, tagged with a template to mark it as a disambiguation. (This way, it is always easy to decide whether a link is ambiguous or not; previously, links to the primary had to be reviewed again and again, as there was no way te tell them apart from the not yet reviewed links.)
The attached patch adds a new behavior when the disambiguation page is a redirect containing a special template; the robot will offer the links found on the target page of the redirect as possible disambiguation options, instead of offering the target of the redirect only. Optionally, a disambiguation page page with a name different then "<primary name> (disambiguation page)" can be supplied as an argument to the template
The behavior of the bot is only changed if the template is present.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=2033223&group_…
Revision: 5773
Author: filnik
Date: 2008-07-29 10:57:01 +0000 (Tue, 29 Jul 2008)
Log Message:
-----------
A bit of rewrite for the hidden/whitetemplate function, adding also the italian setting page
Modified Paths:
--------------
trunk/pywikipedia/checkimages.py
Modified: trunk/pywikipedia/checkimages.py
===================================================================
--- trunk/pywikipedia/checkimages.py 2008-07-29 10:23:50 UTC (rev 5772)
+++ trunk/pywikipedia/checkimages.py 2008-07-29 10:57:01 UTC (rev 5773)
@@ -313,11 +313,11 @@
# because they are already put in the regex).
# Warning 3: the part that use this regex is case-insensitive (just to let you know..)
HiddenTemplate = {
- 'commons':[u'information'],
+ 'commons':[u'information'], # Put the other in the page on the project defined below
'ar':[u'معلومات'],
'de':[u'information'],
'en':[u'information'],
- 'it':[u'edp', u'informazioni[ _]file', u'information', u'trademark', u'permissionotrs'],
+ 'it':[u'edp', u'informazioni[ _]file', u'information', u'trademark', u'permissionotrs'], # Put the other in the page on the project defined below
'ja':[u'Information'],
'hu':[u'információ', u'enwiki', u'azonnali'],
'ta':[u'information'],
@@ -327,7 +327,7 @@
PageWithHiddenTemplates = {
'commons': u'User:Filbot/White_templates#White_templates',
'en':None,
- 'it':None,
+ 'it':u'Progetto:Coordinamento/Immagini/Bot/WhiteTemplates',
}
# Template added when the bot finds only an hidden template and nothing else.
@@ -471,6 +471,8 @@
self.rep_page = wikipedia.translate(self.site, report_page)
self.rep_text = wikipedia.translate(self.site, report_text)
self.com = wikipedia.translate(self.site, comm10)
+ self.hiddentemplate = wikipedia.translate(self.site, HiddenTemplate)
+ self.pageHidden = wikipedia.translate(self.site, PageWithHiddenTemplates)
# Commento = Summary in italian
self.commento = wikipedia.translate(self.site, comm)
# Adding the bot's nickname at the notification text if needed.
@@ -643,7 +645,7 @@
if self.sendemailActive:
text_to_send = re.sub(r'__user-nickname__', '%s' % self.luser, emailText)
emailClass = EmailSender(self.site, self.luser)
- emailClass.send(emailSubj, text_to_send)
+ emailClass.send(emailSubj, text_to_send)
def untaggedGenerator(self, untaggedProject, limit):
""" Generator that yield the images without license. It's based on a tool of the toolserver. """
@@ -682,6 +684,21 @@
yield image
#continue
+ def loadHiddenTemplates(self):
+ # A template as {{en is not a license! Adding also them in the whitelist template...
+ for langK in wikipedia.Family('wikipedia').langs.keys():
+ self.hiddentemplate.append('%s' % langK)
+ # The template #if: and #switch: aren't something to care about
+ self.hiddentemplate.extend(['#if:', '#switch:'])
+ # Hidden template loading
+ if self.pageHidden != None:
+ try:
+ pageHiddenText = wikipedia.Page(self.site, self.pageHidden).get()
+ except (wikipedia.NoPage, wikipedia.IsRedirectPage):
+ pageHiddenText = ''
+ self.hiddentemplate.extend(self.load(pageHiddenText))
+ return self.hiddentemplate
+
def returnOlderTime(self, listGiven, timeListGiven):
""" Get some time and return the oldest of them """
# print listGiven; print timeListGiven
@@ -910,7 +927,7 @@
load_2 = True
# I search with a regex how many user have not the talk page
# and i put them in a list (i find it more easy and secure)
- regl = r"(\"|\')(.*?)\1(?:, |\])"
+ regl = r"(\"|\')(.*?)\1(?:,\s+?|\])"
pl = re.compile(regl, re.UNICODE)
for xl in pl.finditer(raw):
word = xl.group(2).replace('\\\\', '\\')
@@ -1120,22 +1137,10 @@
if tupla_written != None: wikipedia.output(u'\t >> Loaded the real-time page... <<')
# No settings found, No problem, continue.
else: wikipedia.output(u'\t >> No additional settings found! <<')
- hiddentemplate = wikipedia.translate(site, HiddenTemplate)
- # If there's an hidden template, change the used
+ # Load the white templates(hidden template is the same as white template, regarding the meaning)
+ hiddentemplate = mainClass.loadHiddenTemplates()
+ # Load the notification for only white templates images
HiddenTN = wikipedia.translate(site, HiddenTemplateNotification)
- # A template as {{en is not a license! Adding also them in the whitelist template...
- for langK in wikipedia.Family('wikipedia').langs.keys():
- hiddentemplate.append('%s' % langK)
- # The template #if: isn't something to care about
- hiddentemplate.append('#if:')
- # Hidden template loading
- pageHidden = wikipedia.translate(site, PageWithHiddenTemplates)
- if pageHidden != None:
- try:
- pageHiddenText = wikipedia.Page(site, pageHidden).get()
- except (wikipedia.NoPage, wikipedia.IsRedirectPage):
- pageHiddenText = ''
- hiddentemplate.extend(mainClass.load(pageHiddenText))
# Not the main, but the most important loop.
#parsed = False
for image in generator:
Revision: 5769
Author: russblau
Date: 2008-07-28 14:34:45 +0000 (Mon, 28 Jul 2008)
Log Message:
-----------
Untabify file. Don't mix spaces and tabs!
Modified Paths:
--------------
trunk/pywikipedia/family.py
Modified: trunk/pywikipedia/family.py
===================================================================
--- trunk/pywikipedia/family.py 2008-07-28 14:32:05 UTC (rev 5768)
+++ trunk/pywikipedia/family.py 2008-07-28 14:34:45 UTC (rev 5769)
@@ -3185,11 +3185,11 @@
return True
def post_get_convert(self, site, getText):
- """Does a conversion on the retrieved text from the wiki
- i.e. Esperanto X-conversion """
- return getText
+ """Does a conversion on the retrieved text from the wiki
+ i.e. Esperanto X-conversion """
+ return getText
def pre_put_convert(self, site, putText):
- """Does a conversion on the text to insert on the wiki
- i.e. Esperanto X-conversion """
- return putText
+ """Does a conversion on the text to insert on the wiki
+ i.e. Esperanto X-conversion """
+ return putText
Revision: 5768
Author: filnik
Date: 2008-07-28 14:32:05 +0000 (Mon, 28 Jul 2008)
Log Message:
-----------
Indentation fix again
Modified Paths:
--------------
trunk/pywikipedia/family.py
Modified: trunk/pywikipedia/family.py
===================================================================
--- trunk/pywikipedia/family.py 2008-07-28 13:18:32 UTC (rev 5767)
+++ trunk/pywikipedia/family.py 2008-07-28 14:32:05 UTC (rev 5768)
@@ -3187,7 +3187,7 @@
def post_get_convert(self, site, getText):
"""Does a conversion on the retrieved text from the wiki
i.e. Esperanto X-conversion """
- return getText
+ return getText
def pre_put_convert(self, site, putText):
"""Does a conversion on the text to insert on the wiki
Revision: 5767
Author: nicdumz
Date: 2008-07-28 13:18:32 +0000 (Mon, 28 Jul 2008)
Log Message:
-----------
ident fix
Modified Paths:
--------------
trunk/pywikipedia/family.py
Modified: trunk/pywikipedia/family.py
===================================================================
--- trunk/pywikipedia/family.py 2008-07-28 12:34:30 UTC (rev 5766)
+++ trunk/pywikipedia/family.py 2008-07-28 13:18:32 UTC (rev 5767)
@@ -3185,11 +3185,11 @@
return True
def post_get_convert(self, site, getText):
- """Does a conversion on the retrieved text from the wiki
- i.e. Esperanto X-conversion """
- return getText
+ """Does a conversion on the retrieved text from the wiki
+ i.e. Esperanto X-conversion """
+ return getText
def pre_put_convert(self, site, putText):
- """Does a conversion on the text to insert on the wiki
- i.e. Esperanto X-conversion """
- return putText
+ """Does a conversion on the text to insert on the wiki
+ i.e. Esperanto X-conversion """
+ return putText