Hi! I¹m not sure whether this is the right way to post a message to the
list, my experience with mailing lists is ehh... absent. ;)
Yesterday, when SUL became available for all users, Special:Log/newusers was
flooded with new usernames created automatically. I run a welcome.py bot and
I discovered that the bot welcomes all the automatically created users as
well, i.e. giving welcome messages to people that don¹t even know the
language. That¹s a waste. Would it be possible to do one of the following
things?
1. Making the bot see the difference between automatically created users
and ignoring them
2. Making the bot see the difference between automatically created users
and give them a separate welcome template
Thanks!
[[w:no:user:H92]]
Bugs item #1977131, was opened at 2008-05-28 23:16
Message generated for change (Comment added) made by nicdumz
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1977131&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: Andre Engels (a_engels)
>Assigned to: NicDumZ — Nicolas Dumazet (nicdumz)
Summary: sk: lacking in family.alphabetic
Initial Comment:
The language sk: is not in the list at family.alphabetic.
----------------------------------------------------------------------
>Comment By: NicDumZ — Nicolas Dumazet (nicdumz)
Date: 2008-05-28 23:29
Message:
Logged In: YES
user_id=1963242
Originator: NO
ahah, I first thought that you were wrong, sk WAS is the family file.
However, it was ' sk', with the space. Typo fixed in r5458 :)
Thanks !
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1977131&group_…
Bugs item #1977131, was opened at 2008-05-28 23:16
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1977131&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: Andre Engels (a_engels)
Assigned to: Nobody/Anonymous (nobody)
Summary: sk: lacking in family.alphabetic
Initial Comment:
The language sk: is not in the list at family.alphabetic.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1977131&group_…
Revision: 5456
Author: russblau
Date: 2008-05-28 20:32:28 +0000 (Wed, 28 May 2008)
Log Message:
-----------
siteinfo changes
Modified Paths:
--------------
branches/rewrite/pywikibot/family.py
branches/rewrite/pywikibot/site.py
Modified: branches/rewrite/pywikibot/family.py
===================================================================
--- branches/rewrite/pywikibot/family.py 2008-05-28 17:01:40 UTC (rev 5455)
+++ branches/rewrite/pywikibot/family.py 2008-05-28 20:32:28 UTC (rev 5456)
@@ -2775,11 +2775,18 @@
# Which version of MediaWiki is used?
def version(self, code):
+ """Return MediaWiki version number as a string."""
# Don't use this, use versionnumber() instead. This only exists
# to not break family files.
return "1.12alpha"
def versionnumber(self, code):
+ """Return an int identifying MediaWiki version.
+
+ Currently this is implemented as returning the minor version
+ number; i.e., 'X' in version '1.X.Y'
+
+ """
R = re.compile(r"(\d+).(\d+)")
M = R.search(self.version(code))
if not M:
Modified: branches/rewrite/pywikibot/site.py
===================================================================
--- branches/rewrite/pywikibot/site.py 2008-05-28 17:01:40 UTC (rev 5455)
+++ branches/rewrite/pywikibot/site.py 2008-05-28 20:32:28 UTC (rev 5456)
@@ -108,7 +108,6 @@
"""Return this Site's throttle. Initialize a new one if needed."""
if not hasattr(self, "_throttle"):
self._throttle = Throttle(self, multiplydelay=True, verbosedelay=True)
- self.getsiteinfo()
try:
self.login(False)
except pywikibot.NoUsername:
@@ -387,6 +386,8 @@
def login(self, sysop=False):
"""Log the user in if not already logged in."""
+ if not hasattr(self, "_siteinfo"):
+ self._getsiteinfo()
if not self.logged_in(sysop):
loginMan = api.LoginManager(site=self, sysop=sysop)
if loginMan.login(retry = True):
@@ -436,64 +437,72 @@
result = r.submit()
return re.search('\d+', result['parse']['text']['*']).group()
- def getsiteinfo(self):
- """Retrieve siteinfo from site and store in _siteinfo attribute."""
- if not hasattr(self, "_siteinfo"):
+ def _getsiteinfo(self):
+ """Retrieve siteinfo and namespaces from site."""
+ sirequest = api.Request(
+ site=self,
+ action="query",
+ meta="siteinfo",
+ siprop="general|namespaces|namespacealiases"
+ )
+ try:
+ sidata = sirequest.submit()
+ except api.APIError:
+ # hack for older sites that don't support 1.12 properties
+ # probably should delete if we're not going to support pre-1.12
sirequest = api.Request(
site=self,
action="query",
meta="siteinfo",
- siprop="general|namespaces|namespacealiases"
+ siprop="general|namespaces"
)
- try:
- sidata = sirequest.submit()
- except api.APIError:
- # hack for older sites that don't support 1.12 properties
- # probably should delete if we're not going to support pre-1.12
- sirequest = api.Request(
- site=self,
- action="query",
- meta="siteinfo",
- siprop="general|namespaces"
- )
- sidata = sirequest.submit()
+ sidata = sirequest.submit()
- assert 'query' in sidata, \
- "API siteinfo response lacks 'query' key"
- sidata = sidata['query']
- assert 'general' in sidata, \
- "API siteinfo response lacks 'general' key"
- assert 'namespaces' in sidata, \
- "API siteinfo response lacks 'namespaces' key"
- self._siteinfo = sidata['general']
- nsdata = sidata['namespaces']
- for nskey in nsdata:
- ns = int(nskey)
- if ns in self._namespaces:
- if nsdata[nskey]["*"] in self._namespaces[ns]:
- continue
- # this is the preferred form so it goes at front of list
- self._namespaces[ns].insert(0, nsdata[nskey]["*"])
- else:
- self._namespaces[ns] = [nsdata[nskey]["*"]]
- if 'namespacealiases' in sidata:
- aliasdata = sidata['namespacealiases']
- for item in aliasdata:
- # this is a less preferred form so it goes at the end
- self._namespaces[int(item['id'])].append(item["*"])
+ assert 'query' in sidata, \
+ "API siteinfo response lacks 'query' key"
+ sidata = sidata['query']
+ assert 'general' in sidata, \
+ "API siteinfo response lacks 'general' key"
+ assert 'namespaces' in sidata, \
+ "API siteinfo response lacks 'namespaces' key"
+ self._siteinfo = sidata['general']
+ nsdata = sidata['namespaces']
+ for nskey in nsdata:
+ ns = int(nskey)
+ if ns in self._namespaces:
+ if nsdata[nskey]["*"] in self._namespaces[ns]:
+ continue
+ # this is the preferred form so it goes at front of list
+ self._namespaces[ns].insert(0, nsdata[nskey]["*"])
+ else:
+ self._namespaces[ns] = [nsdata[nskey]["*"]]
+ if 'namespacealiases' in sidata:
+ aliasdata = sidata['namespacealiases']
+ for item in aliasdata:
+ if item["*"] in self._namespaces[int(item['id'])]:
+ continue
+ # this is a less preferred form so it goes at the end
+ self._namespaces[int(item['id'])].append(item["*"])
+
+ @property
+ def siteinfo(self):
+ """Site information dict."""
+ if not hasattr("_siteinfo"):
+ self._getsiteinfo()
return self._siteinfo
def case(self):
- return self.getsiteinfo()['case']
+ return self.siteinfo['case']
def language(self):
"""Return the code for the language of this Site."""
# N.B. this code may or may not be the same as self.code
- return self.getsiteinfo()['lang']
+ return self.siteinfo['lang']
def namespaces(self):
"""Return dict of valid namespaces on this wiki."""
- self.getsiteinfo()
+ if not hasattr(self, "_siteinfo"):
+ self._getsiteinfo()
return self._namespaces
def namespace(self, num, all=False):
@@ -2562,19 +2571,6 @@
'.*?\[\[(.*?)(?:\|.*?)?\]\]',
re.IGNORECASE | re.UNICODE | re.DOTALL)
- def version(self):
- """Return MediaWiki version number as a string."""
- return self.family.version(self.code)
-
- def versionnumber(self):
- """Return an int identifying MediaWiki version.
-
- Currently this is implemented as returning the minor version
- number; i.e., 'X' in version '1.X.Y'
-
- """
- return self.family.versionnumber(self.code)
-
def live_version(self):
"""Return the 'real' version number found on [[Special:Version]]
Revision: 5455
Author: multichill
Date: 2008-05-28 17:01:40 +0000 (Wed, 28 May 2008)
Log Message:
-----------
getLatestUploader() and new url toolserver to get things working again
Modified Paths:
--------------
trunk/pywikipedia/imagecopy.py
Modified: trunk/pywikipedia/imagecopy.py
===================================================================
--- trunk/pywikipedia/imagecopy.py 2008-05-28 14:34:15 UTC (rev 5454)
+++ trunk/pywikipedia/imagecopy.py 2008-05-28 17:01:40 UTC (rev 5455)
@@ -130,7 +130,7 @@
# tosend[k]=tosend[k].encode('utf-8')
tosend=urllib.urlencode(tosend)
print tosend
- CH=pageTextPost('http://tools.wikimedia.de/~magnus/commonshelper.php', tosend)
+ CH=pageTextPost('http://www.toolserver.org/~magnus/commonshelper.php', tosend)
print 'Got CH desc.'
wikipedia.output(CH);
tablock=CH.split('<textarea ')[1].split('>')[0]
@@ -303,7 +303,7 @@
skip = True
else:
# The first upload is last in the list.
- (datetime, username, resolution, size, comment) = imagepage.getFileVersionHistory().pop()
+ username = imagepage.getLatestUploader()
while True:
# Do the Tkdialog to accept/reject and change te name