Revision: 4214
Author: wikipedian
Date: 2007-09-08 11:23:23 +0000 (Sat, 08 Sep 2007)
Log Message:
-----------
bugfix: cosmetic_changes was removing spaces that were used to structure
template parameters
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2007-09-08 00:50:29 UTC (rev 4213)
+++ trunk/pywikipedia/wikipedia.py 2007-09-08 11:23:23 UTC (rev 4214)
@@ -2577,7 +2577,7 @@
'table': re.compile(r'(?ims)^{\|.*?^\|}|<table>.*?</table>'),
# templates with parameters often have whitespace that is used to
# improve wiki source code readability.
- 'template': re.compile(r'(?s)^{{.*?}}'),
+ 'template': re.compile(r'(?s){{.*?}}'),
}
# if we got a string, compile it as a regular expression
Revision: 4213
Author: wikipedian
Date: 2007-09-08 00:50:29 +0000 (Sat, 08 Sep 2007)
Log Message:
-----------
place spaces after bullet in lists/enumerations
Modified Paths:
--------------
trunk/pywikipedia/cosmetic_changes.py
Modified: trunk/pywikipedia/cosmetic_changes.py
===================================================================
--- trunk/pywikipedia/cosmetic_changes.py 2007-09-08 00:50:06 UTC (rev 4212)
+++ trunk/pywikipedia/cosmetic_changes.py 2007-09-08 00:50:29 UTC (rev 4213)
@@ -85,6 +85,7 @@
text = self.standardizeCategories(text)
text = self.cleanUpLinks(text)
text = self.cleanUpSectionHeaders(text)
+ text = self.putSpacesInLists(text)
text = self.translateAndCapitalizeNamespaces(text)
text = self.removeDeprecatedTemplates(text)
text = self.resolveHtmlEntities(text)
@@ -280,11 +281,32 @@
return text
def cleanUpSectionHeaders(self, text):
+ """
+ For better readability of section header source code, puts a space
+ between the equal signs and the title.
+ Example: ==Section title== becomes == Section title ==
+
+ NOTE: This space is recommended in the syntax help on the English and
+ German Wikipedia. It might be that it is not wanted on other wikis.
+ If there are any complaints, please file a bug report.
+ """
for level in range(1, 7):
equals = '=' * level
text = wikipedia.replaceExcept(text, r'\n' + equals + ' *(?P<title>[^=]+?) *' + equals + ' *\r\n', '\n' + equals + ' \g<title> ' + equals + '\r\n', ['comment', 'math', 'nowiki', 'pre'])
return text
+ def putSpacesInLists(self, text):
+ """
+ For better readability of bullet list and enumeration wiki source code,
+ puts a space between the * or # and the text.
+
+ NOTE: This space is recommended in the syntax help on the English, German,
+ and French Wikipedia. It might be that it is not wanted on other wikis.
+ If there are any complaints, please file a bug report.
+ """
+ text = wikipedia.replaceExcept(text, r'(?m)^(?P<bullet>(\*+|#+):*)(?P<char>[^\s\*#:].+?)', '\g<bullet> \g<char>', ['comment', 'math', 'nowiki', 'pre'])
+ return text
+
def removeDeprecatedTemplates(self, text):
if deprecatedTemplates.has_key(self.site.family.name) and deprecatedTemplates[self.site.family.name].has_key(self.site.lang):
for template in deprecatedTemplates[self.site.family.name][self.site.lang]:
Bugs item #1790289, was opened at 2007-09-07 17:54
Message generated for change (Comment added) made by wikipedian
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1790289&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: interwiki
Group: None
Status: Open
Resolution: None
Priority: 1
Private: No
Submitted By: André Malafaya Baptista (malafaya)
Assigned to: Nobody/Anonymous (nobody)
Summary: Add disambiguation template for Polish
Initial Comment:
When processing Wikipedia article [[en:RSS]], link to [[pl:RSS]] was found. Although, this Polish article is a disambiguation page marked with {{DisambigR}} which is not contemplated in wikipedia_family.py for disambiguation templates. Therefore, I would get a duplicated link to [[pl:]] and processing would abort. By ignoring [[pl:RSS]] I managed to process the article.
Plase add DisambigR to the Polish disambiguation templates:
'pl': [u'Disambig', u'DisambRulers', u'DisambigC', u'Strona ujednoznaczniająca', u'DisambigR'],
in line 433 of wikipedia_family.py.
Thanks.
----------------------------------------------------------------------
>Comment By: Daniel Herding (wikipedian)
Date: 2007-09-08 00:54
Message:
Logged In: YES
user_id=880694
Originator: NO
I also think this is more like {{otheruses}} on en:, not a template for
disambiguation pages.
BTW, Can we remove DisambRulers and DisambigC? They seem to have been
deleted.
----------------------------------------------------------------------
Comment By: André Malafaya Baptista (malafaya)
Date: 2007-09-07 18:06
Message:
Logged In: YES
user_id=1037345
Originator: YES
I'm not so sure about this:
it seems another page exists in Polish [[pl:RSS (ujednoznaczniająca)]]
which is the *real* disambiguation page. The one above [[pl:RSS]] is
another kind of "more specific" disambiguation page, only for informatic
terms...
Maybe it's better not to do anything until further information is
obtained.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1790289&group_…
Bugs item #1790473, was opened at 2007-09-08 00:50
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=1790473&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: 7
Private: No
Submitted By: Daniel Herding (wikipedian)
Assigned to: Nobody/Anonymous (nobody)
Summary: Interwiki bot overwrites changes, no edit conflict
Initial Comment:
This has recently happened:
http://de.wikipedia.org/w/index.php?title=Wiki&diff=36448315&oldid=36447898
The only reason I can think of is some obscure error with starttime/edittime/tokens/stuff like that.
Maybe this assumption in GetAll doesn't always work as expected?
# There's no possibility to read the wpStarttime argument from the XML.
# It is this time that the MediaWiki software uses to check for edit
# conflicts. We take the earliest time later than the last edit, which
# seems to be the safest possible time.
page2._startTime = str(int(timestamp)+1)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1790473&group_…
Revision: 4211
Author: valhallasw
Date: 2007-09-07 22:25:35 +0000 (Fri, 07 Sep 2007)
Log Message:
-----------
* Removed old zh-classic hack
* Added new zh-classic hack: if the zh-classic language is not found in the family file, fall back to 'zh-classical'.
Modified Paths:
--------------
trunk/pywikipedia/families/wikipedia_family.py
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/families/wikipedia_family.py
===================================================================
--- trunk/pywikipedia/families/wikipedia_family.py 2007-09-07 15:38:40 UTC (rev 4210)
+++ trunk/pywikipedia/families/wikipedia_family.py 2007-09-07 22:25:35 UTC (rev 4211)
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
import urllib
import family, config
@@ -22,8 +22,6 @@
'tokipona':'tokipona.wikipedia.org',
'zh-cn':'zh.wikipedia.org',
'zh-tw':'zh.wikipedia.org',
- 'zh-classic': 'zh-classical.wikipedia.org'
- # database thinks 'zh-classical' is 'zh-classic' as field type is varchar(10)
}
for lang in self.knownlanguages:
if lang not in self.langs:
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2007-09-07 15:38:40 UTC (rev 4210)
+++ trunk/pywikipedia/wikipedia.py 2007-09-07 22:25:35 UTC (rev 4211)
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Library to get and put pages on a MediaWiki.
@@ -242,7 +242,7 @@
site = getSite()
elif type(site) in [type(''), type(u'')]:
site = getSite(site)
-
+
self._site = site
if not insite:
@@ -3144,8 +3144,13 @@
self.family = Family(fam, fatal = False)
else:
self.family = fam
+
if self.lang not in self.languages():
- raise KeyError("Language %s does not exist in family %s"%(self.lang,self.family.name))
+ if self.lang == 'zh-classic' and 'zh-classical' in self.languages():
+ self.lang = 'zh-classical'
+ # ev0l database hack (database is varchar[10] -> zh-classical is cut to zh-classic.
+ else:
+ raise KeyError("Language %s does not exist in family %s"%(self.lang,self.family.name))
# if we got an outdated language code, use the new one instead.
if self.lang in self.family.obsolete and self.family.obsolete[self.lang]:
@@ -4439,9 +4444,6 @@
return ['be','be-x-old','ru']
if code in ['kk','ky','tk']:
return ['tr','ru']
- if code == 'zh-classic':
- # the database uses 'zh-classic' instead of 'zh-classical' as the field is varchar(10)
- return ['zh-classical','zh','zh-cn','zh-tw']
if code in ['diq','ug','uz']:
return ['tr']
if code in ['ja','minnan','zh','zh-cn']:
Bugs item #1790289, was opened at 2007-09-07 16:54
Message generated for change (Settings changed) made by malafaya
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1790289&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: interwiki
Group: None
Status: Open
Resolution: None
>Priority: 1
Private: No
Submitted By: André Malafaya Baptista (malafaya)
Assigned to: Nobody/Anonymous (nobody)
Summary: Add disambiguation template for Polish
Initial Comment:
When processing Wikipedia article [[en:RSS]], link to [[pl:RSS]] was found. Although, this Polish article is a disambiguation page marked with {{DisambigR}} which is not contemplated in wikipedia_family.py for disambiguation templates. Therefore, I would get a duplicated link to [[pl:]] and processing would abort. By ignoring [[pl:RSS]] I managed to process the article.
Plase add DisambigR to the Polish disambiguation templates:
'pl': [u'Disambig', u'DisambRulers', u'DisambigC', u'Strona ujednoznaczniająca', u'DisambigR'],
in line 433 of wikipedia_family.py.
Thanks.
----------------------------------------------------------------------
Comment By: André Malafaya Baptista (malafaya)
Date: 2007-09-07 17:06
Message:
Logged In: YES
user_id=1037345
Originator: YES
I'm not so sure about this:
it seems another page exists in Polish [[pl:RSS (ujednoznaczniająca)]]
which is the *real* disambiguation page. The one above [[pl:RSS]] is
another kind of "more specific" disambiguation page, only for informatic
terms...
Maybe it's better not to do anything until further information is
obtained.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1790289&group_…
Bugs item #1790289, was opened at 2007-09-07 16:54
Message generated for change (Comment added) made by malafaya
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1790289&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: interwiki
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: André Malafaya Baptista (malafaya)
Assigned to: Nobody/Anonymous (nobody)
Summary: Add disambiguation template for Polish
Initial Comment:
When processing Wikipedia article [[en:RSS]], link to [[pl:RSS]] was found. Although, this Polish article is a disambiguation page marked with {{DisambigR}} which is not contemplated in wikipedia_family.py for disambiguation templates. Therefore, I would get a duplicated link to [[pl:]] and processing would abort. By ignoring [[pl:RSS]] I managed to process the article.
Plase add DisambigR to the Polish disambiguation templates:
'pl': [u'Disambig', u'DisambRulers', u'DisambigC', u'Strona ujednoznaczniająca', u'DisambigR'],
in line 433 of wikipedia_family.py.
Thanks.
----------------------------------------------------------------------
>Comment By: André Malafaya Baptista (malafaya)
Date: 2007-09-07 17:06
Message:
Logged In: YES
user_id=1037345
Originator: YES
I'm not so sure about this:
it seems another page exists in Polish [[pl:RSS (ujednoznaczniająca)]]
which is the *real* disambiguation page. The one above [[pl:RSS]] is
another kind of "more specific" disambiguation page, only for informatic
terms...
Maybe it's better not to do anything until further information is
obtained.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1790289&group_…