lists.wikimedia.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
List overview
Download
Pywikipedia-svn
July 2010
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
pywikipedia-svn@lists.wikimedia.org
6 participants
34 discussions
Start a n
N
ew thread
SVN: [8374] trunk/pywikipedia/userinterfaces/transliteration.py
by a_engels@svn.wikimedia.org
30 Jul '10
30 Jul '10
Revision: 8374 Author: a_engels Date: 2010-07-29 18:23:33 +0000 (Thu, 29 Jul 2010) Log Message: ----------- error correction: n-dash transliterated as o instead of - Modified Paths: -------------- trunk/pywikipedia/userinterfaces/transliteration.py Modified: trunk/pywikipedia/userinterfaces/transliteration.py =================================================================== --- trunk/pywikipedia/userinterfaces/transliteration.py 2010-07-29 14:05:49 UTC (rev 8373) +++ trunk/
…
[View More]
pywikipedia/userinterfaces/transliteration.py 2010-07-29 18:23:33 UTC (rev 8374) @@ -1311,7 +1311,7 @@ self.trans[char] = u"ü" for char in u"ว": self.trans[char] = u"ua" - for char in u"อว–โิ": + for char in u"อวโิ": self.trans[char] = u"o" for char in u"ะัา": self.trans[char] = u"a"
[View Less]
1
0
0
0
SVN: [8373] trunk/pywikipedia/generate_family_file.py
by valhallasw@svn.wikimedia.org
29 Jul '10
29 Jul '10
Revision: 8373 Author: valhallasw Date: 2010-07-29 14:05:49 +0000 (Thu, 29 Jul 2010) Log Message: ----------- Major refactoring of generate_family_file.py: * changed def main() into an object * split off namespace logic to NamespaceStorage object Modified Paths: -------------- trunk/pywikipedia/generate_family_file.py Modified: trunk/pywikipedia/generate_family_file.py =================================================================== --- trunk/pywikipedia/generate_family_file.
…
[View More]
py 2010-07-29 14:04:50 UTC (rev 8372) +++ trunk/pywikipedia/generate_family_file.py 2010-07-29 14:05:49 UTC (rev 8373) @@ -1,213 +1,250 @@ -# -*- coding: utf-8 -*- -""" -This script generates a family file from a given URL. -Hackish, etc. Regexps, yes. Sorry, jwz. - -""" -__version__ = "$Id" - -# -# (C) Merlijn van Deen, 2010 -# (C) Pywikipedia bot team, 2010 -# -# Distributed under the terms of the MIT license -# - -from urllib2 import HTTPError -import urllib2 - -def urlopen(url): - req = urllib2.Request(url, headers = {'User-agent': 'Pywikipedia family generator 0.1 -
pywikipediabot.sf.net
'}) - return urllib2.urlopen(req) - -from urlparse import urlparse, ParseResult -import codecs -import sys -import re -try: - import json -except ImportError: - import simplejson as json - -# Monkey-patching wikipediatools to prevent questions about user_config.py -import wikipediatools -wikipediatools.get_base_dir = lambda: '.' -import family -STANDARDNAMESPACES = family.Family().namespaces - -def main(url=None, name=None): - if url == None: - url = raw_input("Please insert URL to wiki: ") - if name == None: - name = raw_input("Please insert a short name (eg: freeciv): ") - - wikis = {} - print "Generating family file from %s" % url - - w = Wiki(url) - wikis[w.iwpath] = w - print - print "==================================" - print "api url: %s" % w.api - print "MediaWiki version: %s" % w.version - print "==================================" - print - - print "Determining other languages...", - try: - iw = json.load(urlopen(w.api + "?action=query&meta=siteinfo&siprop=interwikimap&sifilteriw=local&format=json")) - langs = [wiki for wiki in iw['query']['interwikimap'] if u'language' in wiki] - print u' '.join(sorted([wiki[u'prefix'] for wiki in langs])) - - if raw_input("\nThere are %i languages available.\nDo you want to generate interwiki links? This might take a long time. (y/N)" % len(langs)).lower() != "y": - langs = [wiki for wiki in langs if wiki[u'url'] == w.iwpath] - except HTTPError, e: - langs = [] - print e, "; continuing..." - - if langs == []: - print "Assuming English" - langs = [{u'language': u'English', - u'local': u'', - u'prefix': u'en', - u'url': w.iwpath}] - - print "Loading wikis... " - for lang in langs: - print " * %s... " % (lang[u'prefix']), - if lang[u'url'] not in wikis: - wikis[lang[u'url']] = Wiki(lang[u'url']) - print "downloaded" - else: - print "in cache" - - print "Retrieving namespaces... ", - namespaces = {} - for w in wikis.itervalues(): - print "%s " % w.lang, - ns = json.load(urlopen(w.api + "?action=query&meta=siteinfo&siprop=namespaces&format=json"))['query']['namespaces'] - for namespace in ns: - if namespace == '0': - continue - if int(namespace) not in namespaces: - namespaces[int(namespace)] = {} - - # Better method? You're very welcome. - try: - if STANDARDNAMESPACES[int(namespace)]['_default'] != ns[namespace][u'*'] and \ - STANDARDNAMESPACES[int(namespace)][w.lang] != ns[namespace][u'*']: - raise KeyError # if the namespace name is different, act if it is undefined - except KeyError: - namespaces[int(namespace)][w.lang] = ns[namespace][u'*'] - print - - fn = "families/%s_family.py" % name - print "Writing %s... " % fn - try: - open(fn) - if raw_input("%s already exists. Overwrite? (y/n)").lower() == 'n': - print "Terminating." - sys.exit(1) - except IOError: # file not found - pass - f = codecs.open('families/%s_family.py' % name, 'w', 'utf-8') - - f.write(""" -# -*- coding: utf-8 -*- -\"\"\" -This family file was auto-generated by $Id: generate_family_file.py 8371 2010-07-29 13:29:26Z valhallasw $ -Configuration parameters: - url = %(url)s - name = %(name)s - -Please do not commit this to the SVN repository! -\"\"\" - -import family - -class Family(family.Family): - def __init__(self): - family.Family.__init__(self) - self.name = '%(name)s' - self.langs = { -""".lstrip() % {'url': url, 'name': name}) - - for w in wikis.itervalues(): - f.write(" '%(lang)s': u'%(hostname)s',\n" % {'lang': w.lang, 'hostname': urlparse(w.server).netloc}) - - f.write(" }\n\n") - - for nsid, nslangs in namespaces.iteritems(): - for lang, nsname in nslangs.iteritems(): - f.write(" self.namespaces[%(nsid)i]['%(lang)s'] = u'%(nsname)s'\n" % {'nsid': nsid, 'lang': lang, 'nsname': nsname}) - f.write("\n\n") - - f.write(" def scriptpath(self, code):\n") - f.write(" return {\n") - - for w in wikis.itervalues(): - f.write(" '%(lang)s': u'%(path)s',\n" % {'lang': w.lang, 'path': w.scriptpath}) - f.write(" }[code]\n") - f.write("\n") - - f.write(" def version(self, code):\n") - f.write(" return {\n") - for w in wikis.itervalues(): - if w.version == None: - f.write(" '%(lang)s': None,\n" % {'lang': w.lang}) - else: - f.write(" '%(lang)s': u'%(ver)s',\n" % {'lang': w.lang, 'ver': w.version}) - f.write(" }[code]\n") - - -class Wiki(object): - REwgEnableApi = re.compile(ur'wgEnableAPI ?= ?true') - REwgServer = re.compile(ur'wgServer ?= ?"([^"]*)"') - REwgScriptPath = re.compile(ur'wgScriptPath ?= ?"([^"]*)"') - REwgArticlePath = re.compile(ur'wgArticlePath ?= ?"([^"]*)"') - REwgContentLanguage = re.compile(ur'wgContentLanguage ?= ?"([^"]*)"') - REwgVersion = re.compile(ur'wgVersion ?= ?"([^"]*)"') - - def __init__(self, fromurl): - if fromurl.endswith("$1"): - fromurl = fromurl[:-2] - try: - data = urlopen(fromurl).read() - except HTTPError, e: - if e.code != 404: - raise - data = e.read() - pass - - if not self.REwgEnableApi.search(data): - print "*** WARNING: Api does not seem to be enabled on %s" % fromurl - try: - self.version = self.REwgVersion.search(data).groups()[0] - except AttributeError: - self.version = None - self.server = self.REwgServer.search(data).groups()[0] - self.scriptpath = self.REwgScriptPath.search(data).groups()[0] - self.articlepath = self.REwgArticlePath.search(data).groups()[0] - self.lang = self.REwgContentLanguage.search(data).groups()[0] - - def __cmp__(self, other): - return (self.server + self.scriptpath == other.server + other.scriptpath) - - def __hash__(self): - return hash(self.server + self.scriptpath) - - @property - def api(self): - return self.server + self.scriptpath + "/api.php" - - @property - def iwpath(self): - return self.server + self.articlepath - - -if __name__ == "__main__": - if len(sys.argv) != 3: - print "Usage: %s <url> <short name>" - print "Example: %s
http://www.mywiki.bogus/wiki/Main_Page
mywiki" - print "This will create the file families/mywiki_family.py" - main(sys.argv[1], sys.argv[2]) +# -*- coding: utf-8 -*- +""" +This script generates a family file from a given URL. +Hackish, etc. Regexps, yes. Sorry, jwz. + +""" +__version__ = "$Id" + +# +# (C) Merlijn van Deen, 2010 +# (C) Pywikipedia bot team, 2010 +# +# Distributed under the terms of the MIT license +# + +from urllib2 import HTTPError +import urllib2 + +def urlopen(url): + req = urllib2.Request(url, headers = {'User-agent': 'Pywikipedia family generator 0.1 -
pywikipediabot.sf.net
'}) + return urllib2.urlopen(req) + +from urlparse import urlparse, ParseResult +import codecs +import sys +import re +try: + import json +except ImportError: + import simplejson as json + +# Monkey-patching wikipediatools to prevent questions about user_config.py +import wikipediatools +wikipediatools.get_base_dir = lambda: '.' +import family + +class FamilyFileGenerator(object): + def __init__(self, url=None, name=None): + if url == None: + url = raw_input("Please insert URL to wiki: ") + if name == None: + name = raw_input("Please insert a short name (eg: freeciv): ") + self.base_url = url + self.name = name + + self.wikis = {} # {'
http://wiki/$1
': Wiki('
http://wiki/$1
'), ...} + self.langs = [] # [Wiki('
http://wiki/$1
'), ...] + + self.namespaces = NamespaceStorage() + + def run(self): + print "Generating family file from %s" % self.base_url + + w = Wiki(self.base_url) + self.wikis[w.iwpath] = w + print + print "==================================" + print "api url: %s" % w.api + print "MediaWiki version: %s" % w.version + print "==================================" + print + + self.getlangs(w) + self.getapis() + self.getnamespaces() + self.writefile() + + def getlangs(self, w): + print "Determining other languages...", + try: + iw = json.load(urlopen(w.api + "?action=query&meta=siteinfo&siprop=interwikimap&sifilteriw=local&format=json")) + self.langs = [wiki for wiki in iw['query']['interwikimap'] if u'language' in wiki] + print u' '.join(sorted([wiki[u'prefix'] for wiki in self.langs])) + except HTTPError, e: + self.langs = [] + print e, "; continuing..." + + if len([lang for lang in self.langs if lang['url'] == w.iwpath]) == 0: + self.langs.append({u'language': w.lang, + u'local': u'', + u'prefix': w.lang, + u'url': w.iwpath}) + + if len(self.langs) > 1 and \ + raw_input("\nThere are %i languages available.\nDo you want to generate interwiki links? This might take a long time. (y/N)" % len(self.langs)).lower() != "y": + self.langs = [wiki for wiki in langs if wiki[u'url'] == w.iwpath] + + def getapis(self): + print "Loading wikis... " + for lang in self.langs: + print " * %s... " % (lang[u'prefix']), + if lang[u'url'] not in self.wikis: + self.wikis[lang[u'url']] = Wiki(lang[u'url']) + print "downloaded" + else: + print "in cache" + + def getnamespaces(self): + print "Retrieving namespaces... ", + for w in self.wikis.itervalues(): + print "%s " % w.lang, + self.namespaces.addfromwiki(w) + print + + def writefile(self): + fn = "families/%s_family.py" % self.name + print "Writing %s... " % fn + try: + open(fn) + if raw_input("%s already exists. Overwrite? (y/n)" % fn).lower() == 'n': + print "Terminating." + sys.exit(1) + except IOError: # file not found + pass + f = codecs.open(fn, 'w', 'utf-8') + + f.write(""" +# -*- coding: utf-8 -*- +\"\"\" +This family file was auto-generated by $Id$ +Configuration parameters: + url = %(url)s + name = %(name)s + +Please do not commit this to the SVN repository! +\"\"\" + +import family + +class Family(family.Family): + def __init__(self): + family.Family.__init__(self) + self.name = '%(name)s' + self.langs = { +""".lstrip() % {'url': self.base_url, 'name': self.name}) + + for w in self.wikis.itervalues(): + f.write(" '%(lang)s': u'%(hostname)s',\n" % {'lang': w.lang, 'hostname': urlparse(w.server).netloc}) + + f.write(" }\n\n") + + f.write(self.namespaces.output(8)) + f.write("\n\n") + + f.write(" def scriptpath(self, code):\n") + f.write(" return {\n") + + for w in self.wikis.itervalues(): + f.write(" '%(lang)s': u'%(path)s',\n" % {'lang': w.lang, 'path': w.scriptpath}) + f.write(" }[code]\n") + f.write("\n") + + f.write(" def version(self, code):\n") + f.write(" return {\n") + for w in self.wikis.itervalues(): + if w.version == None: + f.write(" '%(lang)s': None,\n" % {'lang': w.lang}) + else: + f.write(" '%(lang)s': u'%(ver)s',\n" % {'lang': w.lang, 'ver': w.version}) + f.write(" }[code]\n") + +class NamespaceStorage(object): + def __init__(self): + self.nsinfo = {} + self.f = family.Family() + + def addfromwiki(self, w): + data = json.load(urlopen(w.api + "?action=query&format=json&meta=siteinfo&siprop=namespaces|namespacealiases"))['query'] + for ns in data['namespaces'].itervalues(): + self.add(ns['id'], w.lang, ns['*']) + for ns in data['namespacealiases']: + self.add(ns['id'], w.lang, ns['*']) + + def add(self, ns, lang, translation): + """ Contains logic for determining whether to define a namespace or not """ + ns = int(ns) + if ns == 0: # never translate the article namespace + return + try: + if translation not in self.f.namespace(lang, ns, all=True): # self.f.namespace might return KeyError itself + raise KeyError + except KeyError: + self._store(ns, lang, translation) + + def _store(self, ns, lang, translation): + """ Contains logic on how to store a translation """ + self.nsinfo.setdefault(ns, {}).setdefault(lang, []).append(translation) + + def output(self, indent): + data = "" + for nsid, langs in self.nsinfo.iteritems(): + for lang, translations in langs.iteritems(): + data += " " * indent + data += "self.namespaces[%(nsid)i][%(lang)r] = %(translations)r" % locals() + data += "\n" + return data + + +class Wiki(object): + REwgEnableApi = re.compile(ur'wgEnableAPI ?= ?true') + REwgServer = re.compile(ur'wgServer ?= ?"([^"]*)"') + REwgScriptPath = re.compile(ur'wgScriptPath ?= ?"([^"]*)"') + REwgArticlePath = re.compile(ur'wgArticlePath ?= ?"([^"]*)"') + REwgContentLanguage = re.compile(ur'wgContentLanguage ?= ?"([^"]*)"') + REwgVersion = re.compile(ur'wgVersion ?= ?"([^"]*)"') + + def __init__(self, fromurl): + if fromurl.endswith("$1"): + fromurl = fromurl[:-2] + try: + data = urlopen(fromurl).read() + except HTTPError, e: + if e.code != 404: + raise + data = e.read() + pass + + if not self.REwgEnableApi.search(data): + print "*** WARNING: Api does not seem to be enabled on %s" % fromurl + try: + self.version = self.REwgVersion.search(data).groups()[0] + except AttributeError: + self.version = None + self.server = self.REwgServer.search(data).groups()[0] + self.scriptpath = self.REwgScriptPath.search(data).groups()[0] + self.articlepath = self.REwgArticlePath.search(data).groups()[0] + self.lang = self.REwgContentLanguage.search(data).groups()[0] + + def __cmp__(self, other): + return (self.server + self.scriptpath == other.server + other.scriptpath) + + def __hash__(self): + return hash(self.server + self.scriptpath) + + @property + def api(self): + return self.server + self.scriptpath + "/api.php" + + @property + def iwpath(self): + return self.server + self.articlepath + + +if __name__ == "__main__": + if len(sys.argv) != 3: + print "Usage: %s <url> <short name>" + print "Example: %s
http://www.mywiki.bogus/wiki/Main_Page
mywiki" + print "This will create the file families/mywiki_family.py" + + FamilyFileGenerator(*sys.argv[1:]).run()
[View Less]
1
0
0
0
SVN: [8372] trunk/pywikipedia
by valhallasw@svn.wikimedia.org
29 Jul '10
29 Jul '10
Revision: 8372 Author: valhallasw Date: 2010-07-29 14:04:50 +0000 (Thu, 29 Jul 2010) Log Message: ----------- Moving generate_family_file.py to correct location. Added Paths: ----------- trunk/pywikipedia/generate_family_file.py Removed Paths: ------------- pywikipedia/ Added: trunk/pywikipedia/generate_family_file.py =================================================================== --- trunk/pywikipedia/generate_family_file.py (rev 0) +++ trunk/
…
[View More]
pywikipedia/generate_family_file.py 2010-07-29 14:04:50 UTC (rev 8372) @@ -0,0 +1,213 @@ +# -*- coding: utf-8 -*- +""" +This script generates a family file from a given URL. +Hackish, etc. Regexps, yes. Sorry, jwz. + +""" +__version__ = "$Id" + +# +# (C) Merlijn van Deen, 2010 +# (C) Pywikipedia bot team, 2010 +# +# Distributed under the terms of the MIT license +# + +from urllib2 import HTTPError +import urllib2 + +def urlopen(url): + req = urllib2.Request(url, headers = {'User-agent': 'Pywikipedia family generator 0.1 -
pywikipediabot.sf.net
'}) + return urllib2.urlopen(req) + +from urlparse import urlparse, ParseResult +import codecs +import sys +import re +try: + import json +except ImportError: + import simplejson as json + +# Monkey-patching wikipediatools to prevent questions about user_config.py +import wikipediatools +wikipediatools.get_base_dir = lambda: '.' +import family +STANDARDNAMESPACES = family.Family().namespaces + +def main(url=None, name=None): + if url == None: + url = raw_input("Please insert URL to wiki: ") + if name == None: + name = raw_input("Please insert a short name (eg: freeciv): ") + + wikis = {} + print "Generating family file from %s" % url + + w = Wiki(url) + wikis[w.iwpath] = w + print + print "==================================" + print "api url: %s" % w.api + print "MediaWiki version: %s" % w.version + print "==================================" + print + + print "Determining other languages...", + try: + iw = json.load(urlopen(w.api + "?action=query&meta=siteinfo&siprop=interwikimap&sifilteriw=local&format=json")) + langs = [wiki for wiki in iw['query']['interwikimap'] if u'language' in wiki] + print u' '.join(sorted([wiki[u'prefix'] for wiki in langs])) + + if raw_input("\nThere are %i languages available.\nDo you want to generate interwiki links? This might take a long time. (y/N)" % len(langs)).lower() != "y": + langs = [wiki for wiki in langs if wiki[u'url'] == w.iwpath] + except HTTPError, e: + langs = [] + print e, "; continuing..." + + if langs == []: + print "Assuming English" + langs = [{u'language': u'English', + u'local': u'', + u'prefix': u'en', + u'url': w.iwpath}] + + print "Loading wikis... " + for lang in langs: + print " * %s... " % (lang[u'prefix']), + if lang[u'url'] not in wikis: + wikis[lang[u'url']] = Wiki(lang[u'url']) + print "downloaded" + else: + print "in cache" + + print "Retrieving namespaces... ", + namespaces = {} + for w in wikis.itervalues(): + print "%s " % w.lang, + ns = json.load(urlopen(w.api + "?action=query&meta=siteinfo&siprop=namespaces&format=json"))['query']['namespaces'] + for namespace in ns: + if namespace == '0': + continue + if int(namespace) not in namespaces: + namespaces[int(namespace)] = {} + + # Better method? You're very welcome. + try: + if STANDARDNAMESPACES[int(namespace)]['_default'] != ns[namespace][u'*'] and \ + STANDARDNAMESPACES[int(namespace)][w.lang] != ns[namespace][u'*']: + raise KeyError # if the namespace name is different, act if it is undefined + except KeyError: + namespaces[int(namespace)][w.lang] = ns[namespace][u'*'] + print + + fn = "families/%s_family.py" % name + print "Writing %s... " % fn + try: + open(fn) + if raw_input("%s already exists. Overwrite? (y/n)").lower() == 'n': + print "Terminating." + sys.exit(1) + except IOError: # file not found + pass + f = codecs.open('families/%s_family.py' % name, 'w', 'utf-8') + + f.write(""" +# -*- coding: utf-8 -*- +\"\"\" +This family file was auto-generated by $Id: generate_family_file.py 8371 2010-07-29 13:29:26Z valhallasw $ +Configuration parameters: + url = %(url)s + name = %(name)s + +Please do not commit this to the SVN repository! +\"\"\" + +import family + +class Family(family.Family): + def __init__(self): + family.Family.__init__(self) + self.name = '%(name)s' + self.langs = { +""".lstrip() % {'url': url, 'name': name}) + + for w in wikis.itervalues(): + f.write(" '%(lang)s': u'%(hostname)s',\n" % {'lang': w.lang, 'hostname': urlparse(w.server).netloc}) + + f.write(" }\n\n") + + for nsid, nslangs in namespaces.iteritems(): + for lang, nsname in nslangs.iteritems(): + f.write(" self.namespaces[%(nsid)i]['%(lang)s'] = u'%(nsname)s'\n" % {'nsid': nsid, 'lang': lang, 'nsname': nsname}) + f.write("\n\n") + + f.write(" def scriptpath(self, code):\n") + f.write(" return {\n") + + for w in wikis.itervalues(): + f.write(" '%(lang)s': u'%(path)s',\n" % {'lang': w.lang, 'path': w.scriptpath}) + f.write(" }[code]\n") + f.write("\n") + + f.write(" def version(self, code):\n") + f.write(" return {\n") + for w in wikis.itervalues(): + if w.version == None: + f.write(" '%(lang)s': None,\n" % {'lang': w.lang}) + else: + f.write(" '%(lang)s': u'%(ver)s',\n" % {'lang': w.lang, 'ver': w.version}) + f.write(" }[code]\n") + + +class Wiki(object): + REwgEnableApi = re.compile(ur'wgEnableAPI ?= ?true') + REwgServer = re.compile(ur'wgServer ?= ?"([^"]*)"') + REwgScriptPath = re.compile(ur'wgScriptPath ?= ?"([^"]*)"') + REwgArticlePath = re.compile(ur'wgArticlePath ?= ?"([^"]*)"') + REwgContentLanguage = re.compile(ur'wgContentLanguage ?= ?"([^"]*)"') + REwgVersion = re.compile(ur'wgVersion ?= ?"([^"]*)"') + + def __init__(self, fromurl): + if fromurl.endswith("$1"): + fromurl = fromurl[:-2] + try: + data = urlopen(fromurl).read() + except HTTPError, e: + if e.code != 404: + raise + data = e.read() + pass + + if not self.REwgEnableApi.search(data): + print "*** WARNING: Api does not seem to be enabled on %s" % fromurl + try: + self.version = self.REwgVersion.search(data).groups()[0] + except AttributeError: + self.version = None + self.server = self.REwgServer.search(data).groups()[0] + self.scriptpath = self.REwgScriptPath.search(data).groups()[0] + self.articlepath = self.REwgArticlePath.search(data).groups()[0] + self.lang = self.REwgContentLanguage.search(data).groups()[0] + + def __cmp__(self, other): + return (self.server + self.scriptpath == other.server + other.scriptpath) + + def __hash__(self): + return hash(self.server + self.scriptpath) + + @property + def api(self): + return self.server + self.scriptpath + "/api.php" + + @property + def iwpath(self): + return self.server + self.articlepath + + +if __name__ == "__main__": + if len(sys.argv) != 3: + print "Usage: %s <url> <short name>" + print "Example: %s
http://www.mywiki.bogus/wiki/Main_Page
mywiki" + print "This will create the file families/mywiki_family.py" + main(sys.argv[1], sys.argv[2])
[View Less]
1
0
0
0
SVN: [8371] pywikipedia
by valhallasw@svn.wikimedia.org
29 Jul '10
29 Jul '10
Revision: 8371 Author: valhallasw Date: 2010-07-29 13:29:26 +0000 (Thu, 29 Jul 2010) Log Message: ----------- Added basic family file generator Added Paths: ----------- pywikipedia/ pywikipedia/generate_family_file.py Added: pywikipedia/generate_family_file.py =================================================================== --- pywikipedia/generate_family_file.py (rev 0) +++ pywikipedia/generate_family_file.py 2010-07-29 13:29:26 UTC (rev 8371) @@ -0,
…
[View More]
0 +1,213 @@ +# -*- coding: utf-8 -*- +""" +This script generates a family file from a given URL. +Hackish, etc. Regexps, yes. Sorry, jwz. + +""" +__version__ = "$Id" + +# +# (C) Merlijn van Deen, 2010 +# (C) Pywikipedia bot team, 2010 +# +# Distributed under the terms of the MIT license +# + +from urllib2 import HTTPError +import urllib2 + +def urlopen(url): + req = urllib2.Request(url, headers = {'User-agent': 'Pywikipedia family generator 0.1 -
pywikipediabot.sf.net
'}) + return urllib2.urlopen(req) + +from urlparse import urlparse, ParseResult +import codecs +import sys +import re +try: + import json +except ImportError: + import simplejson as json + +# Monkey-patching wikipediatools to prevent questions about user_config.py +import wikipediatools +wikipediatools.get_base_dir = lambda: '.' +import family +STANDARDNAMESPACES = family.Family().namespaces + +def main(url=None, name=None): + if url == None: + url = raw_input("Please insert URL to wiki: ") + if name == None: + name = raw_input("Please insert a short name (eg: freeciv): ") + + wikis = {} + print "Generating family file from %s" % url + + w = Wiki(url) + wikis[w.iwpath] = w + print + print "==================================" + print "api url: %s" % w.api + print "MediaWiki version: %s" % w.version + print "==================================" + print + + print "Determining other languages...", + try: + iw = json.load(urlopen(w.api + "?action=query&meta=siteinfo&siprop=interwikimap&sifilteriw=local&format=json")) + langs = [wiki for wiki in iw['query']['interwikimap'] if u'language' in wiki] + print u' '.join(sorted([wiki[u'prefix'] for wiki in langs])) + + if raw_input("\nThere are %i languages available.\nDo you want to generate interwiki links? This might take a long time. (y/N)" % len(langs)).lower() != "y": + langs = [wiki for wiki in langs if wiki[u'url'] == w.iwpath] + except HTTPError, e: + langs = [] + print e, "; continuing..." + + if langs == []: + print "Assuming English" + langs = [{u'language': u'English', + u'local': u'', + u'prefix': u'en', + u'url': w.iwpath}] + + print "Loading wikis... " + for lang in langs: + print " * %s... " % (lang[u'prefix']), + if lang[u'url'] not in wikis: + wikis[lang[u'url']] = Wiki(lang[u'url']) + print "downloaded" + else: + print "in cache" + + print "Retrieving namespaces... ", + namespaces = {} + for w in wikis.itervalues(): + print "%s " % w.lang, + ns = json.load(urlopen(w.api + "?action=query&meta=siteinfo&siprop=namespaces&format=json"))['query']['namespaces'] + for namespace in ns: + if namespace == '0': + continue + if int(namespace) not in namespaces: + namespaces[int(namespace)] = {} + + # Better method? You're very welcome. + try: + if STANDARDNAMESPACES[int(namespace)]['_default'] != ns[namespace][u'*'] and \ + STANDARDNAMESPACES[int(namespace)][w.lang] != ns[namespace][u'*']: + raise KeyError # if the namespace name is different, act if it is undefined + except KeyError: + namespaces[int(namespace)][w.lang] = ns[namespace][u'*'] + print + + fn = "families/%s_family.py" % name + print "Writing %s... " % fn + try: + open(fn) + if raw_input("%s already exists. Overwrite? (y/n)").lower() == 'n': + print "Terminating." + sys.exit(1) + except IOError: # file not found + pass + f = codecs.open('families/%s_family.py' % name, 'w', 'utf-8') + + f.write(""" +# -*- coding: utf-8 -*- +\"\"\" +This family file was auto-generated by $Id$ +Configuration parameters: + url = %(url)s + name = %(name)s + +Please do not commit this to the SVN repository! +\"\"\" + +import family + +class Family(family.Family): + def __init__(self): + family.Family.__init__(self) + self.name = '%(name)s' + self.langs = { +""".lstrip() % {'url': url, 'name': name}) + + for w in wikis.itervalues(): + f.write(" '%(lang)s': u'%(hostname)s',\n" % {'lang': w.lang, 'hostname': urlparse(w.server).netloc}) + + f.write(" }\n\n") + + for nsid, nslangs in namespaces.iteritems(): + for lang, nsname in nslangs.iteritems(): + f.write(" self.namespaces[%(nsid)i]['%(lang)s'] = u'%(nsname)s'\n" % {'nsid': nsid, 'lang': lang, 'nsname': nsname}) + f.write("\n\n") + + f.write(" def scriptpath(self, code):\n") + f.write(" return {\n") + + for w in wikis.itervalues(): + f.write(" '%(lang)s': u'%(path)s',\n" % {'lang': w.lang, 'path': w.scriptpath}) + f.write(" }[code]\n") + f.write("\n") + + f.write(" def version(self, code):\n") + f.write(" return {\n") + for w in wikis.itervalues(): + if w.version == None: + f.write(" '%(lang)s': None,\n" % {'lang': w.lang}) + else: + f.write(" '%(lang)s': u'%(ver)s',\n" % {'lang': w.lang, 'ver': w.version}) + f.write(" }[code]\n") + + +class Wiki(object): + REwgEnableApi = re.compile(ur'wgEnableAPI ?= ?true') + REwgServer = re.compile(ur'wgServer ?= ?"([^"]*)"') + REwgScriptPath = re.compile(ur'wgScriptPath ?= ?"([^"]*)"') + REwgArticlePath = re.compile(ur'wgArticlePath ?= ?"([^"]*)"') + REwgContentLanguage = re.compile(ur'wgContentLanguage ?= ?"([^"]*)"') + REwgVersion = re.compile(ur'wgVersion ?= ?"([^"]*)"') + + def __init__(self, fromurl): + if fromurl.endswith("$1"): + fromurl = fromurl[:-2] + try: + data = urlopen(fromurl).read() + except HTTPError, e: + if e.code != 404: + raise + data = e.read() + pass + + if not self.REwgEnableApi.search(data): + print "*** WARNING: Api does not seem to be enabled on %s" % fromurl + try: + self.version = self.REwgVersion.search(data).groups()[0] + except AttributeError: + self.version = None + self.server = self.REwgServer.search(data).groups()[0] + self.scriptpath = self.REwgScriptPath.search(data).groups()[0] + self.articlepath = self.REwgArticlePath.search(data).groups()[0] + self.lang = self.REwgContentLanguage.search(data).groups()[0] + + def __cmp__(self, other): + return (self.server + self.scriptpath == other.server + other.scriptpath) + + def __hash__(self): + return hash(self.server + self.scriptpath) + + @property + def api(self): + return self.server + self.scriptpath + "/api.php" + + @property + def iwpath(self): + return self.server + self.articlepath + + +if __name__ == "__main__": + if len(sys.argv) != 3: + print "Usage: %s <url> <short name>" + print "Example: %s
http://www.mywiki.bogus/wiki/Main_Page
mywiki" + print "This will create the file families/mywiki_family.py" + main(sys.argv[1], sys.argv[2]) Property changes on: pywikipedia/generate_family_file.py ___________________________________________________________________ Added: svn:keywords + Id *.c = svn:eol-style=native *.cpp = svn:eol-style=native *.h = svn:eol-style=native *.dsp = svn:eol-style=CRLF *.dsw = svn:eol-style=CRLF *.sh = svn:eol-style=native Added: svn:executable *.txt + svn:eol-style=native *.png = svn:mime-type=image/png *.jpg = svn:mime-type=image/jpeg Makefile = svn:eol-style=native Added: svn:eol-style + native
[View Less]
1
0
0
0
SVN: [8370] trunk/pywikipedia/archivebot.py
by xqt@svn.wikimedia.org
29 Jul '10
29 Jul '10
Revision: 8370 Author: xqt Date: 2010-07-29 08:11:42 +0000 (Thu, 29 Jul 2010) Log Message: ----------- Localization fixes by harriv (patch request bug #3035508). Thanks. Modified Paths: -------------- trunk/pywikipedia/archivebot.py Modified: trunk/pywikipedia/archivebot.py =================================================================== --- trunk/pywikipedia/archivebot.py 2010-07-29 07:22:06 UTC (rev 8369) +++ trunk/pywikipedia/archivebot.py 2010-07-29 08:11:42 UTC (rev 8370) @@
…
[View More]
-155,10 +155,10 @@ 'OlderThanSummary': u'äldre än', }, 'fi': { - 'ArchiveFull' : u'(ARCHIVE FULL)', + 'ArchiveFull' : u'(ARKISTO TÄYSI)', 'InitialArchiveHeader': u'{{arkisto}}', 'PageSummary': u'Arkistoidaan %(count)d keskustelua (%(why)s) %(archives)s arkistoon.', - 'ArchiveSummary': u'Arkistoidaan %(count)d keskutelua sivulta [[%(from)s]].', + 'ArchiveSummary': u'Arkistoidaan %(count)d keskustelua sivulta [[%(from)s]].', 'OlderThanSummary': u'vanhempi kuin', }, } @@ -223,7 +223,8 @@ def int2month_short(num): """Returns the locale's abbreviated name of month 'num' (1-12).""" if hasattr(locale, 'nl_langinfo'): - return locale.nl_langinfo(locale.ABMON_1+num-1).replace('\xa0', '').decode('utf-8') + #filter out non-alpha characters + return ''.join([c for c in locale.nl_langinfo(locale.ABMON_1+num-1).decode('utf-8') if c.isalpha()]) Months = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'] return Site.mediawiki_message(Months[num-1])
[View Less]
1
0
0
0
SVN: [8369] trunk/pywikipedia/capitalize_redirects.py
by xqt@svn.wikimedia.org
29 Jul '10
29 Jul '10
Revision: 8369 Author: xqt Date: 2010-07-29 07:22:06 +0000 (Thu, 29 Jul 2010) Log Message: ----------- Remove wrong parameter introduced with r7809. Bug fixed by Lewis Cawte (Lcawte), thanks! Modified Paths: -------------- trunk/pywikipedia/capitalize_redirects.py Modified: trunk/pywikipedia/capitalize_redirects.py =================================================================== --- trunk/pywikipedia/capitalize_redirects.py 2010-07-28 21:41:35 UTC (rev 8368) +++ trunk/
…
[View More]
pywikipedia/capitalize_redirects.py 2010-07-29 07:22:06 UTC (rev 8369) @@ -113,8 +113,11 @@ gen = genFactory.getCombinedGenerator() preloadingGen = pagegenerators.PreloadingGenerator(gen) - bot = CapitalizeBot(preloadingGen, acceptall, titlecase, standard) - bot.run() + bot = CapitalizeBot(preloadingGen, acceptall, titlecase) + try: + bot.run() + except KeyboardInterrupt: + pywikibot.output('\nQuitting program...') if __name__ == "__main__": try:
[View Less]
1
0
0
0
SVN: [8368] trunk/pywikipedia/families/wikipedia_family.py
by a_engels@svn.wikimedia.org
29 Jul '10
29 Jul '10
Revision: 8368 Author: a_engels Date: 2010-07-28 21:41:35 +0000 (Wed, 28 Jul 2010) Log Message: ----------- disambiguation template for lv: Modified Paths: -------------- trunk/pywikipedia/families/wikipedia_family.py Modified: trunk/pywikipedia/families/wikipedia_family.py =================================================================== --- trunk/pywikipedia/families/wikipedia_family.py 2010-07-27 07:24:56 UTC (rev 8367) +++ trunk/pywikipedia/families/wikipedia_family.py 2010-
…
[View More]
07-28 21:41:35 UTC (rev 8368) @@ -784,6 +784,7 @@ u'Desambiguassiú', u'Desambiguació'], 'ln': None, 'lt': None, + 'lv': [u'Nozīmju atdalīšana', u'Disambig'], 'mk': [u'Појаснување', u'Disambig', u'Geodis'], 'mn': [u'Салаа утгатай', u'Disambig'], 'ms': [u'Nyahkekaburan', u'Disambig'],
[View Less]
1
0
0
0
SVN: [8367] trunk/pywikipedia/category_redirect.py
by xqt@svn.wikimedia.org
27 Jul '10
27 Jul '10
Revision: 8367 Author: xqt Date: 2010-07-27 07:24:56 +0000 (Tue, 27 Jul 2010) Log Message: ----------- fix for r8364 (spaces vs tabs) Modified Paths: -------------- trunk/pywikipedia/category_redirect.py Modified: trunk/pywikipedia/category_redirect.py =================================================================== --- trunk/pywikipedia/category_redirect.py 2010-07-27 07:23:45 UTC (rev 8366) +++ trunk/pywikipedia/category_redirect.py 2010-07-27 07:24:56 UTC (rev 8367) @@ -63,7 +
…
[View More]
63,7 @@ 'da': "Kategori:Omdirigeringskategorier", 'en': "Category:Wikipedia soft redirected categories", 'es': "Categoría:Wikipedia:Categorías redirigidas", - 'hu': "Kategória:Kategóriaátirányítások", + 'hu': "Kategória:Kategóriaátirányítások", 'ja': "Category:移行中のカテゴリ", 'no': "Kategori:Wikipedia omdirigertekategorier", 'pl': "Kategoria:Przekierowania kategorii",
[View Less]
1
0
0
0
SVN: [8366] branches/rewrite/scripts
by xqt@svn.wikimedia.org
27 Jul '10
27 Jul '10
Revision: 8366 Author: xqt Date: 2010-07-27 07:23:45 +0000 (Tue, 27 Jul 2010) Log Message: ----------- i18n from trunk r8365 Modified Paths: -------------- branches/rewrite/scripts/basic.py branches/rewrite/scripts/clean_sandbox.py branches/rewrite/scripts/cosmetic_changes.py branches/rewrite/scripts/editarticle.py branches/rewrite/scripts/fixes.py branches/rewrite/scripts/redirect.py Modified: branches/rewrite/scripts/basic.py ===================================
…
[View More]
================================ --- branches/rewrite/scripts/basic.py 2010-07-26 20:52:10 UTC (rev 8365) +++ branches/rewrite/scripts/basic.py 2010-07-27 07:23:45 UTC (rev 8366) @@ -40,6 +40,7 @@ 'cs': u'Robot změnil ...', 'de': u'Bot: Ändere ...', 'en': u'Robot: Changing ...', + 'fa': u'ربات: تغییر ...', 'fr': u'Robot: Changé ...', 'ja':u'ロボットによる:編集', 'ksh': u'Bot: Ännern ...', Modified: branches/rewrite/scripts/clean_sandbox.py =================================================================== --- branches/rewrite/scripts/clean_sandbox.py 2010-07-26 20:52:10 UTC (rev 8365) +++ branches/rewrite/scripts/clean_sandbox.py 2010-07-27 07:23:45 UTC (rev 8366) @@ -71,7 +71,7 @@ 'da': u'Bot: Nyt sand (fra[[Skabelon:Sandkasse tekst]])', 'de': u'Bot: Setze Spielwiese zurück.', 'en': u'Robot: Automatically cleaned', - 'fa': u'ربات:صفحه به طور خودکار تميز شد', + 'fa': u'ربات: صفحه به طور خودکار تميز شد', 'fi': u'Botti siivosi hiekkalaatikon.', 'he': u'בוט: דף זה ינוקה אוטומטית.', 'id': u'Bot: Tata ulang', Modified: branches/rewrite/scripts/cosmetic_changes.py =================================================================== --- branches/rewrite/scripts/cosmetic_changes.py 2010-07-26 20:52:10 UTC (rev 8365) +++ branches/rewrite/scripts/cosmetic_changes.py 2010-07-27 07:23:45 UTC (rev 8366) @@ -49,11 +49,13 @@ # Summary message when using this module as a stand-alone script msg_standalone = { - 'als': u'Bötli: chleineri Änderige', + 'als':u'Bötli: chleineri Änderige', 'ar': u'روبوت: تغييرات تجميلية', 'be-x-old': u'Робат: касмэтычныя зьмены', 'bg': u'Робот козметични промени', + 'br': u'Bot: Kemm dister', 'ca': u'Robot: Canvis cosmètics', + 'ckb':u'بۆت: دەستکاریی جوانکاری', 'cs': u'Robotické: kosmetické úpravy', 'da': u'Bot: Kosmetiske ændringer', 'de': u'Bot: Kosmetische Änderungen', @@ -61,7 +63,7 @@ 'en': u'Robot: Cosmetic changes', 'es': u'Robot: Cambios triviales', 'et': u'robot: kosmeetilised muudatused', - 'fa': u'ربات: ویرایش جزئی', + 'fa': u'ربات: زیباسازی', 'fi': u'Botti kosmeettisia muutoksia', 'fr': u'Robot : Changement de type cosmétique', 'fy': u'bot tekstwiziging', @@ -83,7 +85,8 @@ 'mt': u'Bot: kosmetiċi bidliet', 'nl': u'Bot: cosmetische wijzigingen', 'no': u'Bot: Kosmetiske endringer', - 'pdc': u'Waddefresser: gleene Enneringe', + 'nn': u'Robot: Kosmetiske endringar', + 'pdc':u'Waddefresser: gleene Enneringe', 'pl': u'Robot dokonuje poprawek kosmetycznych', 'pt': u'Bot: Mudanças triviais', 'ro': u'robot modificări cosmetice', @@ -97,20 +100,23 @@ 'tl': u'robot Kosmetiko pagbabago', 'tr': u'Bot Kozmetik değişiklikler', 'uk': u'робот косметичні зміни', - 'vec': u'Bot: Modifiche estetiche', + 'vec':u'Bot: Modifiche estetiche', 'vi': u'robot: Sửa cách trình bày', - 'war': u'Robot: Kosmetiko nga mga pagbag-o', + 'war':u'Robot: Kosmetiko nga mga pagbag-o', + 'yi': u'באט: קאסמעטישע ענדערונגען', 'zh': u'機器人: 細部更改', } # Summary message that will be appended to the normal message when # cosmetic changes are made on the fly msg_append = { - 'als': u'; chleineri Änderige', + 'als':u'; chleineri Änderige', 'ar': u'; تغييرات تجميلية', 'be-x-old': u'; касмэтычныя зьмены', 'bg': u'; козметични промени', + 'br': u'; Kemm dister', 'ca': u'; canvis cosmètics', + 'ckb':u'; دەستکاریی جوانکاری', 'cs': u'; kosmetické úpravy', 'da': u'; kosmetiske ændringer', 'de': u'; kosmetische Änderungen', @@ -118,7 +124,7 @@ 'en': u'; cosmetic changes', 'es': u'; cambios triviales', 'et': u'; kosmeetilised muudatused', - 'fa': u'; ویرایش جزئی', + 'fa': u'; زیباسازی', 'fi': u'; kosmeettisia muutoksia', 'fr': u'; changement de type cosmétique', 'fy': u'; tekstwiziging', @@ -140,7 +146,8 @@ 'ms': u'; perubahan kosmetik', 'nl': u'; cosmetische veranderingen', 'no': u'; kosmetiske endringer', - 'pdc': u', gleene Enneringe', + 'nn': u'; kosmetiske endringar', + 'pdc':u', gleene Enneringe', 'pl': u'; zmiany kosmetyczne', 'pt': u'; mudanças triviais', 'ro': u'; modificări cosmetice', @@ -154,9 +161,10 @@ 'tl': u'; Kosmetiko pagbabago', 'tr': u'; Kozmetik değişiklikler', 'uk': u'; косметичні зміни', - 'vec': u'; modifiche estetiche', + 'vec':u'; modifiche estetiche', 'vi': u'; sửa cách trình bày', - 'war': u'; kosmetiko nga mga pagbag-o', + 'war':u'; kosmetiko nga mga pagbag-o', + 'yi': u'; קאסמעטישע ענדערונגען', 'zh': u'; 細部更改', } Modified: branches/rewrite/scripts/editarticle.py =================================================================== --- branches/rewrite/scripts/editarticle.py 2010-07-26 20:52:10 UTC (rev 8365) +++ branches/rewrite/scripts/editarticle.py 2010-07-27 07:23:45 UTC (rev 8366) @@ -35,6 +35,7 @@ 'ar': u'تعديل يدوي: %s', 'de': u'Manuelle Bearbeitung: %s', 'en': u'Manual edit: %s', + 'fa': u'ویرایش دستی: %s', 'he': u'עריכה ידנית: %s', 'ja': u'手動編集: %s', 'pt': u'Editando manualmente com bot: %s', Modified: branches/rewrite/scripts/fixes.py =================================================================== --- branches/rewrite/scripts/fixes.py 2010-07-26 20:52:10 UTC (rev 8365) +++ branches/rewrite/scripts/fixes.py 2010-07-27 07:23:45 UTC (rev 8366) @@ -48,7 +48,7 @@ 'cs':u'převod/oprava HTML', 'en':u'Robot: Converting/fixing HTML', 'eo':u'Bot: koredtado de HTMLa teksto', - 'fa':u'ربات:تصحیح/فیکس کدهای اچتیامال', + 'fa':u'ربات:تبدیل/تصحیح کدهای اچتیامال', 'de':u'Bot: konvertiere/korrigiere HTML', 'fr':u'Robot: convertit/fixe HTML', 'he':u'בוט: ממיר/מתקן HTML', @@ -564,6 +564,7 @@ 'regex': False, 'msg': { 'en': u'Robot: Fixing special page capitalisation', + 'fa':u'ربات: تصحیح بزرگی و کوچکی حروف صفحههای ویژه', }, 'replacements': [ (u'Special:Allpages', u'Special:AllPages'), @@ -595,6 +596,7 @@ 'msg': { 'de': u'Bot: Ersetze Links auf .yu-Domains', 'en': u'Robot: Replacing links to .yu domains', + 'fa': u'ربات: جایگزینی پیوندها به دامنهها با پسوند yu', 'fr': u'Robot: Correction des liens pointant vers le domaine .yu, qui expire en 2009', 'ksh': u'Bot: de ahle .yu-Domains loufe us, dröm ußjetuusch', }, @@ -649,6 +651,7 @@ 'regex': True, 'msg': { 'en': u'Robot: Fixing rich-editor html', + 'fa': u'ربات: تصحیح اچتیامال ویرایشگر پیشرفته', }, 'replacements': [ # replace <br> with a new line Modified: branches/rewrite/scripts/redirect.py =================================================================== --- branches/rewrite/scripts/redirect.py 2010-07-26 20:52:10 UTC (rev 8365) +++ branches/rewrite/scripts/redirect.py 2010-07-27 07:23:45 UTC (rev 8366) @@ -116,7 +116,7 @@ 'de': u'Bot: Weiterleitungsziel existiert nicht', 'en': u'[[WP:CSD#G8|G8]]: [[Wikipedia:Redirect|Redirect]] to a deleted or non-existent page', 'es': u'Robot: La página a la que redirige no existe', - 'fa': u'ربات:تغییرمسیر مقصد ندارد', + 'fa': u'ربات: (بن بست) تغییرمسیر به صفحهای که وجود ندارد', 'fi': u'Botti: Ohjauksen kohdesivua ei ole olemassa', 'fr': u'Robot : Cible du redirect inexistante', 'ga': u'Róbó : Targaid athsheoladh ar iarraidh', @@ -149,6 +149,7 @@ 'ar': u'بوت: هدف التحويلة يصنع عقدة تحويل', 'de': u'Bot: Weiterleitungsziel auf sich selbst', 'en': u'[[WP:CSD#G8|G8]]: [[Wikipedia:Redirect|Redirect]] target forms a redirect loop', + 'fa': u'ربات: تغییر مسیر حلقهای', } # Insert deletion template into page with a broken redirect @@ -159,6 +160,7 @@ 'de': u'{{sla|Defekte Weiterleitung --~~~~}}', 'cs': u'{{smazat|přerušené přesměrování}}', 'en': u'{{db-r1}}', + 'fa': u'{{حذف سریع|بن بست}}', 'ga': u'{{scrios|Athsheoladh briste}}', 'it': u'{{Cancella subito|9}}', 'ja': u'{{即時削除|壊れたリダイレクト}}',
[View Less]
1
0
0
0
SVN: [8365] trunk/pywikipedia
by huji@svn.wikimedia.org
27 Jul '10
27 Jul '10
Revision: 8365 Author: huji Date: 2010-07-26 20:52:10 +0000 (Mon, 26 Jul 2010) Log Message: ----------- Follow up to 8364 Fixing indentation (spaces vs tabs) Modified Paths: -------------- trunk/pywikipedia/archive/brackethttp.py trunk/pywikipedia/archive/windows_chars.py trunk/pywikipedia/basic.py trunk/pywikipedia/catall.py trunk/pywikipedia/category.py trunk/pywikipedia/commons_link.py trunk/pywikipedia/disambredir.py trunk/pywikipedia/djvutext.py
…
[View More]
trunk/pywikipedia/editarticle.py trunk/pywikipedia/fixes.py trunk/pywikipedia/image.py trunk/pywikipedia/imagecopy.py trunk/pywikipedia/inline_images.py trunk/pywikipedia/makecat.py trunk/pywikipedia/movepages.py trunk/pywikipedia/piper.py trunk/pywikipedia/redirect.py trunk/pywikipedia/spamremove.py trunk/pywikipedia/us-states.py Modified: trunk/pywikipedia/archive/brackethttp.py =================================================================== --- trunk/pywikipedia/archive/brackethttp.py 2010-07-26 20:41:32 UTC (rev 8364) +++ trunk/pywikipedia/archive/brackethttp.py 2010-07-26 20:52:10 UTC (rev 8365) @@ -14,7 +14,7 @@ myComment = {'ar':u'بوت: URL تم إصلاحها', 'en':u'Bot: URL fixed', - 'fa':u'ربات: URL اصلاح شد', + 'fa':u'ربات: URL اصلاح شد', 'he':u'בוט: תוקנה כתובת URL', 'pt':u'Bot: URL corrigido', 'zh':u'機器人: 網址已修復', Modified: trunk/pywikipedia/archive/windows_chars.py =================================================================== --- trunk/pywikipedia/archive/windows_chars.py 2010-07-26 20:41:32 UTC (rev 8364) +++ trunk/pywikipedia/archive/windows_chars.py 2010-07-26 20:52:10 UTC (rev 8365) @@ -34,7 +34,7 @@ # Summary message msg={ 'en':u'robot: changing Windows-1252 characters to HTML entities', - 'fa':u'ربات: تغییر نویسههای Windows-1252 به نهادهای اچتیامال', + 'fa':u'ربات: تغییر نویسههای Windows-1252 به نهادهای اچتیامال', 'de':u'Bot: Wandle Windows-1252-Zeichen in HTML-Entitäten um', 'fr':u'Bot: Modifie caracteres Windows-1252 vers entités HTML', 'he':u'רובוט: משנה תווים בקידוד Windows-1252 ליישויות HTML', Modified: trunk/pywikipedia/basic.py =================================================================== --- trunk/pywikipedia/basic.py 2010-07-26 20:41:32 UTC (rev 8364) +++ trunk/pywikipedia/basic.py 2010-07-26 20:52:10 UTC (rev 8365) @@ -40,7 +40,7 @@ 'cs': u'Robot změnil ...', 'de': u'Bot: Ändere ...', 'en': u'Robot: Changing ...', - 'fa': u'ربات: تغییر ...', + 'fa': u'ربات: تغییر ...', 'fr': u'Robot: Changé ...', 'ja':u'ロボットによる:編集', 'ksh': u'Bot: Ännern ...', Modified: trunk/pywikipedia/catall.py =================================================================== --- trunk/pywikipedia/catall.py 2010-07-26 20:41:32 UTC (rev 8364) +++ trunk/pywikipedia/catall.py 2010-07-26 20:52:10 UTC (rev 8365) @@ -25,7 +25,7 @@ 'de':u'Bot: Wechsele Kategorien', 'en':u'Robot: Changing categories', 'he':u'Bot: משנה קטגוריות', - 'fa':u'ربات: تغییر ردهها', + 'fa':u'ربات: تغییر ردهها', 'fr':u'Bot: Change categories', 'he':u'בוט: משנה קטגוריות', 'ia':u'Bot: Alteration de categorias', Modified: trunk/pywikipedia/category.py =================================================================== --- trunk/pywikipedia/category.py 2010-07-26 20:41:32 UTC (rev 8364) +++ trunk/pywikipedia/category.py 2010-07-26 20:52:10 UTC (rev 8365) @@ -588,7 +588,7 @@ 'de':u'Bot: Kategorie wurde aufgelöst', 'en':u'Robot: Category was disbanded', 'es':u'Robot: La categoría ha sido eliminada', - 'fa':u'ربات: رده خالی', + 'fa':u'ربات: رده خالی', 'fi':u'Botti tyhjensi luokan', 'he':u'בוט: הקטגוריה פורקה', 'ia':u'Robot: Categoria esseva dissolvite', Modified: trunk/pywikipedia/commons_link.py =================================================================== --- trunk/pywikipedia/commons_link.py 2010-07-26 20:41:32 UTC (rev 8364) +++ trunk/pywikipedia/commons_link.py 2010-07-26 20:52:10 UTC (rev 8365) @@ -40,7 +40,7 @@ 'ar':u'روبوت: تضمين قالب كومنز', 'cs':u'Robot přidal šablonu commons', 'en':u'Robot: Include commons template', - 'fa':u'ربات: افزودن الگوی ویکیانبار', + 'fa':u'ربات: افزودن الگوی ویکیانبار', 'he':u'בוט: מוסיף תבנית Commons', 'ja':u'ロボットによる: テンプレcommons追加', 'nl':u'Bot: sjabloon commons toegevoegd', @@ -50,7 +50,7 @@ 'ar':u'روبوت: تضمين قالب تصنيف كومنز', 'cs':u'Robot přidal šablonu commonscat', 'en':u'Robot: Include commonscat template', - 'fa':u'ربات: افزودن الگوی ردهبندی ویکیانبار', + 'fa':u'ربات: افزودن الگوی ردهبندی ویکیانبار', 'he':u'בוט: מוסיף תבנית Commonscat', 'ja':u'ロボットによる: テンプレcommonscat追加', 'nl':u'Bot: sjabloon commonscat toegevoegd', Modified: trunk/pywikipedia/disambredir.py =================================================================== --- trunk/pywikipedia/disambredir.py 2010-07-26 20:41:32 UTC (rev 8364) +++ trunk/pywikipedia/disambredir.py 2010-07-26 20:52:10 UTC (rev 8365) @@ -20,7 +20,7 @@ 'ar': u'تغيير التحويلات في صفحة توضيح', 'en': u'Changing redirects on a disambiguation page', 'he': u'משנה קישורים להפניות בדף פירושונים', - 'fa': u'اصلاح تغییرمسیرها در یک صفحه ابهامزدایی', + 'fa': u'اصلاح تغییرمسیرها در یک صفحه ابهامزدایی', 'ja': u'ロボットによる: 曖昧さ回避ページのリダイレクト修正', 'nl': u'Verandering van redirects op een doorverwijspagina', 'pl': u'Zmiana przekierowań na stronie ujednoznaczającej', Modified: trunk/pywikipedia/djvutext.py =================================================================== --- trunk/pywikipedia/djvutext.py 2010-07-26 20:41:32 UTC (rev 8364) +++ trunk/pywikipedia/djvutext.py 2010-07-26 20:52:10 UTC (rev 8365) @@ -39,7 +39,7 @@ msg = { 'ar': u'روبوت: إنشاء صفحة بنص مستخرج من DjVu', 'en': u'Robot: Creating page with text extracted from DjVu', - 'fa': u'ربات: ایجاد صفحه با متنی که از دژاوو استخراج شد', + 'fa': u'ربات: ایجاد صفحه با متنی که از دژاوو استخراج شد', 'fr': u'Bot: Creating page with texte extracted from DjVu', 'nl': u'Bot: pagina aangemaakt met tekst geëxtraheerd uit DjVu-bestand', 'pt': u'Bot: criando página com texto extraído do DjVu', @@ -48,7 +48,7 @@ # It may be omitted by adding an empty string like has been done for 'fr'. blank = { 'en': u'{{blank page}}', - 'fa': u'', + 'fa': u'', 'fr': u'', 'pt': u'', } Modified: trunk/pywikipedia/editarticle.py =================================================================== --- trunk/pywikipedia/editarticle.py 2010-07-26 20:41:32 UTC (rev 8364) +++ trunk/pywikipedia/editarticle.py 2010-07-26 20:52:10 UTC (rev 8365) @@ -35,7 +35,7 @@ 'ar': u'تعديل يدوي: %s', 'de': u'Manuelle Bearbeitung: %s', 'en': u'Manual edit: %s', - 'fa': u'ویرایش دستی: %s', + 'fa': u'ویرایش دستی: %s', 'he': u'עריכה ידנית: %s', 'ja': u'手動編集: %s', 'pt': u'Editando manualmente com bot: %s', Modified: trunk/pywikipedia/fixes.py =================================================================== --- trunk/pywikipedia/fixes.py 2010-07-26 20:41:32 UTC (rev 8364) +++ trunk/pywikipedia/fixes.py 2010-07-26 20:52:10 UTC (rev 8365) @@ -571,7 +571,7 @@ 'regex': False, 'msg': { 'en': u'Robot: Fixing special page capitalisation', - 'fa':u'ربات: تصحیح بزرگی و کوچکی حروف صفحههای ویژه', + 'fa':u'ربات: تصحیح بزرگی و کوچکی حروف صفحههای ویژه', }, 'replacements': [ (u'Special:Allpages', u'Special:AllPages'), @@ -603,7 +603,7 @@ 'msg': { 'de': u'Bot: Ersetze Links auf .yu-Domains', 'en': u'Robot: Replacing links to .yu domains', - 'fa': u'ربات: جایگزینی پیوندها به دامنهها با پسوند yu', + 'fa': u'ربات: جایگزینی پیوندها به دامنهها با پسوند yu', 'fr': u'Robot: Correction des liens pointant vers le domaine .yu, qui expire en 2009', 'ksh': u'Bot: de ahle .yu-Domains loufe us, dröm ußjetuusch', }, @@ -658,7 +658,7 @@ 'regex': True, 'msg': { 'en': u'Robot: Fixing rich-editor html', - 'fa': u'ربات: تصحیح اچتیامال ویرایشگر پیشرفته', + 'fa': u'ربات: تصحیح اچتیامال ویرایشگر پیشرفته', }, 'replacements': [ # replace <br> with a new line Modified: trunk/pywikipedia/image.py =================================================================== --- trunk/pywikipedia/image.py 2010-07-26 20:41:32 UTC (rev 8364) +++ trunk/pywikipedia/image.py 2010-07-26 20:52:10 UTC (rev 8365) @@ -49,7 +49,7 @@ 'de': u'Bot: Ersetze Bild %s durch %s', 'en': u'Robot: Replacing image %s with %s', 'es': u'Robot - Reemplazando imagen %s por %s', - 'fa': u'ربات: جایگزین کردن تصویر %s با %s', + 'fa': u'ربات: جایگزین کردن تصویر %s با %s', 'fr': u'Bot: Remplace image %s par %s', 'he': u'בוט: מחליף את התמונה %s בתמונה %s', 'it': u"Bot: Sostituisco l'immagine %s con %s", @@ -71,7 +71,7 @@ 'de': u'Bot: Entferne Bild %s', 'en': u'Robot: Removing image %s', 'es': u'Robot - Retirando imagen %s', - 'fa': u'ربات: برداشتن تصویر %s', + 'fa': u'ربات: برداشتن تصویر %s', 'fr': u'Bot: Enleve image %s', 'he': u'בוט: מסיר את התמונה %s', 'it': u"Bot: Rimuovo l'immagine %s", Modified: trunk/pywikipedia/imagecopy.py =================================================================== --- trunk/pywikipedia/imagecopy.py 2010-07-26 20:41:32 UTC (rev 8364) +++ trunk/pywikipedia/imagecopy.py 2010-07-26 20:52:10 UTC (rev 8365) @@ -189,7 +189,7 @@ 'de': u'Datei ist jetzt auf Wikimedia Commons verfügbar.', 'en': u'File is now available on Wikimedia Commons.', 'eo': u'Dosiero nun estas havebla en la Wikimedia-Komunejo.', - 'fa': u'اینک پرونده در ویکیانبار قابل دسترسی است.', + 'fa': u'اینک پرونده در ویکیانبار قابل دسترسی است.', 'he': u'הקובץ זמין כעת בוויקישיתוף.', 'hu': u'A fájl most már elérhető a Wikimedia Commonson.', 'ia': u'Le file es ora disponibile in Wikimedia Commons.', @@ -226,7 +226,7 @@ '_default': u'[[:File:%s|File]] moved to [[:commons:File:%s|commons]].', 'ar': u'[[:File:%s|الصورة]] تم نقلها إلى [[:commons:File:%s|كومنز]].', 'en': u'[[:File:%s|File]] moved to [[:commons:File:%s|commons]].', - 'fa': u'[[:پرونده:%s|پرونده]] به [[:commons:File:%s|commons]] منتقل شد.', + 'fa': u'[[:پرونده:%s|پرونده]] به [[:commons:File:%s|commons]] منتقل شد.', 'hu': u'[[:File:%s|Kép]] átmozgatva a [[:commons:File:%s|Commons]]ba.', 'nl': u'[[:File:%s|Bestand]] is verplaatst naar [[:commons:File:%s|commons]].', 'pl': u'[[:File:%s|Plik]] przeniesiona do [[:commons:File:%s|commons]].', Modified: trunk/pywikipedia/inline_images.py =================================================================== --- trunk/pywikipedia/inline_images.py 2010-07-26 20:41:32 UTC (rev 8364) +++ trunk/pywikipedia/inline_images.py 2010-07-26 20:52:10 UTC (rev 8365) @@ -36,7 +36,7 @@ msg = { 'ar': u'هذه الصورة كانت موصولة داخليا من %s. لا معلومات عن المؤلف، حالة حقوق النشر، أو الترخيص متوفرة.', 'en': u'This image was inline linked from %s. No information on author, copyright status, or license is available.', - 'fa': u'این تصویر به طور مستقیم از %s پیوند شده بود. اطلاعاتی در مورد مولف، وضعیت حق تکثیر و اجازهنامه این تصویر موجودنیست.', + 'fa': u'این تصویر به طور مستقیم از %s پیوند شده بود. اطلاعاتی در مورد مولف، وضعیت حق تکثیر و اجازهنامه این تصویر موجودنیست.', 'he': u'תמונה זו הייתה מקושרת מהדף %s. אין מידע זמין על המחבר, מצב זכויות היוצרים או הרישיון.', 'pl': u'Obraz ten został dolinkowany z adresu %s. Brak jest informacji o autorze, prawach autorskich czy licencji.', 'pt': u'Esta imagem foi inserida como linha de %s. Nenhum infomação sobre autor, direitos autorais ou licença foi listada.', Modified: trunk/pywikipedia/makecat.py =================================================================== --- trunk/pywikipedia/makecat.py 2010-07-26 20:41:32 UTC (rev 8364) +++ trunk/pywikipedia/makecat.py 2010-07-26 20:52:10 UTC (rev 8365) @@ -45,7 +45,7 @@ 'ar':u'إنشاء أو تحديث التصنيف:', 'en':u'Creation or update of category:', 'es':u'Creación o actualiza de la categoría:', - 'fa':u'ایجاد یا تصحیح رده:', + 'fa':u'ایجاد یا تصحیح رده:', 'fr':u'Création ou mise à jour de categorie:', 'he':u'יצירה או עדכון של קטגוריה:', 'ia':u'Creation o actualisation de categoria:', Modified: trunk/pywikipedia/movepages.py =================================================================== --- trunk/pywikipedia/movepages.py 2010-07-26 20:41:32 UTC (rev 8364) +++ trunk/pywikipedia/movepages.py 2010-07-26 20:52:10 UTC (rev 8365) @@ -54,7 +54,7 @@ 'en': u'Robot: Moved page', 'de': u'Bot: Seite verschoben', 'el': u'Μετακίνηση σελίδων με bot', - 'fa': u'ربات: صفحه منتقل شد', + 'fa': u'ربات: صفحه منتقل شد', 'fi': u'Botti siirsi sivun', 'fr': u'Bot: Page renommée', 'ja': u'ロボットによる: ページの移動', Modified: trunk/pywikipedia/piper.py =================================================================== --- trunk/pywikipedia/piper.py 2010-07-26 20:41:32 UTC (rev 8364) +++ trunk/pywikipedia/piper.py 2010-07-26 20:52:10 UTC (rev 8365) @@ -60,7 +60,7 @@ msg = { 'ar': u'روبوت: استبدال نص المقال من خلال %s', 'en': u'Robot: Piping the article text through %s', - 'fa': u'ربات: رد کردن متن مقاله از درون %s', + 'fa': u'ربات: رد کردن متن مقاله از درون %s', 'is': u'Vélmenni: Pípa texta síðunnar í gegnum %s', 'nl': u'Bot: paginatekst door %s geleid' } Modified: trunk/pywikipedia/redirect.py =================================================================== --- trunk/pywikipedia/redirect.py 2010-07-26 20:41:32 UTC (rev 8364) +++ trunk/pywikipedia/redirect.py 2010-07-26 20:52:10 UTC (rev 8365) @@ -156,7 +156,7 @@ 'ar': u'بوت: هدف التحويلة يصنع عقدة تحويل', 'de': u'Bot: Weiterleitungsziel auf sich selbst', 'en': u'[[WP:CSD#G8|G8]]: [[Wikipedia:Redirect|Redirect]] target forms a redirect loop', - 'fa': u'ربات: تغییر مسیر حلقهای', + 'fa': u'ربات: تغییر مسیر حلقهای', } # Insert deletion template into page with a broken redirect @@ -167,7 +167,7 @@ 'de': u'{{sla|Defekte Weiterleitung --~~~~}}', 'cs': u'{{smazat|přerušené přesměrování}}', 'en': u'{{db-r1}}', - 'fa': u'{{حذف سریع|بن بست}}', + 'fa': u'{{حذف سریع|بن بست}}', 'ga': u'{{scrios|Athsheoladh briste}}', 'it': u'{{Cancella subito|9}}', 'ja': u'{{即時削除|壊れたリダイレクト}}', Modified: trunk/pywikipedia/spamremove.py =================================================================== --- trunk/pywikipedia/spamremove.py 2010-07-26 20:41:32 UTC (rev 8364) +++ trunk/pywikipedia/spamremove.py 2010-07-26 20:52:10 UTC (rev 8365) @@ -36,7 +36,7 @@ 'de': u'Entferne in Spam-Blacklist eingetragenen Weblink auf %s', 'en': u'Removing links to spamming site %s', 'es': u'Removiendo enlaces a sitio publicitario %s', - 'fa': u'حذف پیوند به وبگاه هرزنگاری %s', + 'fa': u'حذف پیوند به وبگاه هرزنگاری %s', 'he': u'מסיר קישורים לאתר ספאם %s', 'fr': u'Suppression du lien blacklisté %s', 'it': u'Rimuovo link contenuto nella Spam-Blacklist %s', Modified: trunk/pywikipedia/us-states.py =================================================================== --- trunk/pywikipedia/us-states.py 2010-07-26 20:41:32 UTC (rev 8364) +++ trunk/pywikipedia/us-states.py 2010-07-26 20:52:10 UTC (rev 8365) @@ -28,7 +28,7 @@ force = False msg = {'en':'Creating state abbreviation redirect', 'ar':u'إنشاء تحويلة اختصار الولاية', - 'fa':u'ایجاد تغییرمسیر برای نام اختصاری ایالت', + 'fa':u'ایجاد تغییرمسیر برای نام اختصاری ایالت', 'he':u'יוצר הפניה מראשי התיבות של המדינה', }
[View Less]
1
0
0
0
← Newer
1
2
3
4
Older →
Jump to page:
1
2
3
4
Results per page:
10
25
50
100
200