http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11541
Revision: 11541 Author: drtrigon Date: 2013-05-17 17:46:15 +0000 (Fri, 17 May 2013) Log Message: ----------- improvement; move simplejson and spelling to externals
Modified Paths: -------------- trunk/pywikipedia/externals/__init__.py trunk/pywikipedia/spellcheck.py trunk/pywikipedia/tests/test_externals.py
Property Changed: ---------------- trunk/pywikipedia/ trunk/pywikipedia/externals/
Property changes on: trunk/pywikipedia ___________________________________________________________________ Modified: svn:externals - spelling http://svn.wikimedia.org/svnroot/pywikipedia/trunk/spelling/ simplejson http://simplejson.googlecode.com/svn/tags/simplejson-2.1.3/simplejson/ i18n http://svn.wikimedia.org/svnroot/pywikipedia/branches/rewrite/scripts/i18n
+ i18n http://svn.wikimedia.org/svnroot/pywikipedia/branches/rewrite/scripts/i18n
Property changes on: trunk/pywikipedia/externals ___________________________________________________________________ Modified: svn:externals - pycolorname https://svn.toolserver.org/svnroot/drtrigon/externals/pycolorname opencv https://svn.toolserver.org/svnroot/drtrigon/externals/opencv
+ spelling http://svn.wikimedia.org/svnroot/pywikipedia/trunk/spelling/ simplejson http://simplejson.googlecode.com/svn/tags/simplejson-2.1.3/simplejson/ pycolorname https://svn.toolserver.org/svnroot/drtrigon/externals/pycolorname opencv https://svn.toolserver.org/svnroot/drtrigon/externals/opencv
Modified: trunk/pywikipedia/externals/__init__.py =================================================================== --- trunk/pywikipedia/externals/__init__.py 2013-05-17 17:23:42 UTC (rev 11540) +++ trunk/pywikipedia/externals/__init__.py 2013-05-17 17:46:15 UTC (rev 11541) @@ -20,10 +20,10 @@ #
-# supports: 1. package management system (yum, apt-get, ...) +# supports: 0. svn:externals +# 1. package management system (yum, apt-get, ...) # 2. download from url (or svn, git repo) -# (?. checkout from svn/mercurial repo) -# 3. svn:externals +# (?. checkout from mercurial repo) modules_needed = { 'crontab': ({}, #{ 'url': 'https://github.com/josiahcarlson/parse-crontab/archive/master.zip', @@ -38,14 +38,12 @@ 'openpyxl': ({}, { 'url': 'https://bitbucket.org/ericgazoni/openpyxl/get/1.5.6.tar.gz', 'path': 'ericgazoni-openpyxl-e5934500ffac/openpyxl',}),# OK +# 'spelling': $ svn propedit svn:externals externals/. +# spelling http://svn.wikimedia.org/svnroot/pywikipedia/trunk/spelling/ +# 'simplejson': $ svn propedit svn:externals externals/. +# simplejson http://simplejson.googlecode.com/svn/tags/simplejson-2.1.3/simplejson/ # TODO: vvv -# 'simplejson' has to be moved and integrated (in)to externals as well -# 'spelling' has to be moved and integrated (in)to externals as well # 'BeautifulSoup.py' has to be moved and integrated (in)to externals as well -# $ svn propget svn:externals pywikipedia/ -# spelling http://svn.wikimedia.org/svnroot/pywikipedia/trunk/spelling/ -# simplejson http://simplejson.googlecode.com/svn/tags/simplejson-2.1.3/simplejson/ -# i18n http://svn.wikimedia.org/svnroot/pywikipedia/branches/rewrite/scripts/i18n 'colormath': ({'linux-fedora': [], 'linux-ubuntu': ['python-colormath'],}, { 'url': 'https://github.com/gtaylor/python-colormath/archive/master.zip', @@ -71,10 +69,9 @@ # '_ocropus': ({}, # {}), # OPEN # TODO: vvv (further clean-up and unlink - check with 'svn list') -# 'opencv': $ svn propedit svn:externals . +# 'opencv': $ svn propedit svn:externals externals/. # opencv https://svn.toolserver.org/svnroot/drtrigon/externals/opencv -# (in directory 'externals', not 'externals/opencv') -# $ svn propedit svn:externals haarcascades/haartraining/ +# $ svn propedit svn:externals externals/opencv/haarcascades/haartraining/ # HaarTraining https://svn.toolserver.org/svnroot/drtrigon/externals/haartraining/HaarTrain... # HaarTraining.tar.gz https://svn.toolserver.org/svnroot/drtrigon/externals/haartraining/HaarTrain... # convert_cascade.c https://svn.toolserver.org/svnroot/drtrigon/externals/haartraining/convert_c... @@ -85,7 +82,7 @@ { 'url': 'https://svn.toolserver.org/svnroot/drtrigon/externals/haarcascades-full.tar....', 'path': 'haarcascades',}), # OK # 'pdfminer' is not used anymore/at the moment... -# 'pycolorname': $ svn propset svn:externals 'pycolorname https://svn.toolserver.org/svnroot/drtrigon/externals/pycolorname' . +# 'pycolorname': $ svn propset svn:externals 'pycolorname https://svn.toolserver.org/svnroot/drtrigon/externals/pycolorname' externals/. 'pydmtx': ({'linux-fedora': ['python-libdmtx'], 'linux-ubuntu': ['libdmtx-dev'],}, { 'url': 'https://github.com/dmtx/dmtx-wrappers/archive/master.zip',
Modified: trunk/pywikipedia/spellcheck.py =================================================================== --- trunk/pywikipedia/spellcheck.py 2013-05-17 17:23:42 UTC (rev 11540) +++ trunk/pywikipedia/spellcheck.py 2013-05-17 17:46:15 UTC (rev 11541) @@ -459,7 +459,7 @@ mysite = pywikibot.getSite() if not checklang: checklang = mysite.language() - filename = pywikibot.config.datafilepath('spelling', + filename = pywikibot.config.datafilepath('externals/spelling', 'spelling-' + checklang + '.txt') print "Getting wordlist" try: @@ -520,7 +520,7 @@ title = pywikibot.input(u"Which page to check now? (enter to stop)") finally: pywikibot.stopme() - filename = pywikibot.config.datafilepath('spelling', + filename = pywikibot.config.datafilepath('externals/spelling', 'spelling-' + checklang + '.txt') if rebuild: list = knownwords.keys()
Modified: trunk/pywikipedia/tests/test_externals.py =================================================================== --- trunk/pywikipedia/tests/test_externals.py 2013-05-17 17:23:42 UTC (rev 11540) +++ trunk/pywikipedia/tests/test_externals.py 2013-05-17 17:46:15 UTC (rev 11541) @@ -32,7 +32,7 @@ self.assertTrue( "simplejson" in sys.modules )
def test_spelling(self): - self.assertTrue(os.path.exists(os.path.join(scriptdir, '../spelling'))) + self.assertTrue(os.path.exists(os.path.join(scriptdir, '../externals/spelling')))
def test_i18n(self): import i18n