Hello everyone.
I think this is related to reported bugs.
In Japanese Wikipedia, I'm using two accounts; "Mizusumashi" and
"MizusumashiBot". I was able to login by "Mizusumashi" using login.py,
but not by "MizusumashiBot".
Now, after setting "use_api_login" as "True" in config.py, I can login
by both accounts.
I'm sorry for my poor English. Thank you.
----
[[w:ja:mizusumashi]]
Hi everyone,
Could anyone tell me why FancyURLopener was replaced by this?
MyURLopener = urllib2.build_opener(U2RedirectHandler)
MyURLopener.add_handler(proxyHandler)
MyURLopener.add_handler(proxyAuthHandler)
MyURLopener.add_handler(authhandler)
MyURLopener.addheaders = [('User-agent', useragent)]
>From http://docs.python.org/library/urllib.html#urllib.FancyURLopener :
FancyURLopener subclasses URLopener providing default handling for the
following HTTP response codes: 301, 302, 303, 307 and 401. For the 30x
response codes listed above, the Location header is used to fetch the
actual URL. For 401 response codes (authentication required), basic HTTP
authentication is performed. For the 30x response codes, recursion is
bounded by the value of the maxtries attribute, which defaults to 10.
Maarten
> * remove zh namespaces (The chinese ns is only alias)
- now is back bug 2897103 when are found two different pages, but
only one exists
JAn
2009/11/19 <alexsh(a)svn.wikimedia.org>:
> Revision: 7669
> Author: alexsh
> Date: 2009-11-19 07:41:45 +0000 (Thu, 19 Nov 2009)
>
> Log Message:
> -----------
> * re-sort language_by_size by wikimedia_sites.py
> * remove zh namespaces (The chinese ns is only alias)
>
> Modified Paths:
> --------------
> trunk/pywikipedia/families/commons_family.py
> trunk/pywikipedia/families/wikibooks_family.py
> trunk/pywikipedia/families/wikinews_family.py
> trunk/pywikipedia/families/wikipedia_family.py
> trunk/pywikipedia/families/wikiquote_family.py
> trunk/pywikipedia/families/wikisource_family.py
> trunk/pywikipedia/families/wiktionary_family.py
>
--
--
Ing. Jan Dudík
alexsh(a)svn.wikimedia.org schreef:
> Revision: 7649
> Author: alexsh
> Date: 2009-11-15 13:13:48 +0000 (Sun, 15 Nov 2009)
>
> Log Message:
> -----------
> sorry, forget to fix it.
>
> Modified Paths:
> --------------
> trunk/pywikipedia/upload.py
That didn't fix it alexsh. I still get all sorts of errors.
For example when running "imagecopy.py -lang:nl -family:wikipedia
-page:Bestand:Overzicht_theater_Mytilini.jpg"
I get:
Traceback (most recent call last):
File "C:\Program Files\Python25\lib\threading.py", line 460, in
__bootstrap
self.run()
File "D:\Wikipedia\pywikipedia\imagecopy.py", line 361, in run
bot.run()
File "D:\Wikipedia\pywikipedia\upload.py", line 387, in run
return self.upload_image()
File "D:\Wikipedia\pywikipedia\upload.py", line 224, in upload_image
return self._uploadImageOld(debug)
File "D:\Wikipedia\pywikipedia\upload.py", line 292, in _uploadImageOld
self.read_file_content()
File "D:\Wikipedia\pywikipedia\upload.py", line 113, in read_file_content
file = uo.open(self.url)
File "C:\Program Files\Python25\lib\urllib2.py", line 380, in open
response = meth(req, response)
File "C:\Program Files\Python25\lib\urllib2.py", line 491, in
http_response
'http', request, response, code, msg, hdrs)
File "C:\Program Files\Python25\lib\urllib2.py", line 418, in error
return self._call_chain(*args)
File "C:\Program Files\Python25\lib\urllib2.py", line 353, in _call_chain
result = func(*args)
File "C:\Program Files\Python25\lib\urllib2.py", line 499, in
http_error_defau
lt
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden
Did you do a test upload?
With the flickr bot I get 411 errors.
Maarten
I can't get one of my bots ([[User:MedcabBot]]) to log in.
When invoking login.py I get the traceback below.
Any ideas why? When I change the usernames line to:
usernames['wikipedia']['en'] = 'MiszaBot'
it works, but not with 'MedcabBot'.
Regards,
Misza
misza13@nightshade:~/bots/medcabbot python ~/pywikipedia/login.py
Password for user MedcabBot on wikipedia:en:
Logging in to wikipedia:en as MedcabBot
Result: 411 Length Required
Traceback (most recent call last):
File "/home/misza13/pywikipedia/login.py", line 388, in <module>
main()
File "/home/misza13/pywikipedia/login.py", line 384, in main
loginMan.login()
File "/home/misza13/pywikipedia/login.py", line 273, in login
cookiedata = self.getCookie(api)
File "/home/misza13/pywikipedia/login.py", line 169, in getCookie
response, data = self.site.postData(address,
self.site.urlEncode(predata), sysop=self.sysop)
File "/home/misza13/pywikipedia/wikipedia.py", line 5451, in postData
f = MyURLopener.open(request)
File "/usr/lib/python2.5/urllib2.py", line 387, in open
response = meth(req, response)
File "/usr/lib/python2.5/urllib2.py", line 498, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.5/urllib2.py", line 419, in error
result = self._call_chain(*args)
File "/usr/lib/python2.5/urllib2.py", line 360, in _call_chain
result = func(*args)
File "/usr/lib/python2.5/urllib2.py", line 582, in http_error_302
return self.parent.open(new)
File "/usr/lib/python2.5/urllib2.py", line 387, in open
response = meth(req, response)
File "/usr/lib/python2.5/urllib2.py", line 498, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.5/urllib2.py", line 425, in error
return self._call_chain(*args)
File "/usr/lib/python2.5/urllib2.py", line 360, in _call_chain
result = func(*args)
File "/usr/lib/python2.5/urllib2.py", line 506, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 411: Length Required
Hello,
could someone add the translation of "cosmetic_changes" for
br.wikipedia ? The translation is "Kemm dister"
Thanks
Hercule
_________________________________________________________________
Tchattez en direct en en vidéo avec vos amis !
http://www.windowslive.fr/messenger/
I posted this yesterday about 15 hours ago and don't see it yet, so I'm
reposting:
I'm new to anything Python related. I downloaded pywikimedia yesterday and
am trying to get this to work.
This is my dump from
api.php?action=query&meta=siteinfo&siprop=general|namespaces|namespacealiases|statistics
[QUOTE]
<?xml version="1.0"?>
<api>
<query>
<general mainpage="Main Page" base=
"http://www.locksmithwiki.com/lockwiki/index.php/Main_Page"<http://www.locksmithwiki.com/lockwiki/index.php/Main_Page>sitename="Locksmith
Wiki Knowledge Base" generator="MediaWiki 1.15.1"
case="first-letter" rights="" lang="en" fallback8bitEncoding="windows-1252"
writeapi="" timezone="UTC" timeoffset="0" />
<namespaces>
<ns id="-2" canonical="Media" xml:space="preserve">Media</ns>
<ns id="-1" canonical="Special" xml:space="preserve">Special</ns>
<ns id="0" xml:space="preserve" />
<ns id="1" subpages="" canonical="Talk" xml:space="preserve">Talk</ns>
<ns id="2" subpages="" canonical="User" xml:space="preserve">User</ns>
<ns id="3" subpages="" canonical="User talk" xml:space="preserve">User
talk</ns>
<ns id="4" canonical="Project" xml:space="preserve">Locksmith Wiki
Knowledge Base</ns>
<ns id="5" subpages="" canonical="Project talk"
xml:space="preserve">Locksmith Wiki Knowledge Base talk</ns>
<ns id="6" canonical="File" xml:space="preserve">File</ns>
<ns id="7" subpages="" canonical="File talk" xml:space="preserve">File
talk</ns>
<ns id="8" canonical="MediaWiki" xml:space="preserve">MediaWiki</ns>
<ns id="9" subpages="" canonical="MediaWiki talk"
xml:space="preserve">MediaWiki talk</ns>
<ns id="10" canonical="Template" xml:space="preserve">Template</ns>
<ns id="11" subpages="" canonical="Template talk"
xml:space="preserve">Template talk</ns>
<ns id="12" canonical="Help" xml:space="preserve">Help</ns>
<ns id="13" subpages="" canonical="Help talk"
xml:space="preserve">Help talk</ns>
<ns id="14" canonical="Category" xml:space="preserve">Category</ns>
<ns id="15" subpages="" canonical="Category talk"
xml:space="preserve">Category talk</ns>
</namespaces>
<namespacealiases>
<ns id="6" xml:space="preserve">Image</ns>
<ns id="7" xml:space="preserve">Image talk</ns>
</namespacealiases>
<statistics pages="8930" articles="3406" views="87415" edits="15885"
images="760" users="264" activeusers="1" admins="2" jobs="0" />
</query>
</api>
[/QUOTE]
This is my current "lockwiki_family.py" file (I removed the commented out
lines):
[QUOTE]
# -*- coding: utf-8 -*- # REQUIRED
import config, family, urllib # REQUIRED
class Family(family.Family): # REQUIRED
def __init__(self): # REQUIRED
family.Family.__init__(self) # REQUIRED
self.name = 'Locksmith Wiki Knowledge Base' # REQUIRED;
replace with actual name
self.langs = { # REQUIRED
'en': 'www.locksmithwiki.com', # Include one line for each wiki
in family
}
self.namespaces[4] = {
'_default': [u'Locksmith Wiki Knowledge Base',
self.namespaces[4]['_default']], # REQUIRED
}
self.namespaces[-2] = { 'en': 'Media' }
self.namespaces[-1] = { 'en': 'Special' }
self.namespaces[1] = { 'en': 'Talk' }
self.namespaces[2] = { 'en': 'User' }
self.namespaces[3] = { 'en': 'User talk' }
self.namespaces[4] = { 'en': 'Locksmith Wiki Knowledge Base' }
self.namespaces[5] = { 'en': 'Locksmith Wiki Knowledge Base talk' }
self.namespaces[6] = { 'en': 'File' }
self.namespaces[7] = { 'en': 'File talk' }
self.namespaces[8] = { 'en': 'MediaWiki' }
self.namespaces[9] = { 'en': 'MediaWiki talk' }
self.namespaces[10] = { 'en': 'Template' }
self.namespaces[11] = { 'en': 'Template talk' }
self.namespaces[12] = { 'en': 'Help' }
self.namespaces[13] = { 'en': 'Help talk' }
self.namespaces[14] = { 'en': 'Category' }
self.namespaces[15] = { 'en': 'Category talk' }
self.content_id = "bodyContent"
self.interwiki_text_separator = '\r\n\r\n'
self.interwiki_putfirst = {}
self.interwiki_putfirst_doubled = {}
self.interwiki_forward = None
self.obsolete = {}
self.category_attop = []
self.category_on_one_line = []
self.category_text_separator = '\r\n\r\n'
self.categories_last = []
def protocol(self, code):
"""
Can be overridden to return 'https'. Other protocols are not
supported.
"""
return 'http'
def scriptpath(self, code):
"""The prefix used to locate scripts on this wiki.
This is the value displayed when you enter {{SCRIPTPATH}} on a
wiki page (often displayed at [[Help:Variables]] if the wiki has
copied the master help page correctly).
The default value is the one used on Wikimedia Foundation wikis,
but needs to be overridden in the family file for any wiki that
uses a different value.
"""
return '/lockwiki'
def apipath(self, code):
return '%s/api.php' % self.scriptpath(code)
def version(self, code):
# Replace with the actual version being run on your wiki
return '1.15.1'
def code2encoding(self, code):
"""Return the encoding for a specific language wiki"""
return 'utf-8'
[/QUOTE]
When I go to login.py the screen flashes and closes within a second.
I did have
self.name = 'Locksmith Wiki Knowledge Base' # REQUIRED;
replace with actual name
and
self.namespaces[4] = {
'_default': [u'Locksmith Wiki Knowledge Base',
self.namespaces[4]['_default']], # REQUIRED
}
set as
self.name = 'lockwiki' # REQUIRED; replace with actual name
and
self.namespaces[4] = {
'_default': [u'lockwiki', self.namespaces[4]['_default']], #
REQUIRED
}
and that let me at least enter my password, but the screen closed so quickly
I couldn't read the several lines of type that flashed up shortly
afterwards.
What am I doing wrong here?
Hello. Could someone, who has access to pywikipedia files instert to
interwiki.py bot summary translations for some new languages? I have made
requests for various wikipedia users, and they gave me translations. Some
requests still pending.
See the list of translations there:
http://lt.wikipedia.org/wiki/Naudotojas:Hugo.arg/Vertimai
Regards, User:Hugo.arg
----- Original Message -----
From: <alexsh(a)svn.wikimedia.org>
To: <pywikipedia-svn(a)lists.wikimedia.org>
Sent: Thursday, November 05, 2009 1:09 PM
Subject: [Pywikipedia-svn] SVN: [7596] trunk/pywikipedia
> Revision: 7596
> Author: alexsh
> Date: 2009-11-05 18:09:30 +0000 (Thu, 05 Nov 2009)
>
> Log Message:
> -----------
> add ignore .pyo
This seems to make a *lot* of changes that aren't described in the Log
Message!
Hi,
It seems there's a problem with userinterface_terminal.py, which gives
problems when stdout is not a terminal but, for example, a pipe.
Example:
$ python pagegenerators.py -catr:Informática
Getting [[Categoría:Informática]]...
[...and a lot of results as excepcted...]
$ python pagegenerators.py -catr:Informática | grep Getting
Getting [[Categoría:Informática]]...
$
The program terminates very early, without going into recursion or
getting any page.
Regards,
--
Santiago M. Mola
Jabber ID: cooldwind(a)gmail.com