Revision: 4967
Author: filnik
Date: 2008-02-03 21:01:24 +0000 (Sun, 03 Feb 2008)
Log Message:
-----------
Seems working but adding a note
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2008-02-03 20:53:20 UTC (rev 4966)
+++ trunk/pywikipedia/wikipedia.py 2008-02-03 21:01:24 UTC (rev 4967)
@@ -4695,6 +4695,8 @@
"""
if default:
if self.lang == 'ar':
+ # It won't work with REDIRECT[[]] but it work with the local,
+ # if problems, try to find a work around. FixMe!
return self.family.redirect.get(self.lang, [u"تحويل"])[0]
else:
return self.family.redirect.get(self.lang, [u"REDIRECT"])[0]
Revision: 4965
Author: filnik
Date: 2008-02-03 20:28:34 +0000 (Sun, 03 Feb 2008)
Log Message:
-----------
Adding a bugfix for ar.wikipedia
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2008-02-03 19:13:31 UTC (rev 4964)
+++ trunk/pywikipedia/wikipedia.py 2008-02-03 20:28:34 UTC (rev 4965)
@@ -4705,11 +4705,15 @@
"""
try:
- redirKeywords = [u'redirect'] + self.family.redirect[self.lang]
+ if self.site.lang == 'ar':
+ red = u'تحويل'
+ else:
+ red = u'redirect'
+ redirKeywords = [red] + self.family.redirect[self.lang]
redirKeywordsR = r'(?:' + '|'.join(redirKeywords) + ')'
except KeyError:
# no localized keyword for redirects
- redirKeywordsR = r'redirect'
+ redirKeywordsR = r'%s' % red
# A redirect starts with hash (#), followed by a keyword, then
# arbitrary stuff, then a wikilink. The wikilink may contain
# a label, although this is not useful.
Revision: 4962
Author: filnik
Date: 2008-02-03 17:20:36 +0000 (Sun, 03 Feb 2008)
Log Message:
-----------
Ooops, commented put lines to test, forgot to delete the comments
Modified Paths:
--------------
trunk/pywikipedia/checkimages.py
Modified: trunk/pywikipedia/checkimages.py
===================================================================
--- trunk/pywikipedia/checkimages.py 2008-02-03 17:15:39 UTC (rev 4961)
+++ trunk/pywikipedia/checkimages.py 2008-02-03 17:20:36 UTC (rev 4962)
@@ -993,13 +993,13 @@
wikipedia.output(u"The image description for %s does not contain a license template!" % imageName)
notification = nn % imageName
head = nh
- #report(unvertext, imageName, notification, head, smwl)
+ report(unvertext, imageName, notification, head, smwl)
continue
else:
wikipedia.output(u"%s has only text and not the specific license..." % imageName)
notification = nn % imageName
head = nh
- #report(unvertext, imageName, notification, head, smwl)
+ report(unvertext, imageName, notification, head, smwl)
continue
# A little block to perform the repeat or to break.
if repeat == True:
Revision: 4961
Author: filnik
Date: 2008-02-03 17:15:39 +0000 (Sun, 03 Feb 2008)
Log Message:
-----------
Oh, found a bug. config.mylang isn't updated if you use args, bugfixed
Modified Paths:
--------------
trunk/pywikipedia/checkimages.py
Modified: trunk/pywikipedia/checkimages.py
===================================================================
--- trunk/pywikipedia/checkimages.py 2008-02-03 15:09:18 UTC (rev 4960)
+++ trunk/pywikipedia/checkimages.py 2008-02-03 17:15:39 UTC (rev 4961)
@@ -289,8 +289,9 @@
time_zone = unicode(time.strftime(u"%d %b %Y %H:%M:%S (UTC)", time.gmtime()))
wikipedia.output(u"%s%s" % (message, time_zone))
-# When the page is not a wiki-page (as for untagged generator) you need that function
def pageText(url):
+ """ Function used to get HTML text from every reachable URL """
+ # When the page is not a wiki-page (as for untagged generator) you need that function
try:
request = urllib2.Request(url)
user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7'
@@ -313,34 +314,40 @@
# Here there is the main class.
class main:
def __init__(self, site, logFulNumber = 25000):
+ """ Constructor, define some global variable """
self.site = site
self.logFulNumber = logFulNumber
self.settings = wikipedia.translate(site, page_with_settings)
self.rep_page = wikipedia.translate(site, report_page)
self.rep_text = wikipedia.translate(site, report_text)
self.com = wikipedia.translate(site, comm10)
+ # Commento = Summary in italian
+ self.commento = wikipedia.translate(self.site, comm)
def general(self, newtext, image, notification, head, botolist):
- """ This class can be called for two reason. So I need two different __init__, one with common data
- and another with the data that I required... maybe it can be added on the other function, but in this way
- seems more clear what parameters I need
- """
+ """ This class can be called for two reason. So I need two different constructors, one with common data
+ and another with the data that I required... maybe it can be added on the other function, but in this way
+ seems more clear what parameters I need """
self.newtext = newtext
self.image = image
self.head = head
self.notification = notification
self.botolist = botolist
def put_mex(self, put = True):
- commento = wikipedia.translate(self.site, comm)
- # Adding no source. - I'm sure that the image exists, double check... but another can't be useless.
+ """ Function to add the template in the image and to find out
+ who's the user that has uploaded the image. """
+ # Defing the image's Page Object
p = wikipedia.ImagePage(self.site, 'Image:%s' % self.image)
+ # Get the image's description
try:
testoa = p.get()
except wikipedia.NoPage:
wikipedia.output(u'%s has been deleted...' % p.title())
# We have a problem! Report and exit!
return False
+ # You can use this function also to find only the user that
+ # has upload the image (FixME: Rewrite a bit this part)
if put:
- p.put(testoa + self.newtext, comment = commento, minorEdit = True)
+ p.put(testoa + self.newtext, comment = self.commento, minorEdit = True)
image_n = self.site.image_namespace()
image_namespace = "%s:" % image_n # Example: "User_talk:"
# paginetta it's the image page object.
@@ -398,10 +405,10 @@
if talk_page.exists():
testoattuale = talk_page.get()
# Find out the list of Bots that add no source tags.
- lang = config.mylang
+ lang = site.lang
# Standard language
self.lang = lang
- project = config.family
+ project = site.family.name
bot = config.usernames[project]
botnick = bot[lang]
botolist = self.botolist + [botnick]
@@ -718,10 +725,6 @@
# Define the site.
site = wikipedia.getSite()
-
- # In this way i find what language, project and what bot do you use.
- lang = config.mylang
- project = config.family
# Block of text to translate the parameters set above.
image_n = site.image_namespace()
@@ -755,7 +758,7 @@
notallowed = ("xcf", "xls", "sxw", "sxi", "sxc", "sxd")
# A little block-statement to ensure that the bot will not start with en-parameters
- if lang not in project_inserted:
+ if site.lang not in project_inserted:
wikipedia.output(u"Your project is not supported by this script. You have to edit the script and add it!")
wikipedia.stopme()
# Some formatting for delete immediately template
@@ -902,7 +905,8 @@
some_problem = False # If it has "some_problem" it must check
# the additional settings.
# if tupla_writte, use addictional settings
- if tupla_written != None:
+ if tupla_written != None:
+ # In every tupla there's a setting configuration
for tupla in tupla_written:
name = tupla[1]
find_tipe = tupla[2]
@@ -987,23 +991,15 @@
continue
elif g in nothing:
wikipedia.output(u"The image description for %s does not contain a license template!" % imageName)
- if lang == 'commons':
- head = nh % imageName
- notification = nn
- else:
- notification = nn % imageName
- head = nh
- report(unvertext, imageName, notification, head, smwl)
+ notification = nn % imageName
+ head = nh
+ #report(unvertext, imageName, notification, head, smwl)
continue
else:
wikipedia.output(u"%s has only text and not the specific license..." % imageName)
- if lang == 'commons':
- head = nh % imageName
- notification = nn
- else:
- notification = nn % imageName
- head = nh
- report(unvertext, imageName, notification, head, smwl)
+ notification = nn % imageName
+ head = nh
+ #report(unvertext, imageName, notification, head, smwl)
continue
# A little block to perform the repeat or to break.
if repeat == True:
Patches item #1885724, was opened at 2008-02-03 14:56
Message generated for change (Comment added) made by filnik
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=1885724&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: Accepted
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Norwegian translation for cosmetic_changes.p
Initial Comment:
Norwegian translation for edit summary in cosmetic_changes.py
----------------------------------------------------------------------
>Comment By: Filnik (filnik)
Date: 2008-02-03 15:10
Message:
Logged In: YES
user_id=1834469
Originator: NO
Added with italian translation in rev 4960. Filnik
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=1885724&group_…
Patches item #1885724, was opened at 2008-02-03 06:56
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=1885724&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: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Norwegian translation for cosmetic_changes.p
Initial Comment:
Norwegian translation for edit summary in cosmetic_changes.py
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=1885724&group_…
Bugs item #1882680, was opened at 2008-01-30 15:43
Message generated for change (Comment added) made by nicdumz
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1882680&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: Purodha B Blissenbach (purodha)
Assigned to: Nobody/Anonymous (nobody)
Summary: namespace treatment error in interwiki.py
Initial Comment:
interwiki.py has an error treating page names with colons, see here:
python interwiki.py -putthrottle:60 -lang:ksh -start:Category:Wikipedia:Medmaacher
Checked for running processes. 1 processes currently running, including the current process.
NOTE: Number of pages queued is 0, trying to add 60 more.
Retrieving Allpages special page for wikipedia:ksh from Medmaacher, namespace 14
Getting 60 pages from wikipedia:ksh...
[[Saachjrupp:Meer]]: [[ksh:Saachjrupp:Meer]] gives new interwiki [[de:Kategorie:Meere]]
...
The starting page requested was "Category:Wikipedia:Medmaacher", it reports it was starting with "Medmaacher" in namespace 14, that is "Category:Medmaacher", which it acually does start with.
As far as I can tell, parameter handling seems to be correct, so my guess is the problem is likely caused in the page generator.
----------------------------------------------------------------------
Comment By: Nicolas Dumazet (nicdumz)
Date: 2008-02-03 14:16
Message:
Logged In: YES
user_id=1963242
Originator: NO
Okay. I need to learn to read. Sorry :(
----------------------------------------------------------------------
Comment By: Nicolas Dumazet (nicdumz)
Date: 2008-02-03 13:50
Message:
Logged In: YES
user_id=1963242
Originator: NO
Which version are you using ?
I get :
python interwiki.py -lang:ksh -start:Category:Wikipedia:Medmaacher
Checked for running processes. 3 processes currently running, including
the current process.
NOTE: Number of pages queued is 0, trying to add 60 more.
Retrieving Allpages special page for wikipedia:ksh from
Wikipedia%3AMedmaacher, namespace 14
Getting 60 pages from wikipedia:ksh...
Try updating... !
----------------------------------------------------------------------
Comment By: Rotem Liss (rotemliss)
Date: 2008-01-30 17:58
Message:
Logged In: YES
user_id=1327030
Originator: NO
Fixed in r4951.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1882680&group_…