Patches item #2012710, was opened at 2008-07-07 20:33
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=2012710&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: Translations
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Mikko Silvonen (silvonen)
Assigned to: Nobody/Anonymous (nobody)
Summary: Finnish translation of solve_disambiguation.py
Initial Comment:
I translated solve_disambiguation.py r5690 into Finnish.
The patch includes modifications also for family.py (linktrails setting) and families/wikipedia.py (correct name for the category of disambiguation pages).
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=2012710&group_…
Revision: 5688
Author: filnik
Date: 2008-07-06 20:07:33 +0000 (Sun, 06 Jul 2008)
Log Message:
-----------
Stub of the working version, but enough stable
Modified Paths:
--------------
trunk/pywikipedia/checkimages.py
Modified: trunk/pywikipedia/checkimages.py
===================================================================
--- trunk/pywikipedia/checkimages.py 2008-07-06 15:54:24 UTC (rev 5687)
+++ trunk/pywikipedia/checkimages.py 2008-07-06 20:07:33 UTC (rev 5688)
@@ -307,16 +307,7 @@
# 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', u'trademarked', u'trademark', u'uncategorized[ _]image', u'needscategory',
- u'dupe', u'duplicate', u'uncat', u'uncategorized', u'watermark', u'nocat', u'imageupload',
- u'creative[ _]Commons[ _]copyright[ _]tags', u'EdwardCurtis', u'AskedForInfo', u'Civertan_license',
- u'autorisation[ _]photos[ _]aériennes[ _]Francis[ _]Leroy', u'PermissionOTRS', u'Debora[ _]Cordeiro',
- u'flickr-change-of-license', u'flickr-unfree-but', u'flickrreview', u'LocationRequired',
- u'MartinX', u'NGC7000', u'NYC[ _]Subway[ _]map', u'Njegos.org', u'OTRS[ _]pending',
- u'OTrondal', u'www\.hotelviewarea\.com', u'second[ _]?life', u'seattle[ _]neighborhood[ _]atlas[ _]disclaimer',
- u'Photos[ _]by[ _]the[ _]Norwegian[ _]Museum[ _]of[ _]Cultural[ _]History',
- u'PD-EstoniaPub', # This is not a copyright tag. Use Template:PD-EE-exempt instead.
- u'PCL', u'PBresseler', u'PAshieldsource', u'Openphotoreview', u'Flickr', u'User:Flickr[ _]upload bot/upload'],
+ 'commons':[u'information'],
'de':[u'information'],
'en':[u'information'],
'it':[u'edp', u'informazioni[ _]file', u'information', u'trademark', u'permissionotrs'],
@@ -325,6 +316,12 @@
'ta':[u'information'],
'zh':[u'information'],
}
+
+PageWithHiddenTemplates = {
+ 'commons': u'User:Filbot/White_templates#White_templates',
+ 'en':None,
+ 'it':None,
+ }
# Template added when the bot finds only an hidden template and nothing else.
# Note: every __botnick__ will be repleaced with your bot's nickname (feel free not to use if you don't need it)
@@ -906,10 +903,10 @@
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"(?:\"|\')(.*?)(?:\"|\')(?:, |\])"
+ regl = r"(\"|\')(.*?)\1(?:, |\])"
pl = re.compile(regl, re.UNICODE)
for xl in pl.finditer(raw):
- word = xl.group(1)
+ word = xl.group(2),replace('\\', '\')
if word not in list_loaded:
list_loaded.append(word)
return list_loaded
@@ -1043,14 +1040,6 @@
dels = wikipedia.translate(site, del_comm)
smwl = wikipedia.translate(site, second_message_without_license)
TextFind = wikipedia.translate(site, txt_find)
- hiddentemplate = wikipedia.translate(site, HiddenTemplate)
- # If there's an hidden template, change the used
- 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:')
# If the images to skip are 0, set the skip variable to False (the same for the wait time)
if skip_number == 0:
@@ -1115,7 +1104,8 @@
tupla_written = None
some_problem = False
# Load the list of licenses allowed for our project
- list_licenses = mainClass.load_licenses()
+ if smartdetection:
+ list_licenses = mainClass.load_licenses()
# Ensure that if the list given is empty it will be converted to "None"
# (but it should be already done in the takesettings() function)
if tupla_written == []: tupla_written = None
@@ -1123,6 +1113,21 @@
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
+ 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)
+ 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: 5671
Author: nicdumz
Date: 2008-07-05 10:48:13 +0000 (Sat, 05 Jul 2008)
Log Message:
-----------
Fixing [ 2009068 ] diskcache files could be deleted when bot finishes :
__del__ is not guaranteed to be called everytime, in particular when reference cycles survive the garbage collection process.
Renaming __del__ to delete, and calling it from wikipedia::stopme
Modified Paths:
--------------
trunk/pywikipedia/diskcache.py
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/diskcache.py
===================================================================
--- trunk/pywikipedia/diskcache.py 2008-07-04 18:30:18 UTC (rev 5670)
+++ trunk/pywikipedia/diskcache.py 2008-07-05 10:48:13 UTC (rev 5671)
@@ -59,7 +59,7 @@
self.cache_file.seek(0)
self.cache = []
- def __del__(self):
+ def delete(self):
self.cache_file.close()
import os
os.unlink(self.cache_path)
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2008-07-04 18:30:18 UTC (rev 5670)
+++ trunk/pywikipedia/wikipedia.py 2008-07-05 10:48:13 UTC (rev 5671)
@@ -6332,6 +6332,10 @@
when it has stopped doing so. After a bot has run stopme() it will
not slow down other bots any more.
"""
+ if config.use_diskcache:
+ for site in _sites.itervalues():
+ if site._mediawiki_messages:
+ site._mediawiki_messages.delete()
get_throttle.drop()
def _flush():
Revision: 5687
Author: filnik
Date: 2008-07-06 15:54:24 +0000 (Sun, 06 Jul 2008)
Log Message:
-----------
Another white template...
Modified Paths:
--------------
trunk/pywikipedia/checkimages.py
Modified: trunk/pywikipedia/checkimages.py
===================================================================
--- trunk/pywikipedia/checkimages.py 2008-07-06 15:52:11 UTC (rev 5686)
+++ trunk/pywikipedia/checkimages.py 2008-07-06 15:54:24 UTC (rev 5687)
@@ -316,7 +316,7 @@
u'OTrondal', u'www\.hotelviewarea\.com', u'second[ _]?life', u'seattle[ _]neighborhood[ _]atlas[ _]disclaimer',
u'Photos[ _]by[ _]the[ _]Norwegian[ _]Museum[ _]of[ _]Cultural[ _]History',
u'PD-EstoniaPub', # This is not a copyright tag. Use Template:PD-EE-exempt instead.
- u'PCL', u'PBresseler', u'PAshieldsource', u'Openphotoreview', u'Flickr'],
+ u'PCL', u'PBresseler', u'PAshieldsource', u'Openphotoreview', u'Flickr', u'User:Flickr[ _]upload bot/upload'],
'de':[u'information'],
'en':[u'information'],
'it':[u'edp', u'informazioni[ _]file', u'information', u'trademark', u'permissionotrs'],
@@ -1062,7 +1062,7 @@
# something = Minimal requirements for an image description.
# If this fits, no tagging will take place (if there aren't other issues)
# MIT license is ok on italian wikipedia, let also this here
- something = ['{{', "'''MIT license'''"] # Don't put "}}" here, please. Useless and can give problems.
+ something = ['{{'] # Don't put "}}" here, please. Useless and can give problems.
# Unused file extensions. Does not contain PDF.
notallowed = ("xcf", "xls", "sxw", "sxi", "sxc", "sxd")
Revision: 5685
Author: filnik
Date: 2008-07-06 15:48:09 +0000 (Sun, 06 Jul 2008)
Log Message:
-----------
Fix #if:
Modified Paths:
--------------
trunk/pywikipedia/checkimages.py
Modified: trunk/pywikipedia/checkimages.py
===================================================================
--- trunk/pywikipedia/checkimages.py 2008-07-06 15:44:05 UTC (rev 5684)
+++ trunk/pywikipedia/checkimages.py 2008-07-06 15:48:09 UTC (rev 5685)
@@ -1049,6 +1049,8 @@
# 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:')
# If the images to skip are 0, set the skip variable to False (the same for the wait time)
if skip_number == 0: