Hello As I know (and I tested) userlib.py doesn't let block IPs. Why did you that? and How can I block almost thirty thousand IP via PWB?
On 10 November 2011 13:46, Amir Ladsgroup ladsgroup@gmail.com wrote:
As I know (and I tested) userlib.py doesn't let block IPs
What did you try, and what happened? Did you get any errors? What were they?
Why did you that?
Why do you think there was a specific reason for it? It might very well be just a bug, or a setting on your wiki.
and How can I block almost thirty thousand IP via PWB?
As far as I can tell, using userlib.py.
Merlijn
It gives me this error: raise InvalidUser("User name '%s' is invalid. IP addresses are not supported." % user['name']) and I think the reason is: """The mediawiki API does not allow IP lookups.""" (it's in the userlib.py)
On 11/10/11, Merlijn van Deen valhallasw@arctus.nl wrote:
On 10 November 2011 13:46, Amir Ladsgroup ladsgroup@gmail.com wrote:
As I know (and I tested) userlib.py doesn't let block IPs
What did you try, and what happened? Did you get any errors? What were they?
Why did you that?
Why do you think there was a specific reason for it? It might very well be just a bug, or a setting on your wiki.
and How can I block almost thirty thousand IP via PWB?
As far as I can tell, using userlib.py.
Merlijn
On 10 November 2011 14:31, Amir Ladsgroup ladsgroup@gmail.com wrote:
It gives me this error: raise InvalidUser("User name '%s' is invalid. IP addresses are not supported." % user['name'])
Using which code? And what is the *complete* stack trace (list of file names and functions) you get...?
Merlijn
using userlib.py code you must wait for full of the error code. sorry:(
On 11/10/11, Merlijn van Deen valhallasw@arctus.nl wrote:
On 10 November 2011 14:31, Amir Ladsgroup ladsgroup@gmail.com wrote:
It gives me this error: raise InvalidUser("User name '%s' is invalid. IP addresses are not supported." % user['name'])
Using which code? And what is the *complete* stack trace (list of file names and functions) you get...?
Merlijn
amir@nightshade:~$ python blockips.py User name '1.161.100.110' is invalid. IP addresses are not supported. Traceback (most recent call last): File "blockips.py", line 23, in <module> user.block(expiry="one year",reason="{{پروکسی باز}}",anon=True) File "/home/amir/userlib.py", line 383, in block if self.isBlocked() and not reBlock: File "/home/amir/userlib.py", line 121, in isBlocked self._load() File "/home/amir/userlib.py", line 96, in _load getall(self.site(), [self], force=True) File "/home/amir/userlib.py", line 540, in getall _GetAllUI(site, users, throttle, force).run() File "/home/amir/userlib.py", line 559, in run data = self.getData() File "/home/amir/userlib.py", line 595, in getData raise InvalidUser("User name '%s' is invalid. IP addresses are not supported." % user['name']) userlib.InvalidUser: User name '1.161.100.110' is invalid. IP addresses are not supported.
My code is: import re import wikipedia, userlib import query, config, codecs f=codecs.open(u"ipblock.txt",u"r",u"utf-8") aaa=f.read() f.close() rr=re.compile(u"[[(.+?)]]") site=wikipedia.getSite() for username in rr.findall(aaa): if u"." in username: user=userlib.User(site,username) user.block(expiry="one year",reason="{{پروکسی باز}}",anon=True)
On 11/10/11, Amir Ladsgroup ladsgroup@gmail.com wrote:
using userlib.py code you must wait for full of the error code. sorry:(
On 11/10/11, Merlijn van Deen valhallasw@arctus.nl wrote:
On 10 November 2011 14:31, Amir Ladsgroup ladsgroup@gmail.com wrote:
It gives me this error: raise InvalidUser("User name '%s' is invalid. IP addresses are not supported." % user['name'])
Using which code? And what is the *complete* stack trace (list of file names and functions) you get...?
Merlijn
-- Amir
On 11 November 2011 11:58, Amir Ladsgroup ladsgroup@gmail.com wrote:
(... IPs cannot be blocked using userlib ...)
I opened a bug tracker item for this at http://sourceforge.net/tracker/?func=detail&aid=3474217&group_id=931... , referring to the relevant email threads.
Best, Merlijn
pywikipedia-l@lists.wikimedia.org