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
----- 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
5163 discussions
Start a n
N
ew thread
SVN: [11532] trunk/pywikipedia/catimages.py
by drtrigon@svn.wikimedia.org
13 May '13
13 May '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11532
Revision: 11532 Author: drtrigon Date: 2013-05-13 19:35:40 +0000 (Mon, 13 May 2013) Log Message: ----------- bug fix; ImportError: No module named _bob (minor since for testing/experimental part only) Modified Paths: -------------- trunk/pywikipedia/catimages.py Modified: trunk/pywikipedia/catimages.py =================================================================== --- trunk/pywikipedia/catimages.py 2013-05-13 19:25:20 UTC (rev 11531) +++ trunk/pywikipedia/catimages.py 2013-05-13 19:35:40 UTC (rev 11532) @@ -425,6 +425,7 @@ smallImg = np.empty( (cv.Round(video[0].shape[1]/scale), cv.Round(video[0].shape[0]/scale)), dtype=np.uint8 ) video = [ cv2.resize( img, smallImg.shape, interpolation=cv2.INTER_LINEAR ) for img in video ] + sys.path.append(os.path.join(scriptdir, 'dtbext')) import _bob as bob import xbob_flandmark as xbob
1
0
0
0
SVN: [11531] trunk/pywikipedia/catimages.py
by drtrigon@svn.wikimedia.org
13 May '13
13 May '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11531
Revision: 11531 Author: drtrigon Date: 2013-05-13 19:25:20 +0000 (Mon, 13 May 2013) Log Message: ----------- improvement; removed all productive 'dtbext' references, testing keeped only Modified Paths: -------------- trunk/pywikipedia/catimages.py Modified: trunk/pywikipedia/catimages.py =================================================================== --- trunk/pywikipedia/catimages.py 2013-05-13 17:52:17 UTC (rev 11530) +++ trunk/pywikipedia/catimages.py 2013-05-13 19:25:20 UTC (rev 11531) @@ -101,16 +101,11 @@ externals.check_setup('pydmtx') # <<< !!! test OS package management here !!! externals.check_setup('py_w3c') # externals.check_setup('_zbar') # - -# DrTrigonBot framework packages -target = os.path.join(scriptdir, 'dtbext') -sys.path.append(target) import pycolorname #import _mlpy as mlpy from colormath.color_objects import RGBColor from py_w3c.validators.html.validator import HTMLValidator, ValidationFault #from pdfminer import pdfparser, pdfinterp, pdfdevice, converter, cmapdb, layout -#sys.path.remove(target) locale.setlocale(locale.LC_ALL, '') @@ -775,6 +770,7 @@ # BoWclassify /data/toolserver/pywikipedia/dtbext/opencv/VOC2007 /data/toolserver/pywikipedia/dtbext/opencv/data FAST SURF BruteForce | tee run.log # BoWclassify /data/toolserver/pywikipedia/dtbext/opencv/VOC2007 /data/toolserver/pywikipedia/dtbext/opencv/data HARRIS SIFT BruteForce | tee run.log #
http://experienceopencv.blogspot.com/2011/02/object-recognition-bag-of-keyp…
+ sys.path.append(os.path.join(scriptdir, 'dtbext')) import opencv if os.path.exists(bowDescPath):
1
0
0
0
SVN: [11530] trunk/pywikipedia/externals
by drtrigon@svn.wikimedia.org
13 May '13
13 May '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11530
Revision: 11530 Author: drtrigon Date: 2013-05-13 17:52:17 +0000 (Mon, 13 May 2013) Log Message: ----------- follow-up; to r11529 since not all svn do support single file externals Modified Paths: -------------- trunk/pywikipedia/externals/__init__.py Removed Paths: ------------- trunk/pywikipedia/externals/opencv/ Property Changed: ---------------- trunk/pywikipedia/externals/ Property changes on: trunk/pywikipedia/externals ___________________________________________________________________ Modified: svn:externals - pycolorname
https://svn.toolserver.org/svnroot/drtrigon/externals/pycolorname
+ 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-13 17:33:00 UTC (rev 11529) +++ trunk/pywikipedia/externals/__init__.py 2013-05-13 17:52:17 UTC (rev 11530) @@ -72,13 +72,8 @@ # {}), # OPEN # TODO: vvv (further clean-up and unlink - check with 'svn list') # 'opencv': $ svn propedit svn:externals . -# bagofwords_classification.cpp
https://svn.toolserver.org/svnroot/drtrigon/externals/opencv/bagofwords_cla…
-# bagofwords_classification_python.cpp
https://svn.toolserver.org/svnroot/drtrigon/externals/opencv/bagofwords_cla…
-# camera_virtual_default
https://svn.toolserver.org/svnroot/drtrigon/externals/opencv/camera_virtual…
-# facetest.pl
https://svn.toolserver.org/svnroot/drtrigon/externals/opencv/facetest.pl
-# __init.py__
https://svn.toolserver.org/svnroot/drtrigon/externals/opencv/__init__.py
-# makefile
https://svn.toolserver.org/svnroot/drtrigon/externals/opencv/makefile
-# peopledetect.py
https://svn.toolserver.org/svnroot/drtrigon/externals/opencv/peopledetect.py
+# opencv
https://svn.toolserver.org/svnroot/drtrigon/externals/opencv
+# (in directory 'externals', not 'externals/opencv') # $ svn propedit svn:externals haarcascades/haartraining/ # HaarTraining
https://svn.toolserver.org/svnroot/drtrigon/externals/haartraining/HaarTrai…
# HaarTraining.tar.gz
https://svn.toolserver.org/svnroot/drtrigon/externals/haartraining/HaarTrai…
1
0
0
0
SVN: [11529] trunk/pywikipedia
by drtrigon@svn.wikimedia.org
13 May '13
13 May '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11529
Revision: 11529 Author: drtrigon Date: 2013-05-13 17:33:00 +0000 (Mon, 13 May 2013) Log Message: ----------- migration from dtbext to externals finished, catimages.py should run now (except some experimental code which does is for testing and DOES NOT RUN) Modified Paths: -------------- trunk/pywikipedia/catimages.py trunk/pywikipedia/externals/__init__.py Added Paths: ----------- trunk/pywikipedia/externals/opencv/ Modified: trunk/pywikipedia/catimages.py =================================================================== --- trunk/pywikipedia/catimages.py 2013-05-12 21:55:40 UTC (rev 11528) +++ trunk/pywikipedia/catimages.py 2013-05-13 17:33:00 UTC (rev 11529) @@ -91,15 +91,13 @@ import wikipedia as pywikibot import pagegenerators, catlib import checkimages -import dtbext # check for and install needed 'externals' -dtbext.check_setup_all() # import externals # check for and install needed externals.check_setup('colormath') # 'externals' modules externals.check_setup('jseg') # externals.check_setup('jseg/jpeg-6b') # #externals.check_setup('_mlpy') # externals.check_setup('_music21') # -#externals.check_setup('opencv/haarcascades') # +externals.check_setup('opencv/haarcascades') # externals.check_setup('pydmtx') # <<< !!! test OS package management here !!! externals.check_setup('py_w3c') # externals.check_setup('_zbar') # @@ -165,44 +163,44 @@ return #
https://code.ros.org/trac/opencv/browser/trunk/opencv_extra/testdata/gpu/ha…
- xml = os.path.join(scriptdir, 'dtbext/opencv/haarcascades/haarcascade_eye_tree_eyeglasses.xml') - #xml = os.path.join(scriptdir, 'dtbext/opencv/haarcascades/haarcascade_eye.xml') + xml = os.path.join(scriptdir, 'externals/opencv/haarcascades/haarcascade_eye_tree_eyeglasses.xml') + #xml = os.path.join(scriptdir, 'externals/opencv/haarcascades/haarcascade_eye.xml') if not os.path.exists(xml): raise IOError(u"No such file: '%s'" % xml) #nestedCascade = cv.Load( nestedCascade = cv2.CascadeClassifier(xml) #
http://tutorial-haartraining.googlecode.com/svn/trunk/data/haarcascades/
- xml = os.path.join(scriptdir, 'dtbext/opencv/haarcascades/haarcascade_frontalface_alt.xml') + xml = os.path.join(scriptdir, 'externals/opencv/haarcascades/haarcascade_frontalface_alt.xml') # MAY BE USE 'haarcascade_frontalface_alt_tree.xml' ALSO / INSTEAD...?!! if not os.path.exists(xml): raise IOError(u"No such file: '%s'" % xml) #cascade = cv.Load( cascade = cv2.CascadeClassifier(xml) - xml = os.path.join(scriptdir, 'dtbext/opencv/haarcascades/haarcascade_profileface.xml') + xml = os.path.join(scriptdir, 'externals/opencv/haarcascades/haarcascade_profileface.xml') if not os.path.exists(xml): raise IOError(u"No such file: '%s'" % xml) cascadeprofil = cv2.CascadeClassifier(xml) - xml = os.path.join(scriptdir, 'dtbext/opencv/haarcascades/haarcascade_mcs_mouth.xml') + xml = os.path.join(scriptdir, 'externals/opencv/haarcascades/haarcascade_mcs_mouth.xml') if not os.path.exists(xml): raise IOError(u"No such file: '%s'" % xml) cascademouth = cv2.CascadeClassifier(xml) - xml = os.path.join(scriptdir, 'dtbext/opencv/haarcascades/haarcascade_mcs_nose.xml') + xml = os.path.join(scriptdir, 'externals/opencv/haarcascades/haarcascade_mcs_nose.xml') if not os.path.exists(xml): raise IOError(u"No such file: '%s'" % xml) cascadenose = cv2.CascadeClassifier(xml) - xml = os.path.join(scriptdir, 'dtbext/opencv/haarcascades/haarcascade_lefteye_2splits.xml') + xml = os.path.join(scriptdir, 'externals/opencv/haarcascades/haarcascade_lefteye_2splits.xml') if not os.path.exists(xml): raise IOError(u"No such file: '%s'" % xml) cascadelefteye = cv2.CascadeClassifier(xml) # (
http://yushiqi.cn/research/eyedetection
) - xml = os.path.join(scriptdir, 'dtbext/opencv/haarcascades/haarcascade_righteye_2splits.xml') + xml = os.path.join(scriptdir, 'externals/opencv/haarcascades/haarcascade_righteye_2splits.xml') if not os.path.exists(xml): raise IOError(u"No such file: '%s'" % xml) cascaderighteye = cv2.CascadeClassifier(xml) # (
http://yushiqi.cn/research/eyedetection
) - xml = os.path.join(scriptdir, 'dtbext/opencv/haarcascades/haarcascade_mcs_leftear.xml') + xml = os.path.join(scriptdir, 'externals/opencv/haarcascades/haarcascade_mcs_leftear.xml') if not os.path.exists(xml): raise IOError(u"No such file: '%s'" % xml) cascadeleftear = cv2.CascadeClassifier(xml) - xml = os.path.join(scriptdir, 'dtbext/opencv/haarcascades/haarcascade_mcs_rightear.xml') + xml = os.path.join(scriptdir, 'externals/opencv/haarcascades/haarcascade_mcs_rightear.xml') if not os.path.exists(xml): raise IOError(u"No such file: '%s'" % xml) cascaderightear = cv2.CascadeClassifier(xml) @@ -534,9 +532,9 @@ # people haar/cascaded classifier # use 'haarcascade_fullbody.xml', ... also (like face detection) - xml = os.path.join(scriptdir, 'dtbext/opencv/haarcascades/haarcascade_fullbody.xml') - #xml = os.path.join(scriptdir, 'dtbext/opencv/haarcascades/haarcascade_lowerbody.xml') - #xml = os.path.join(scriptdir, 'dtbext/opencv/haarcascades/haarcascade_upperbody.xml') + xml = os.path.join(scriptdir, 'externals/opencv/haarcascades/haarcascade_fullbody.xml') + #xml = os.path.join(scriptdir, 'externals/opencv/haarcascades/haarcascade_lowerbody.xml') + #xml = os.path.join(scriptdir, 'externals/opencv/haarcascades/haarcascade_upperbody.xml') if not os.path.exists(xml): raise IOError(u"No such file: '%s'" % xml) cascade = cv2.CascadeClassifier(xml) @@ -1297,7 +1295,7 @@ #
http://tutorial-haartraining.googlecode.com/svn/trunk/data/haarcascades/
# or own xml files trained onto specific file database/set - xml = os.path.join(scriptdir, ('dtbext/opencv/haarcascades/' + cascade_file)) + xml = os.path.join(scriptdir, ('externals/opencv/haarcascades/' + cascade_file)) if not os.path.exists(xml): raise IOError(u"No such file: '%s'" % xml) cascade = cv2.CascadeClassifier(xml) @@ -1706,7 +1704,7 @@ # pose detection #
http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_recons…
#
http://stackoverflow.com/questions/10022568/opencv-2-3-camera-calibration
- d = shelve.open( os.path.join(scriptdir, 'dtbext/opencv/camera_virtual_default') ) + d = shelve.open( os.path.join(scriptdir, 'externals/opencv/camera_virtual_default') ) if ('retval' not in d): #
http://commons.wikimedia.org/wiki/File:Mutilated_checkerboard_3.jpg
pywikibot.output(u"Doing (virtual) camera calibration onto reference image 'File:Mutilated_checkerboard_3.jpg'") @@ -2504,8 +2502,8 @@ (u'Ears', 'haarcascade_mcs_rightear.xml'), (u'Eyes', 'haarcascade_lefteye_2splits.xml'), # (
http://yushiqi.cn/research/eyedetection
) (u'Eyes', 'haarcascade_righteye_2splits.xml'), # (
http://yushiqi.cn/research/eyedetection
) - #dtbext/opencv/haarcascades/haarcascade_mcs_lefteye.xml - #dtbext/opencv/haarcascades/haarcascade_mcs_righteye.xml + #externals/opencv/haarcascades/haarcascade_mcs_lefteye.xml + #externals/opencv/haarcascades/haarcascade_mcs_righteye.xml # (others include indifferent (left and/or right) and pair) (u'Automobiles', 'cars3.xml'), #
http://www.youtube.com/watch?v=c4LobbqeKZc
(u'Hands', '1256617233-2-haarcascade-hand.xml', 300.),] #
http://www.andol.info/
Modified: trunk/pywikipedia/externals/__init__.py =================================================================== --- trunk/pywikipedia/externals/__init__.py 2013-05-12 21:55:40 UTC (rev 11528) +++ trunk/pywikipedia/externals/__init__.py 2013-05-13 17:33:00 UTC (rev 11529) @@ -58,10 +58,9 @@ 'jseg/jpeg-6b': ({}, { 'url': '
http://vision.ece.ucsb.edu/segmentation/jseg/software/jpeg-6b.zip
', 'path': 'jpeg-6b',}), # OK -# TODO: vvv (future; enable for and use in 'catimages.py') -# '_mlpy': ({}, -# { 'url': '
http://downloads.sourceforge.net/project/mlpy/mlpy%203.5.0/mlpy-3.5.0.tar.gz
', -# 'path': 'mlpy-3.5.0/mlpy',}), # OK + '_mlpy': ({}, + { 'url': '
http://downloads.sourceforge.net/project/mlpy/mlpy%203.5.0/mlpy-3.5.0.tar.gz
', + 'path': 'mlpy-3.5.0/mlpy',}), # OK '_music21': ({}, { 'url': '
http://music21.googlecode.com/files/music21-1.4.0.tar.gz
', 'path': 'music21-1.4.0', @@ -131,7 +130,7 @@ # '_ocropus', 'opencv', 'opencv/haarcascades', 'pydmtx', # 'py_w3c', 'slic', '_zbar', '_bob', 'xbob_flandmark',] modules_order = ['crontab', 'odf', 'openpyxl', - 'colormath', 'jseg', 'jseg/jpeg-6b', '_music21', + 'colormath', 'jseg', 'jseg/jpeg-6b', '_mlpy', '_music21', 'opencv/haarcascades', 'pydmtx', 'py_w3c', '_zbar',] Property changes on: trunk/pywikipedia/externals/opencv ___________________________________________________________________ Added: svn:externals + camera_virtual_default
https://svn.toolserver.org/svnroot/drtrigon/externals/opencv/camera_virtual…
1
0
0
0
SVN: [11528] trunk/pywikipedia
by drtrigon@svn.wikimedia.org
12 May '13
12 May '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11528
Revision: 11528 Author: drtrigon Date: 2013-05-12 21:55:40 +0000 (Sun, 12 May 2013) Log Message: ----------- bug fix; use pywikibot.comms.http instead of urllib2 (e.g. because of temporary not reachable servers) Modified Paths: -------------- trunk/pywikipedia/catimages.py trunk/pywikipedia/externals/__init__.py Modified: trunk/pywikipedia/catimages.py =================================================================== --- trunk/pywikipedia/catimages.py 2013-05-12 20:54:27 UTC (rev 11527) +++ trunk/pywikipedia/catimages.py 2013-05-12 21:55:40 UTC (rev 11528) @@ -93,16 +93,16 @@ import checkimages import dtbext # check for and install needed 'externals' dtbext.check_setup_all() # -import externals # check for and install needed 'externals' -externals.check_setup('colormath') # -externals.check_setup('jseg') # -externals.check_setup('jseg/jpeg-6b')# -#externals.check_setup('_mlpy') # -externals.check_setup('_music21') # -#externals.check_setup('opencv/haarcascades')# -externals.check_setup('pydmtx') # -externals.check_setup('py_w3c') # -externals.check_setup('_zbar') # +import externals # check for and install needed +externals.check_setup('colormath') # 'externals' modules +externals.check_setup('jseg') # +externals.check_setup('jseg/jpeg-6b') # +#externals.check_setup('_mlpy') # +externals.check_setup('_music21') # +#externals.check_setup('opencv/haarcascades') # +externals.check_setup('pydmtx') # <<< !!! test OS package management here !!! +externals.check_setup('py_w3c') # +externals.check_setup('_zbar') # # DrTrigonBot framework packages target = os.path.join(scriptdir, 'dtbext') Modified: trunk/pywikipedia/externals/__init__.py =================================================================== --- trunk/pywikipedia/externals/__init__.py 2013-05-12 20:54:27 UTC (rev 11527) +++ trunk/pywikipedia/externals/__init__.py 2013-05-12 21:55:40 UTC (rev 11528) @@ -25,22 +25,16 @@ # (?. checkout from svn/mercurial repo) # 3. svn:externals modules_needed = { -# TODO: vvv -# 'crontab' has to be moved and integrated (in)to externals as well 'crontab': ({}, #{ 'url': '
https://github.com/josiahcarlson/parse-crontab/archive/master.zip
', # 'path': 'parse-crontab-master/crontab',}), # OK { 'url': '
https://github.com/josiahcarlson/parse-crontab/archive/1ec538ff67df6a207993…
', 'path': 'parse-crontab-1ec538ff67df6a207993a6c5b6988f4f628c5776/crontab',}),# OK -# TODO: vvv -# 'odf' has to be moved and integrated (in)to externals as well 'odf': ({}, #{ 'url': '
https://pypi.python.org/packages/source/o/odfpy/odfpy-0.9.6.tar.gz
', # 'path': 'odfpy-0.9.6/odf',}), # OK { 'url': '
https://pypi.python.org/packages/source/o/odfpy/odfpy-0.9.4.tar.gz
', 'path': 'odfpy-0.9.4/odf',}), # OK -# TODO: vvv -# 'openpyxl' has to be moved and integrated (in)to externals as well 'openpyxl': ({}, { 'url': '
https://bitbucket.org/ericgazoni/openpyxl/get/1.5.6.tar.gz
', 'path': 'ericgazoni-openpyxl-e5934500ffac/openpyxl',}),# OK @@ -136,7 +130,7 @@ # 'colormath', 'jseg', 'jseg/jpeg-6b', '_mlpy', '_music21', # '_ocropus', 'opencv', 'opencv/haarcascades', 'pydmtx', # 'py_w3c', 'slic', '_zbar', '_bob', 'xbob_flandmark',] -modules_order = [#'crontab', 'odf', 'openpyxl', +modules_order = ['crontab', 'odf', 'openpyxl', 'colormath', 'jseg', 'jseg/jpeg-6b', '_music21', 'opencv/haarcascades', 'pydmtx', 'py_w3c', '_zbar',] @@ -144,6 +138,7 @@ import os, sys import wikipedia as pywikibot +from pywikibot.comms import http sys.path.append(os.path.dirname(os.path.abspath(os.path.join(os.curdir, __file__)))) @@ -230,8 +225,10 @@ if package: pywikibot.warning(u'Download package "%s" from %s' % (module, package['url'])) - import urllib2, mimetypes - response = urllib2.urlopen(package['url']) + import mimetypes#, urllib2 + #response = urllib2.urlopen(package['url']) + response = http.request(pywikibot.getSite(), package['url'], + no_hostname = True, back_response = True)[0] pywikibot.warning(u'Size of download: %s byte(s)' % response.headers['Content-Length']) #mime = response.headers['Content-Type'].lower().split('/') @@ -281,8 +278,7 @@ return # if svn_repo_install(modules_needed[m][2]): # return - pywikibot.error(u'Package "%s" could not be found nor installed!' - % m) + pywikibot.error(u'Package "%s" could not be found nor installed!' % m) def check_setup_all(): #for m in modules_needed:
1
0
0
0
SVN: [11527] trunk/pywikipedia
by drtrigon@svn.wikimedia.org
12 May '13
12 May '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11527
Revision: 11527 Author: drtrigon Date: 2013-05-12 20:54:27 +0000 (Sun, 12 May 2013) Log Message: ----------- improvement; most of the necessary externals merged/moved Modified Paths: -------------- trunk/pywikipedia/catimages.py trunk/pywikipedia/externals/__init__.py Added Paths: ----------- trunk/pywikipedia/externals/patch-jseg trunk/pywikipedia/externals/patch-music21 trunk/pywikipedia/externals/patch-pydmtx trunk/pywikipedia/externals/patch-zbar Property Changed: ---------------- trunk/pywikipedia/externals/ Modified: trunk/pywikipedia/catimages.py =================================================================== --- trunk/pywikipedia/catimages.py 2013-05-12 18:51:23 UTC (rev 11526) +++ trunk/pywikipedia/catimages.py 2013-05-12 20:54:27 UTC (rev 11527) @@ -91,8 +91,18 @@ import wikipedia as pywikibot import pagegenerators, catlib import checkimages -import dtbext as externals # check for and install needed 'externals' -externals.check_setup_all() # +import dtbext # check for and install needed 'externals' +dtbext.check_setup_all() # +import externals # check for and install needed 'externals' +externals.check_setup('colormath') # +externals.check_setup('jseg') # +externals.check_setup('jseg/jpeg-6b')# +#externals.check_setup('_mlpy') # +externals.check_setup('_music21') # +#externals.check_setup('opencv/haarcascades')# +externals.check_setup('pydmtx') # +externals.check_setup('py_w3c') # +externals.check_setup('_zbar') # # DrTrigonBot framework packages target = os.path.join(scriptdir, 'dtbext') @@ -1507,10 +1517,7 @@ return # DataMatrix - try: - from pydmtx import DataMatrix # linux distro package (fedora) - except: - from _pydmtx import DataMatrix # TS (debian) + from pydmtx import DataMatrix # linux distro package (fedora) / TS (debian) ## Write a Data Matrix barcode #dm_write = DataMatrix() Property changes on: trunk/pywikipedia/externals ___________________________________________________________________ Added: svn:externals + pycolorname
https://svn.toolserver.org/svnroot/drtrigon/externals/pycolorname
Modified: trunk/pywikipedia/externals/__init__.py =================================================================== --- trunk/pywikipedia/externals/__init__.py 2013-05-12 18:51:23 UTC (rev 11526) +++ trunk/pywikipedia/externals/__init__.py 2013-05-12 20:54:27 UTC (rev 11527) @@ -98,11 +98,11 @@ '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
' . - '_pydmtx': ({'linux-fedora': ['python-libdmtx'], + 'pydmtx': ({'linux-fedora': ['python-libdmtx'], 'linux-ubuntu': ['libdmtx-dev'],}, { 'url': '
https://github.com/dmtx/dmtx-wrappers/archive/master.zip
', 'path': 'dmtx-wrappers-master/python', - #$ diff -Naur TEST__pydmtx/ _pydmtx/ > patch-pydmtx + #$ diff -Nau --exclude="*.pyc" TEST_pydmtx/ pydmtx/ > patch-pydmtx 'patch': 'patch-pydmtx',}), # OK 'py_w3c': ({}, { 'url': '
https://bitbucket.org/nmb10/py_w3c/downloads/py_w3c-v0.1.0.tar.gz
', @@ -134,11 +134,11 @@ #modules_order = ['crontab', 'odf', 'openpyxl', # 'colormath', 'jseg', 'jseg/jpeg-6b', '_mlpy', '_music21', -# '_ocropus', 'opencv', 'opencv/haarcascades', '_pydmtx', +# '_ocropus', 'opencv', 'opencv/haarcascades', 'pydmtx', # 'py_w3c', 'slic', '_zbar', '_bob', 'xbob_flandmark',] modules_order = [#'crontab', 'odf', 'openpyxl', 'colormath', 'jseg', 'jseg/jpeg-6b', '_music21', - 'opencv/haarcascades', '_pydmtx', 'py_w3c', '_zbar',] + 'opencv/haarcascades', 'pydmtx', 'py_w3c', '_zbar',] import os, sys Added: trunk/pywikipedia/externals/patch-jseg =================================================================== (Binary files differ) Property changes on: trunk/pywikipedia/externals/patch-jseg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/pywikipedia/externals/patch-music21 =================================================================== --- trunk/pywikipedia/externals/patch-music21 (rev 0) +++ trunk/pywikipedia/externals/patch-music21 2013-05-12 20:54:27 UTC (rev 11527) @@ -0,0 +1,15 @@ +diff -Naur '--exclude=*.pyc' TEST__music21/__init__.py _music21/__init__.py +--- TEST__music21/__init__.py 1970-01-01 01:00:00.000000000 +0100 ++++ _music21/__init__.py 2013-05-06 17:50:47.519400978 +0200 +@@ -0,0 +1,11 @@ ++import sys, os ++ ++scriptdir = os.path.dirname(sys.argv[0]) ++if not os.path.isabs(scriptdir): ++ scriptdir = os.path.abspath(os.path.join(os.curdir, scriptdir)) ++ ++libdir = os.path.join(scriptdir, 'externals/_music21') ++sys.path.append(os.path.join(libdir)) ++ ++from music21 import * ++ Added: trunk/pywikipedia/externals/patch-pydmtx =================================================================== --- trunk/pywikipedia/externals/patch-pydmtx (rev 0) +++ trunk/pywikipedia/externals/patch-pydmtx 2013-05-12 20:54:27 UTC (rev 11527) @@ -0,0 +1,48 @@ +Gemeinsame Unterverzeichnisse: TEST_pydmtx/build und pydmtx/build. +diff -Nau '--exclude=*.pyc' TEST_pydmtx/__init__.py pydmtx/__init__.py +--- TEST_pydmtx/__init__.py 1970-01-01 01:00:00.000000000 +0100 ++++ pydmtx/__init__.py 2013-05-12 22:10:39.526184591 +0200 +@@ -0,0 +1,43 @@ ++import sys, os ++ ++scriptdir = os.path.dirname(sys.argv[0]) ++if not os.path.isabs(scriptdir): ++ scriptdir = os.path.abspath(os.path.join(os.curdir, scriptdir)) ++ ++libdir = os.path.join(scriptdir, 'externals/pydmtx/build/lib.linux-x86_64-%s.%s' % sys.version_info[:2]) ++if not os.path.exists(libdir): ++ os.makedirs(libdir) ++# path has to exist BEFORE appending, otherwise the re-import fails ++sys.path.append(libdir) ++ ++try: ++ # try to import ++ from pydmtx import DataMatrix ++except ImportError, e: ++ print "(re-)compilation triggered because of: '%s'" % e ++ ++ cur = os.path.abspath(os.curdir) ++ os.chdir( os.path.join(scriptdir, 'externals/pydmtx') ) ++ ++ # remove/reset if existing already ++ if os.path.exists(os.path.join(libdir, '_pydmtx.so')): ++ os.remove( os.path.join(libdir, '_pydmtx.so') ) ++ ++ # compile python module (may be use 'distutil' instead of 'make' here) ++ if os.system("python setup.py build"): ++ #if os.system("make"): ++ raise ImportError("'_pydmtx.so' could not be compiled!") ++ ++ os.chdir( cur ) ++ ++ # re-try to import ++ from pydmtx import DataMatrix ++ ++## skip processing of DataMatrix with this dummy ++#class DataMatrix(object): ++# def __init__(self, *arg, **kwd): ++# return None ++# def decode(self, *arg, **kwd): ++# return None ++# def count(self, *arg, **kwd): ++# return 0 Added: trunk/pywikipedia/externals/patch-zbar =================================================================== --- trunk/pywikipedia/externals/patch-zbar (rev 0) +++ trunk/pywikipedia/externals/patch-zbar 2013-05-12 20:54:27 UTC (rev 11527) @@ -0,0 +1,41 @@ +Gemeinsame Unterverzeichnisse: TEST__zbar/build und _zbar/build. +Gemeinsame Unterverzeichnisse: TEST__zbar/examples und _zbar/examples. +diff -Nau '--exclude=*.pyc' TEST__zbar/__init__.py _zbar/__init__.py +--- TEST__zbar/__init__.py 1970-01-01 01:00:00.000000000 +0100 ++++ _zbar/__init__.py 2013-05-12 13:58:08.098509211 +0200 +@@ -0,0 +1,34 @@ ++import sys, os ++ ++scriptdir = os.path.dirname(sys.argv[0]) ++if not os.path.isabs(scriptdir): ++ scriptdir = os.path.abspath(os.path.join(os.curdir, scriptdir)) ++ ++libdir = os.path.join(scriptdir, 'externals/_zbar/build/lib.linux-x86_64-%s.%s' % sys.version_info[:2]) ++if not os.path.exists(libdir): ++ os.makedirs(libdir) ++# path has to exist BEFORE appending, otherwise the re-import fails ++sys.path.append(libdir) ++ ++try: ++ # try to import ++ from zbar import * ++except ImportError, e: ++ print "(re-)compilation triggered because of: '%s'" % e ++ ++ cur = os.path.abspath(os.curdir) ++ os.chdir( os.path.join(scriptdir, 'externals/_zbar') ) ++ ++ # remove/reset if existing already ++ if os.path.exists(os.path.join(libdir, 'zbar.so')): ++ os.remove( os.path.join(libdir, 'zbar.so') ) ++ ++ # compile python module (may be use 'distutil' instead of 'make' here) ++ if os.system("python setup.py build"): ++ #if os.system("make"): ++ raise ImportError("'zbar.so' could not be compiled!") ++ ++ os.chdir( cur ) ++ ++ # re-try to import ++ from zbar import * +Gemeinsame Unterverzeichnisse: TEST__zbar/test und _zbar/test.
1
0
0
0
SVN: [11526] branches/rewrite/scripts/i18n
by siebrand@svn.wikimedia.org
12 May '13
12 May '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11526
Revision: 11526 Author: siebrand Date: 2013-05-12 18:51:23 +0000 (Sun, 12 May 2013) Log Message: ----------- Localisation updates from
http://translatewiki.net
. Modified Paths: -------------- branches/rewrite/scripts/i18n/add_text.py branches/rewrite/scripts/i18n/archivebot.py branches/rewrite/scripts/i18n/basic.py branches/rewrite/scripts/i18n/capitalize_redirects.py branches/rewrite/scripts/i18n/catall.py branches/rewrite/scripts/i18n/category.py branches/rewrite/scripts/i18n/category_redirect.py branches/rewrite/scripts/i18n/clean_sandbox.py branches/rewrite/scripts/i18n/commons.py branches/rewrite/scripts/i18n/cosmetic_changes.py branches/rewrite/scripts/i18n/delete.py branches/rewrite/scripts/i18n/djvutext.py branches/rewrite/scripts/i18n/editarticle.py branches/rewrite/scripts/i18n/featured.py branches/rewrite/scripts/i18n/fixing_redirects.py branches/rewrite/scripts/i18n/interwiki.py branches/rewrite/scripts/i18n/isbn.py branches/rewrite/scripts/i18n/movepages.py branches/rewrite/scripts/i18n/ndashredir.py branches/rewrite/scripts/i18n/noreferences.py branches/rewrite/scripts/i18n/pywikibot.py branches/rewrite/scripts/i18n/redirect.py branches/rewrite/scripts/i18n/replace.py branches/rewrite/scripts/i18n/solve_disambiguation.py branches/rewrite/scripts/i18n/spellcheck.py branches/rewrite/scripts/i18n/table2wiki.py branches/rewrite/scripts/i18n/template.py branches/rewrite/scripts/i18n/thirdparty.py branches/rewrite/scripts/i18n/unlink.py branches/rewrite/scripts/i18n/weblinkchecker.py branches/rewrite/scripts/i18n/welcome.py Modified: branches/rewrite/scripts/i18n/add_text.py =================================================================== --- branches/rewrite/scripts/i18n/add_text.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/add_text.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -212,6 +212,10 @@ 'gv': { 'add_text-adding': u'bot currit stiagh ec %(adding)s', }, + # Author: Jetlag + 'hak': { + 'add_text-adding': u'機械人:新增%(adding)s', + }, 'he': { 'add_text-adding': u'בוט: מוסיף %(adding)s', }, Modified: branches/rewrite/scripts/i18n/archivebot.py =================================================================== --- branches/rewrite/scripts/i18n/archivebot.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/archivebot.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -299,6 +299,14 @@ 'archivebot-archive-full': u'(ARQUIVO COMPLETO)', 'archivebot-archive-summary': u'Arquivo %(count)d {{PLURAL:%(count)d|fío|fíos}} de [[%(from)s]].', }, + # Author: Jetlag + 'hak': { + 'archivebot-older-than': u'早於', + 'archivebot-page-summary': u'機械人:%(count)d討論串(%(why)s)存檔至%(archives)s。', + 'archivebot-archiveheader': u'{{talkarchive}}', + 'archivebot-archive-full': u'(存檔滿矣)', + 'archivebot-archive-summary': u'機械人:從%(from)s存檔%(count)d。', + }, # Author: Amire80 # Author: Ofekalef # Author: YaronSh Modified: branches/rewrite/scripts/i18n/basic.py =================================================================== --- branches/rewrite/scripts/i18n/basic.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/basic.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -153,6 +153,10 @@ 'gl': { 'basic-changing': u'Bot: Cambiando...', }, + # Author: Jetlag + 'hak': { + 'basic-changing': u'機械人:修改緊...', + }, # Author: Amire80 'he': { 'basic-changing': u'בוט: משנה...', Modified: branches/rewrite/scripts/i18n/capitalize_redirects.py =================================================================== --- branches/rewrite/scripts/i18n/capitalize_redirects.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/capitalize_redirects.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -142,6 +142,10 @@ 'gl': { 'capitalize_redirects-create-redirect': u'Bot: Creo unha redirección cara a "[[%(to)s]]"', }, + # Author: Jetlag + 'hak': { + 'capitalize_redirects-create-redirect': u'機械人:創建重定向到[[%(to)s]]', + }, 'he': { 'capitalize_redirects-create-redirect': u'בוט: יוצר הפניה לדף [[%(to)s]]', }, Modified: branches/rewrite/scripts/i18n/catall.py =================================================================== --- branches/rewrite/scripts/i18n/catall.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/catall.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -138,6 +138,10 @@ 'gl': { 'catall-changing': u'Bot: Cambio algunhas categorías', }, + # Author: Jetlag + 'hak': { + 'catall-changing': u'機械人:更改分類', + }, 'he': { 'catall-changing': u'בוט: משנה קטגוריות', }, Modified: branches/rewrite/scripts/i18n/category.py =================================================================== --- branches/rewrite/scripts/i18n/category.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/category.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -655,6 +655,20 @@ 'gu': { 'category-adding': u'!રોબોટ: ઉમેરણ category [[:Category:%(newcat)s|%(newcat)s]]', }, + # Author: Jetlag + 'hak': { + 'category-version-history': u'機械人:儲存緊%(oldcat)s个歷史記錄', + 'category-changing': u'機械人:更換%(oldcat)s至%(newcat)s', + 'category-adding': u'機械人:添加分類[[:Category:%(newcat)s|%(newcat)s]]', + 'category-also-in': u'(共樣也在%(alsocat)s)', + 'category-was-disbanded': u'機械人:分類已放棄使用', + 'category-replacing': u'機械人:分類由%(oldcat)s替換成%(newcat)s', + 'category-removing': u'機械人:從[[%(oldcat)s]]肚移除', + 'category-was-moved': u'機械人:分類轉移到[[:Category:%(newcat)s|%(title)s]]', + 'category-renamed': u'機械人:移動自%s。編者:%s', + 'category-section-title': u'%(oldcat)s个頁面歷史', + 'category-listifying': u'機械人:從%(fromcat)s提取列表(%(num)d條紀錄)', + }, # Author: Amire80 # Author: ערן 'he': { Modified: branches/rewrite/scripts/i18n/category_redirect.py =================================================================== --- branches/rewrite/scripts/i18n/category_redirect.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/category_redirect.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -340,6 +340,15 @@ 'category_redirect-edit-request-item': u'* %(title)s está en %(oldcat)s, que é unha redirección cara a %(newcat)s', 'category_redirect-fix-double': u'Bot: Arranxo a redirección dobre cara', }, + # Author: Jetlag + 'hak': { + 'category_redirect-comment': u'分類重定向機械人', + 'category_redirect-change-category': u'機械人:更改分類重定向由[[:%(oldCatLink)s|%(oldCatTitle)s]]至[[:%(newCatLink)s|%(newCatTitle)s]]', + 'category_redirect-add-template': u'機械人:增加分類重定向模板供維護', + 'category_redirect-edit-request': u'以下被保護頁面已經被檢測到要更新分類連結:%(itemlist)s', + 'category_redirect-edit-request-item': u'%(title)s係在%(oldcat)s,遐係一隻連結到%(newcat)s个重定向', + 'category_redirect-fix-double': u'機械人:修復雙重重定向', + }, # Author: Amire80 'he': { 'category_redirect-comment': u'בוט תחזוקת הפניות לקטגוריות', Modified: branches/rewrite/scripts/i18n/clean_sandbox.py =================================================================== --- branches/rewrite/scripts/i18n/clean_sandbox.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/clean_sandbox.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -134,6 +134,10 @@ 'gl': { 'clean_sandbox-cleaned': u'Bot: Limpeza automática', }, + # Author: Jetlag + 'hak': { + 'clean_sandbox-cleaned': u'機械人:自動清除', + }, 'he': { 'clean_sandbox-cleaned': u'בוט: דף זה ינוקה אוטומטית.', }, Modified: branches/rewrite/scripts/i18n/commons.py =================================================================== --- branches/rewrite/scripts/i18n/commons.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/commons.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -164,6 +164,11 @@ 'commons-file-moved': u'O [[:File:%(localfile)s|ficheiro]] agora está en [[:commons:File:%(commonsfile)s|Commons]].', 'commons-file-now-available': u'O ficheiro agora está dispoñible na [[:commons:File:%(commonsfile)s|Wikimedia Commons]].', }, + # Author: Jetlag + 'hak': { + 'commons-file-moved': u'[[:File:%(localfile)s|檔案]]已移動到[[:commons:File:%(commonsfile)s|維基共享資源]]。', + 'commons-file-now-available': u'[[:commons:File:%(commonsfile)s|維基共享資源]]已有邇隻檔案。', + }, # Author: Amire80 'he': { 'commons-file-moved': u'[[:File:%(localfile)s|הקובץ]] הועבר [[:commons:File:%(commonsfile)s|לוויקישיתוף]].', Modified: branches/rewrite/scripts/i18n/cosmetic_changes.py =================================================================== --- branches/rewrite/scripts/i18n/cosmetic_changes.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/cosmetic_changes.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -193,6 +193,11 @@ 'cosmetic_changes-standalone': u'bot Cambios estética', 'cosmetic_changes-append': u'; cambios estética', }, + # Author: Jetlag + 'hak': { + 'cosmetic_changes-standalone': u'機械人:整潔化', + 'cosmetic_changes-append': u';整潔化更改', + }, 'he': { 'cosmetic_changes-standalone': u'בוט: שינויים קוסמטיים', 'cosmetic_changes-append': u'; שינויים קוסמטיים', Modified: branches/rewrite/scripts/i18n/delete.py =================================================================== --- branches/rewrite/scripts/i18n/delete.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/delete.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -260,6 +260,14 @@ 'delete-from-file': u'Bot: Borro unha lista de ficheiros.', 'delete-linked-pages': u'Bot: Borro todas as páxinas ligadas desde "%(page)s"', }, + # Author: Jetlag + 'hak': { + 'delete-images': u'機械人:刪除%(page)s上个所有圖像', + 'delete-referring-pages': u'機械人:删除所有從%(page)s指向个頁面', + 'delete-from-category': u'機械人:刪除所有来自%(page)s分類个頁面', + 'delete-from-file': u'機械人:刪除列表中个檔案。', + 'delete-linked-pages': u'機械人:删除所有從%(page)s鏈接个頁面', + }, 'he': { 'delete-images': u'בוט: מוחק את כל התמונות בדף %(page)s.', 'delete-referring-pages': u'בוט: מוחק את כל הדפים המקשרים לדף %(page)s.', Modified: branches/rewrite/scripts/i18n/djvutext.py =================================================================== --- branches/rewrite/scripts/i18n/djvutext.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/djvutext.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -126,6 +126,10 @@ 'gl': { 'djvutext-creating': u'Bot: Creo a páxina co texto extraído do DjVu', }, + # Author: Jetlag + 'hak': { + 'djvutext-creating': u'機械人:為從DjVu中提取頁面創建檔案', + }, # Author: Ofekalef 'he': { 'djvutext-creating': u'בוט: יוצר דף עם טקסט שיוצר מ־DjVu', Modified: branches/rewrite/scripts/i18n/editarticle.py =================================================================== --- branches/rewrite/scripts/i18n/editarticle.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/editarticle.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -127,6 +127,10 @@ 'gl': { 'editarticle-edit': u'Edición manual con bot: %(description)s', }, + # Author: Jetlag + 'hak': { + 'editarticle-edit': u'手動控制機械人進行更改:%(description)s', + }, 'he': { 'editarticle-edit': u'עריכה ידנית: %(description)s', }, Modified: branches/rewrite/scripts/i18n/featured.py =================================================================== --- branches/rewrite/scripts/i18n/featured.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/featured.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -225,6 +225,13 @@ 'featured-featured': u'Bot: "%(page)s" é un artigo destacado', 'featured-former': u'Bot: "%(page)s" é un antigo artigo destacado', }, + # Author: Jetlag + 'hak': { + 'featured-good': u'機械人:%(page)s為優良條目', + 'featured-list': u'機械人:%(page)s為特色列表', + 'featured-featured': u'機械人:%(page)s為特色條目', + 'featured-former': u'機械人:%(page)s曾經係一隻特色條目', + }, # Author: Amire80 'he': { 'featured-good': u'בוט: הדף %(page)s הוא ערך טוב', Modified: branches/rewrite/scripts/i18n/fixing_redirects.py =================================================================== --- branches/rewrite/scripts/i18n/fixing_redirects.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/fixing_redirects.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -133,6 +133,10 @@ 'gl': { 'fixing_redirects-fixing': u'Bot: Arranxo a redirección', }, + # Author: Jetlag + 'hak': { + 'fixing_redirects-fixing': u'機械人:修補重定向', + }, 'he': { 'fixing_redirects-fixing': u'בוט: מתקן הפניות', }, Modified: branches/rewrite/scripts/i18n/interwiki.py =================================================================== --- branches/rewrite/scripts/i18n/interwiki.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/interwiki.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -664,6 +664,17 @@ 'interwiki-removing': u'bot scryssit magh ec: %(removing)s', 'interwiki-removing-modifying': u'bot scryssit magh ec: %(removing)s caghlaait ec: %(modifying)s', }, + # Author: Jetlag + 'hak': { + 'interwiki-modifying': u'機械人:修改%(modifying)s', + 'interwiki-adding-modifying': u'機械人:增加%(adding)s、修改%(modifying)s', + 'interwiki-adding-removing': u'機械人:新增%(adding)s、刪除%(removing)s', + 'interwiki-adding-removing-modifying': u'機械人:添加%(adding)s、刪除%(removing)s、修改%(modifying)s', + 'interwiki-adding': u'機械人:新增%(adding)s', + 'interwiki-removing': u'機械人:刪除%(removing)s', + 'interwiki-removing-modifying': u'機械人:刪除%(removing)s、修改%(modifying)s', + 'interwiki-modifying-from': u'機械人:更換%(from)s至%(modifying)s', + }, 'he': { 'interwiki-modifying': u'בוט משנה: %(modifying)s', 'interwiki-adding-modifying': u'בוט מוסיף: %(adding)s משנה: %(modifying)s', Modified: branches/rewrite/scripts/i18n/isbn.py =================================================================== --- branches/rewrite/scripts/i18n/isbn.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/isbn.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -169,6 +169,10 @@ 'gl': { 'isbn-formatting': u'Bot: Dou formato ISBN', }, + # Author: Jetlag + 'hak': { + 'isbn-formatting': u'機械人:格式化ISBN', + }, # Author: YaronSh 'he': { 'isbn-formatting': u'בוט: מעצב מסת״ב', Modified: branches/rewrite/scripts/i18n/movepages.py =================================================================== --- branches/rewrite/scripts/i18n/movepages.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/movepages.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -122,6 +122,10 @@ 'gl': { 'movepages-moving': u'Bot: Páxina trasladada', }, + # Author: Jetlag + 'hak': { + 'movepages-moving': u'機械人:移動頁面', + }, 'he': { 'movepages-moving': u'בוט: מעביר דף', }, Modified: branches/rewrite/scripts/i18n/ndashredir.py =================================================================== --- branches/rewrite/scripts/i18n/ndashredir.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/ndashredir.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -110,6 +110,10 @@ 'gl': { 'ndashredir-create': u'Bot: Creo unha redirección con guión cara a "[[%(title)s]]"', }, + # Author: Jetlag + 'hak': { + 'ndashredir-create': u'機械人:創建連字符重定向到[[%(title)s]]', + }, # Author: ערן 'he': { 'ndashredir-create': u'בוט: יצירת הפניה עם מיקוף ל[[%(title)s]]', Modified: branches/rewrite/scripts/i18n/noreferences.py =================================================================== --- branches/rewrite/scripts/i18n/noreferences.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/noreferences.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -138,6 +138,10 @@ 'gl': { 'noreferences-add-tag': u'Bot: Engado a etiqueta <references />, que faltaba', }, + # Author: Jetlag + 'hak': { + 'noreferences-add-tag': u'機械人:添加缺少个<references/>標記', + }, 'he': { 'noreferences-add-tag': u'בוט: מוסיף תגית <references /> חסרה', }, Modified: branches/rewrite/scripts/i18n/pywikibot.py =================================================================== --- branches/rewrite/scripts/i18n/pywikibot.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/pywikibot.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -271,6 +271,16 @@ 'pywikibot-enter-category-name': u'Insira o nome da categoría:', 'pywikibot-enter-finished-browser': u'Prema na tecla "Intro" cando remate no navegador.', }, + # Author: Jetlag + 'hak': { + 'pywikibot-enter-xml-filename': u'請輸入XML Dump个文件名稱:', + 'pywikibot-enter-page-processing': u'哪隻頁面需要處理?', + 'pywikibot-enter-file-links-processing': u'哪隻圖像个連接需要處理?', + 'pywikibot-enter-namespace-number': u'請輸入名字空間編號:', + 'pywikibot-enter-new-text': u'請輸入新文字:', + 'pywikibot-enter-category-name': u'請輸入分類名稱:', + 'pywikibot-enter-finished-browser': u'搞掂後請撳下Enter鍵。', + }, # Author: Amire80 'he': { 'pywikibot-enter-xml-filename': u'נא להזין את שם קובץ ה־XML עם הדאמפ:', Modified: branches/rewrite/scripts/i18n/redirect.py =================================================================== --- branches/rewrite/scripts/i18n/redirect.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/redirect.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -375,6 +375,15 @@ 'redirect-remove-loop': u'Bot: O destino da redirección crea un bucle', 'redirect-broken-redirect-template': u'{{delete}}', }, + # Author: Jetlag + 'hak': { + 'redirect-fix-double': u'機械人:修正雙重定向至%(to)s', + 'redirect-remove-broken': u'機械人:重定向到已刪除或毋存在个頁面', + 'redirect-fix-broken-moved': u'機械人:修復損壞个重定向頁到移動目標頁面 %(to)s', + 'redirect-fix-loop': u'機械人:修復重定向迴圈至%(to)s', + 'redirect-remove-loop': u'機械人:重定向目標構成循環', + 'redirect-broken-redirect-template': u'{{db-r1}}', + }, # Author: Amire80 # Author: YaronSh # Author: ערן @@ -587,6 +596,7 @@ 'ml': { 'redirect-fix-double': u'യന്ത്രം: %(to)s എന്നതിലോട്ടുള്ള ഇരട്ട തിരിച്ചുവിടൽ ശരിയാക്കുന്നു', 'redirect-remove-broken': u'യന്ത്രം: മായ്ച്ച അല്ലെങ്കിൽ നിലവിലില്ലാത്ത താളിലോട്ടുള്ള തിരിച്ചുവിടൽ', + 'redirect-fix-broken-moved': u'യന്ത്രം: മാറ്റപ്പെട്ട വിക്കിതാളായ %(to)s എന്നതിലേയ്ക്കുള്ള പൊട്ടിയ തിരിച്ചുവിടൽ ശരിയാക്കുന്നു', 'redirect-fix-loop': u'യന്ത്രം: %(to)s എന്നതിലോട്ടുണ്ടായിരുന്ന ചാക്രിക തിരിച്ചുവിടൽ ശരിയാക്കുന്നു', 'redirect-remove-loop': u'യന്ത്രം: ലക്ഷ്യത്തിലോട്ടുള്ള തിരിച്ചുവിടൽ ഒരു തിരിച്ചുവിടൽ ചക്രം സൃഷ്ടിക്കുന്നു', 'redirect-broken-redirect-template': u'{{db-r1}}', Modified: branches/rewrite/scripts/i18n/replace.py =================================================================== --- branches/rewrite/scripts/i18n/replace.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/replace.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -142,6 +142,10 @@ 'gl': { 'replace-replacing': u'Bot: Substitución automática de texto %(description)s', }, + # Author: Jetlag + 'hak': { + 'replace-replacing': u'機械人:自動替換文字%(description)s', + }, 'he': { 'replace-replacing': u'בוט: החלפת טקסט אוטומטית %(description)s', }, Modified: branches/rewrite/scripts/i18n/solve_disambiguation.py =================================================================== --- branches/rewrite/scripts/i18n/solve_disambiguation.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/solve_disambiguation.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -353,6 +353,16 @@ 'solve_disambiguation-unknown-page': u'(descoñecido)', 'solve_disambiguation-links-removed': u'Páxina de homónimos resolta polo bot: eliminou unha ou varias ligazóns de "%(from)s"', }, + # Author: Jetlag + 'hak': { + 'solve_disambiguation-redirect-removed': u'機械人輔助消除歧義:%(from)s - 刪除鏈接', + 'solve_disambiguation-redirect-resolved': u'機械人輔助消除歧義:%(from)s - 連接改為%(to)s', + 'solve_disambiguation-links-resolved': u'機械人輔助消除歧義:%(from)s - 連接改為%(to)s', + 'solve_disambiguation-redirect-adding-dn-template': u'機械人輔助消除歧義:%(from)s - 標記為需要專家關注', + 'solve_disambiguation-adding-dn-template': u'機械人輔助消除歧義:%(from)s - 標記為需要專家關注', + 'solve_disambiguation-unknown-page': u'(吂知)', + 'solve_disambiguation-links-removed': u'機械人輔助消除歧義:%(from)s - 移除鏈接。', + }, # Author: Amire80 'he': { 'solve_disambiguation-redirect-removed': u'הסרת קישור לדף פירושונים באמצעות בוט: %(from)s', Modified: branches/rewrite/scripts/i18n/spellcheck.py =================================================================== --- branches/rewrite/scripts/i18n/spellcheck.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/spellcheck.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -99,6 +99,10 @@ 'gl': { 'spellcheck-checking': u'Corrección ortográfica asistida por un bot', }, + # Author: Jetlag + 'hak': { + 'spellcheck-checking': u'機械人輔助个拼寫檢查', + }, 'he': { 'spellcheck-checking': u'בדיקת איות באמצעות בוט', }, Modified: branches/rewrite/scripts/i18n/table2wiki.py =================================================================== --- branches/rewrite/scripts/i18n/table2wiki.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/table2wiki.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -148,6 +148,11 @@ 'table2wiki-warnings': u'Bot: Actualizo a sintaxe da táboa; {{PLURAL:count|1 aviso|%(count)d avisos}}!', 'table2wiki-no-warning': u'Bot: Actualizo a sintaxe da táboa', }, + # Author: Jetlag + 'hak': { + 'table2wiki-warnings': u'手動控制機械人進行表語法更新-出現%(count)d隻警告!', + 'table2wiki-no-warning': u'使用者控制个機械人: 表更新个語法', + }, # Author: Xqt 'he': { 'table2wiki-warnings': u'בוט בפיקוח משתמש: עדכון תחביר הטבלה - {{PLURAL:count|אזהרה אחת|%(count)d אזהרות}}!', Modified: branches/rewrite/scripts/i18n/template.py =================================================================== --- branches/rewrite/scripts/i18n/template.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/template.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -180,6 +180,12 @@ 'template-changing': u'Bot: Cambio {{PLURAL:%(num)d|o modelo|varios modelos}}: %(list)s', 'template-substituting': u'Bot: Substitúo {{PLURAL:%(num)d|o modelo|varios modelos}}: %(list)s', }, + # Author: Jetlag + 'hak': { + 'template-removing': u'機械人刪除%(num)d個模板:%(list)s', + 'template-changing': u'機械人更改%(num)d個模板:%(list)s', + 'template-substituting': u'機械人替換%(num)d個模板:%(list)s', + }, 'he': { 'template-removing': u'בוט: מסיר {{PLURAL:%(num)d|תבנית|תבניות}}: %(list)s', 'template-changing': u'בוט: משנה {{PLURAL:%(num)d|תבנית|תבניות}}: %(list)s', Modified: branches/rewrite/scripts/i18n/thirdparty.py =================================================================== --- branches/rewrite/scripts/i18n/thirdparty.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/thirdparty.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -665,6 +665,26 @@ 'gu': { 'thirdparty-drtrigonbot-sum_disc-summary-head': u'રોબોટ', }, + # Author: Jetlag + 'hak': { + 'thirdparty-drtrigonbot-sum_disc-summary-head': u'機械人', + 'thirdparty-drtrigonbot-sum_disc-parse-nonhuman': u'(無發現人類編輯)', + 'thirdparty-drtrigonbot-sum_disc-parse-start': u';%d. %B %Y', + 'thirdparty-drtrigonbot-sum_disc-parse': u':* %(notify)s: %(page_sections)s - [%(history_link)s 最尾編輯] (由%(user)s於%(time)s更改%(page_size)s位元)', + 'thirdparty-drtrigonbot-sum_disc-parse-warning': u':* 機械人警告信息:%(page)s"\'\'%(warning)s\'\'"', + 'thirdparty-drtrigonbot-sum_disc-notify-new': u'新討論', + 'thirdparty-drtrigonbot-sum_disc-parse-notify': u':* %(notify)s: %(page_sections)s - [%(history_link)s %(page)s] (由%(user)s於%(time)s更改%(page_size)s位元)', + 'thirdparty-drtrigonbot-sum_disc-notify-notify': u'通知', + 'thirdparty-drtrigonbot-subster-summary-mod': u'替換%(tags)s標記', + 'thirdparty-drtrigonbot-sum_disc-notify-closed': u'討論已關閉', + 'thirdparty-drtrigonbot-sum_disc-parse-closed': u':* %(notify)s:%(page)s所有討論完結(停止監察)-最後由%(user)s於%(time)s編輯', + 'thirdparty-drtrigonbot-sum_disc-summary-add': u'添加討論摘要:%(num)i項', + 'thirdparty-drtrigonbot-sum_disc-notify-changed': u'討論已更改', + 'thirdparty-drtrigonbot-sum_disc-summary-clean': u'添加並修改討論摘要:%(num)i項', + 'thirdparty-drtrigonbot-sum_disc-summary-mod': u'討論摘要更新:%(page)s裏肚%(num)i項', + 'thirdparty-drtrigonbot-sum_disc-notify-maintmsg': u'機械人消息', + 'thirdparty-drtrigonbot-sum_disc-parse-end': u'<noinclude>\n\n摘要由在%(sign)s生成</noinclude></noinclude>', + }, # Author: Amire80 # Author: Ofekalef # Author: YaronSh Modified: branches/rewrite/scripts/i18n/unlink.py =================================================================== --- branches/rewrite/scripts/i18n/unlink.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/unlink.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -116,6 +116,10 @@ 'gl': { 'unlink-unlinking': u'Bot: Quito a ligazón cara a "%s"', }, + # Author: Jetlag + 'hak': { + 'unlink-unlinking': u'機械人: 斷開連結" %s "', + }, 'he': { 'unlink-unlinking': u'בוט: מסיר קישורים לדף "%s"', }, Modified: branches/rewrite/scripts/i18n/weblinkchecker.py =================================================================== --- branches/rewrite/scripts/i18n/weblinkchecker.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/weblinkchecker.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -136,6 +136,13 @@ 'weblinkchecker-summary': u'Bot: Sinalo a ligazón externa non dispoñible', 'weblinkchecker-report': u'Durante varias execucións automáticas, o bot constatou que a seguinte ligazón externa non está dispoñible. Comprobe se a ligazón está efectivamente caída e corríxaa ou retírea!', }, + # Author: Jetlag + 'hak': { + 'weblinkchecker-archive_msg': u'這個網頁已經畀互聯網檔案館(Internet Archive)保存。請為該網頁挑選一個適合鏈接个存檔版本: [%(URL)s]。', + 'weblinkchecker-caption': u'失效連結', + 'weblinkchecker-summary': u'機械人:報告無效个外部連結', + 'weblinkchecker-report': u'自動運行个機械人發現下列外部連結可能已經無用。請幫助檢查,修復或移除有問題个連結。', + }, 'he': { 'weblinkchecker-archive_msg': u'עמוד האינטרנט נשמר על־ידי ארכיון האינטרנט. אנא שקלו לקשר לגרסה המאורכבת המתאימה: [%(URL)s]', 'weblinkchecker-caption': u'קישור שבור', @@ -209,7 +216,9 @@ # Author: Praveenp # Author: Santhosh.thottingal 'ml': { + 'weblinkchecker-archive_msg': u'വെബ് താൾ ഇന്റർനെറ്റ് ശേഖരം സൂക്ഷിച്ചിരിക്കുന്നു. ദയവായി അനുയോജ്യമായ ശേഖരത്തിന്റെ പതിപ്പിലേയ്ക്ക് കണ്ണി ചേർക്കാൻ താത്പര്യപ്പെടുന്നു: [%(URL)s].', 'weblinkchecker-caption': u'പ്രവർത്തിക്കാത്ത കണ്ണി', + 'weblinkchecker-summary': u'യന്ത്രം: ലഭ്യമല്ലാത്ത ബാഹ്യ കണ്ണി അറിയിക്കുന്നു', }, # Author: Anakmalaysia 'ms': { Modified: branches/rewrite/scripts/i18n/welcome.py =================================================================== --- branches/rewrite/scripts/i18n/welcome.py 2013-05-12 15:45:43 UTC (rev 11525) +++ branches/rewrite/scripts/i18n/welcome.py 2013-05-12 18:51:23 UTC (rev 11526) @@ -243,6 +243,12 @@ 'gu': { 'welcome-welcome': u'સ્વાગત!', }, + # Author: Jetlag + 'hak': { + 'welcome-welcome': u'歡迎!', + 'welcome-bad_username': u'機械人:添加需要檢查个用戶名', + 'welcome-updating': u'機械人:更新日誌', + }, # Author: Amire80 'he': { 'welcome-welcome': u'ברוך הבא!',
1
0
0
0
SVN: [11525] trunk/pywikipedia/catimages.py
by drtrigon@svn.wikimedia.org
12 May '13
12 May '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11525
Revision: 11525 Author: drtrigon Date: 2013-05-12 15:45:43 +0000 (Sun, 12 May 2013) Log Message: ----------- start migration from 'dtbext' to 'externals' Modified Paths: -------------- trunk/pywikipedia/catimages.py Modified: trunk/pywikipedia/catimages.py =================================================================== --- trunk/pywikipedia/catimages.py 2013-05-12 15:36:25 UTC (rev 11524) +++ trunk/pywikipedia/catimages.py 2013-05-12 15:45:43 UTC (rev 11525) @@ -91,6 +91,8 @@ import wikipedia as pywikibot import pagegenerators, catlib import checkimages +import dtbext as externals # check for and install needed 'externals' +externals.check_setup_all() # # DrTrigonBot framework packages target = os.path.join(scriptdir, 'dtbext')
1
0
0
0
SVN: [11524] trunk/pywikipedia
by drtrigon@svn.wikimedia.org
12 May '13
12 May '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11524
Revision: 11524 Author: drtrigon Date: 2013-05-12 15:36:25 +0000 (Sun, 12 May 2013) Log Message: ----------- new feature; introduce "externals" like in rewrite additional feature is automatic installation of missing code Modified Paths: -------------- trunk/pywikipedia/subster.py Added Paths: ----------- trunk/pywikipedia/externals/ trunk/pywikipedia/externals/__init__.py Removed Paths: ------------- trunk/pywikipedia/crontab/ trunk/pywikipedia/odf/ trunk/pywikipedia/openpyxl/ Added: trunk/pywikipedia/externals/__init__.py =================================================================== --- trunk/pywikipedia/externals/__init__.py (rev 0) +++ trunk/pywikipedia/externals/__init__.py 2013-05-12 15:36:25 UTC (rev 11524) @@ -0,0 +1,293 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +""" +Externals modules automatic setup checker and installer for various OS. +""" + +# +# (C) DrTrigon, 2013 +# (C) Pywikipedia team, 2013 +# +# Distributed under the terms of the MIT license. +# +# Strongly inspired by files beeing part of VisTrails distribution +# utils/installbundle.py +# utils/requirements.py +# Copyright (C) 2006-2010 University of Utah. All rights reserved. +# GNU General Public License version 2.0 by the Free Software Foundation +# +__version__ = '$Id$' +# + + +# supports: 1. package management system (yum, apt-get, ...) +# 2. download from url (or svn, git repo) +# (?. checkout from svn/mercurial repo) +# 3. svn:externals +modules_needed = { +# TODO: vvv +# 'crontab' has to be moved and integrated (in)to externals as well + 'crontab': ({}, + #{ 'url': '
https://github.com/josiahcarlson/parse-crontab/archive/master.zip
', + # 'path': 'parse-crontab-master/crontab',}), # OK + { 'url': '
https://github.com/josiahcarlson/parse-crontab/archive/1ec538ff67df6a207993…
', + 'path': 'parse-crontab-1ec538ff67df6a207993a6c5b6988f4f628c5776/crontab',}),# OK +# TODO: vvv +# 'odf' has to be moved and integrated (in)to externals as well + 'odf': ({}, + #{ 'url': '
https://pypi.python.org/packages/source/o/odfpy/odfpy-0.9.6.tar.gz
', + # 'path': 'odfpy-0.9.6/odf',}), # OK + { 'url': '
https://pypi.python.org/packages/source/o/odfpy/odfpy-0.9.4.tar.gz
', + 'path': 'odfpy-0.9.4/odf',}), # OK +# TODO: vvv +# 'openpyxl' has to be moved and integrated (in)to externals as well + 'openpyxl': ({}, + { 'url': '
https://bitbucket.org/ericgazoni/openpyxl/get/1.5.6.tar.gz
', + 'path': 'ericgazoni-openpyxl-e5934500ffac/openpyxl',}),# OK +# 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 +# 'i18n' 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
', + 'path': 'python-colormath-master/colormath',}), # OK + 'jseg': ({}, + { 'url': '
http://vision.ece.ucsb.edu/segmentation/jseg/software/jseg.zip
', + 'path': 'jseg', + #$ diff -Nau --exclude="*.o" --exclude="*.pyc" --exclude="segdist_cpp*" TEST_jseg/ jseg/ > patch-jseg + 'patch': 'patch-jseg',}), # OK + 'jseg/jpeg-6b': ({}, + { 'url': '
http://vision.ece.ucsb.edu/segmentation/jseg/software/jpeg-6b.zip
', + 'path': 'jpeg-6b',}), # OK +# TODO: vvv (future; enable for and use in 'catimages.py') +# '_mlpy': ({}, +# { 'url': '
http://downloads.sourceforge.net/project/mlpy/mlpy%203.5.0/mlpy-3.5.0.tar.gz
', +# 'path': 'mlpy-3.5.0/mlpy',}), # OK + '_music21': ({}, + { 'url': '
http://music21.googlecode.com/files/music21-1.4.0.tar.gz
', + 'path': 'music21-1.4.0', + #$ diff -Naur --exclude="*.pyc" TEST__music21/ _music21/ > patch-music21 + 'patch': 'patch-music21',}), # OK +# TODO: vvv (future; enable for and use in 'catimages.py') +# mercurial: $ hg clone -r ocropus-0.6pre3
https://code.google.com/p/ocropus
+# '_ocropus': ({}, +# {}), # OPEN +# TODO: vvv (further clean-up and unlink - check with 'svn list') +# 'opencv': $ svn propedit svn:externals . +# bagofwords_classification.cpp
https://svn.toolserver.org/svnroot/drtrigon/externals/opencv/bagofwords_cla…
+# bagofwords_classification_python.cpp
https://svn.toolserver.org/svnroot/drtrigon/externals/opencv/bagofwords_cla…
+# camera_virtual_default
https://svn.toolserver.org/svnroot/drtrigon/externals/opencv/camera_virtual…
+# facetest.pl
https://svn.toolserver.org/svnroot/drtrigon/externals/opencv/facetest.pl
+# __init.py__
https://svn.toolserver.org/svnroot/drtrigon/externals/opencv/__init__.py
+# makefile
https://svn.toolserver.org/svnroot/drtrigon/externals/opencv/makefile
+# peopledetect.py
https://svn.toolserver.org/svnroot/drtrigon/externals/opencv/peopledetect.py
+# $ svn propedit svn:externals haarcascades/haartraining/ +# HaarTraining
https://svn.toolserver.org/svnroot/drtrigon/externals/haartraining/HaarTrai…
+# HaarTraining.tar.gz
https://svn.toolserver.org/svnroot/drtrigon/externals/haartraining/HaarTrai…
+# convert_cascade.c
https://svn.toolserver.org/svnroot/drtrigon/externals/haartraining/convert_…
+# create_pos_neg.py
https://svn.toolserver.org/svnroot/drtrigon/externals/haartraining/create_p…
+# createtestsamples.pl
https://svn.toolserver.org/svnroot/drtrigon/externals/haartraining/createte…
+# createtrainsamples.pl
https://svn.toolserver.org/svnroot/drtrigon/externals/haartraining/createtr…
+'opencv/haarcascades': ({}, + { '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
' . + '_pydmtx': ({'linux-fedora': ['python-libdmtx'], + 'linux-ubuntu': ['libdmtx-dev'],}, + { 'url': '
https://github.com/dmtx/dmtx-wrappers/archive/master.zip
', + 'path': 'dmtx-wrappers-master/python', + #$ diff -Naur TEST__pydmtx/ _pydmtx/ > patch-pydmtx + 'patch': 'patch-pydmtx',}), # OK + 'py_w3c': ({}, + { 'url': '
https://bitbucket.org/nmb10/py_w3c/downloads/py_w3c-v0.1.0.tar.gz
', + 'path': 'py_w3c-0.1.0/py_w3c',}), # OK +# TODO: vvv (include) +# 'TEST_slic': ({}, +# { 'url': '
https://github.com/amueller/slic-python/archive/master.zip
', +# 'path': 'slic-python-master',}), # OPEN +# 'TEST_slic': ({}, +# { 'url': '
http://ivrg.epfl.ch/files/content/sites/ivrg/files/supplementary_material/R…
', +# 'path': 'SLICSuperpixelsAndSupervoxelsCode/SLICSuperpixels',}),# OPEN +# (2 download sources to same dir) + patch (at least for '__init__.py') needed + '_zbar': ({'linux-fedora': ['zbar'], + 'linux-ubuntu': ['python-zbar'],}, + { 'url': '
https://pypi.python.org/packages/source/z/zbar/zbar-0.10.tar.bz2
', + 'path': 'zbar-0.10', + #$ diff -Nau --exclude="*.pyc" TEST__zbar/ _zbar/ > patch-zbar + 'patch': 'patch-zbar',}), # OK +# TODO: vvv (include) +# 'TEST__bob': ({}, +# { 'url': '
https://www.idiap.ch/software/bob/packages/bob-1.1.2.zip
', +# 'path': 'bob-1.1.2',}), # OPEN +# (complex compilation) + patch (at least for '__init__.py') needed +# 'TEST_xbob_flandmark': ({}, +# { 'url': '
https://pypi.python.org/packages/source/x/xbob.flandmark/xbob.flandmark-1.0…
', +# 'path': 'xbob.flandmark-1.0.9',}), # OPEN +# (complex compilation, dependent on '_bob') + patch (at least for '__init__.py') needed +} + +#modules_order = ['crontab', 'odf', 'openpyxl', +# 'colormath', 'jseg', 'jseg/jpeg-6b', '_mlpy', '_music21', +# '_ocropus', 'opencv', 'opencv/haarcascades', '_pydmtx', +# 'py_w3c', 'slic', '_zbar', '_bob', 'xbob_flandmark',] +modules_order = [#'crontab', 'odf', 'openpyxl', + 'colormath', 'jseg', 'jseg/jpeg-6b', '_music21', + 'opencv/haarcascades', '_pydmtx', 'py_w3c', '_zbar',] + + +import os, sys + +import wikipedia as pywikibot + + +sys.path.append(os.path.dirname(os.path.abspath(os.path.join(os.curdir, __file__)))) + + +### BEGIN of VisTrails inspired and copied code ### ### ### ### ### ### ### ### + +def guess_system(): + import platform + return ("%s-%s" % (platform.system(), platform.dist()[0])).lower() + +def show_question(which_files): + pywikibot.output("Required package missing") + pywikibot.output("A required package is missing, but externals can" + " automatically install it." + " If you say Yes, externals will need administrator" + " privileges, and you might be asked for the administrator" + " password.") + pywikibot.output("Give externals permission to try to install package?" + " (y/N)") + v = raw_input().upper() + return v == 'Y' or v == 'YES' + + +def linux_ubuntu_install(package_name): + cmd = 'apt-get install -y' + + if type(package_name) == str: + cmd += ' ' + package_name + elif type(package_name) == list: + for package in package_name: + if type(package) != str: + raise TypeError("Expected string or list of strings") + cmd += ' ' + package + + pywikibot.warning("externals wants to install package(s) '%s'" % + package_name) + sucmd = "sudo %s" % cmd + + result = os.system(sucmd) + + return (result == 0) # 0 indicates success + +def linux_fedora_install(package_name): + cmd = 'yum -y install' + + if type(package_name) == str: + cmd += ' ' + package_name + elif type(package_name) == list: + for package in package_name: + if type(package) != str: + raise TypeError("Expected string or list of strings") + cmd += ' ' + package + + pywikibot.warning("externals wants to install package(s) '%s'" % + package_name) + sucmd = "su -c'%s'" % cmd + + result = os.system(sucmd) + + return (result == 0) + +def linux_install(dependency_dictionary): + """Tries to import a python module. If unsuccessful, tries to install +the appropriate bundle and then reimport. py_import tries to be smart +about which system it runs on.""" + + # Ugly fix to avoid circular import + distro = guess_system() + if not dependency_dictionary.has_key(distro): + return False + else: + files = dependency_dictionary[distro] + if files and show_question(files): + callable_ = globals()[distro.replace('-', '_') + '_install'] + return callable_(files) + else: + return False + +### END of VisTrails inspired and copied code ### ### ### ### ### ### ### ### + + +def download_install(package, module, path): + if package: + pywikibot.warning(u'Download package "%s" from %s' + % (module, package['url'])) + import urllib2, mimetypes + response = urllib2.urlopen(package['url']) + pywikibot.warning(u'Size of download: %s byte(s)' + % response.headers['Content-Length']) + #mime = response.headers['Content-Type'].lower().split('/') + mime = mimetypes.guess_type(package['url'], strict=True)[0].lower().split('/') + pywikibot.warning(u'MIME type: %s' % mime) + + pywikibot.warning(u'Extract package "%s" to %s' + % (module, os.path.join(path, module))) + if len(mime) > 1: + if mime[1] == 'zip': + import zipfile, StringIO + arch = zipfile.ZipFile(StringIO.StringIO(response.read())) + elif mime[1] == 'x-tar': + import tarfile, StringIO + arch = tarfile.open(fileobj=StringIO.StringIO(response.read())) + arch.extractall(os.path.join(path, '__setup_tmp/')) + arch.close() + import shutil + shutil.move(os.path.join(path, '__setup_tmp/', package['path']), + os.path.join(path, module)) + shutil.rmtree(os.path.join(path, '__setup_tmp/')) + + result = 0 + if 'patch' in package: + pywikibot.warning(u'Install package "%s" by applying patch to %s.' + % (module, os.path.join(path, module))) + cmd = 'patch -p0 -d %s < %s' % (path, os.path.join(path, package['patch'])) + result = os.system(cmd) + + pywikibot.warning(u'Package "%s" installed to %s.' + % (module, os.path.join(path, module))) + return (result == 0) + + return False + + +def check_setup(m): + path = os.path.dirname(os.path.abspath(os.path.join(os.curdir, __file__))) + mf = os.path.join(path, m) + + #__import__(mf) + if not os.path.exists(mf): + # install the missing module + if linux_install(modules_needed[m][0]): + return + if download_install(modules_needed[m][1], m, path): + return +# if svn_repo_install(modules_needed[m][2]): +# return + pywikibot.error(u'Package "%s" could not be found nor installed!' + % m) + +def check_setup_all(): + #for m in modules_needed: + for m in modules_order: + check_setup(m) + + +#check_setup_all() Property changes on: trunk/pywikipedia/externals/__init__.py ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Modified: trunk/pywikipedia/subster.py =================================================================== --- trunk/pywikipedia/subster.py 2013-05-10 20:05:45 UTC (rev 11523) +++ trunk/pywikipedia/subster.py 2013-05-12 15:36:25 UTC (rev 11524) @@ -70,8 +70,6 @@ import BeautifulSoup import StringIO, zipfile, csv import mailbox, mimetypes, datetime, email.utils -import openpyxl.reader.excel -import crontab import logging import ast import shelve, pprint @@ -81,6 +79,12 @@ import wikipedia as pywikibot from pywikibot import i18n from pywikibot.comms import http +import externals # check for and install needed 'externals' +externals.check_setup('crontab') # +externals.check_setup('odf') # +externals.check_setup('openpyxl') # +import openpyxl.reader.excel +import crontab # TODO: think about what config to move to 'subster-config.css' (per wiki)
1
0
0
0
SVN: [11523] branches/rewrite/pywikibot/bot.py
by drtrigon@svn.wikimedia.org
10 May '13
10 May '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11523
Revision: 11523 Author: drtrigon Date: 2013-05-10 20:05:45 +0000 (Fri, 10 May 2013) Log Message: ----------- bug fix; from trunk, enable to continue after ParseError Modified Paths: -------------- branches/rewrite/pywikibot/bot.py Modified: branches/rewrite/pywikibot/bot.py =================================================================== --- branches/rewrite/pywikibot/bot.py 2013-05-10 19:57:56 UTC (rev 11522) +++ branches/rewrite/pywikibot/bot.py 2013-05-10 20:05:45 UTC (rev 11523) @@ -248,9 +248,12 @@ output(u'COMMAND: %s' % unicode(sys.argv)) # new framework release/revision? (handleArgs needs to be called first) - output(u'VERSION: %s' % unicode((version.getversion().strip(), - version.getversion_onlinerepo(), - site.live_version()))) + try: + output(u'VERSION: %s' % unicode((version.getversion().strip(), + version.getversion_onlinerepo(), + site.live_version()))) + except version.ParseError: + exception() # system if hasattr(os, 'uname'):
1
0
0
0
← Newer
1
...
23
24
25
26
27
28
29
...
517
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
Results per page:
10
25
50
100
200