http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11551
Revision: 11551 Author: drtrigon Date: 2013-05-19 09:16:42 +0000 (Sun, 19 May 2013) Log Message: ----------- improvement; added externals import in order to check and install needed modules
Modified Paths: -------------- trunk/pywikipedia/catimages.py trunk/pywikipedia/maintainer.py trunk/pywikipedia/maintcont.py
Modified: trunk/pywikipedia/catimages.py =================================================================== --- trunk/pywikipedia/catimages.py 2013-05-18 19:42:20 UTC (rev 11550) +++ trunk/pywikipedia/catimages.py 2013-05-19 09:16:42 UTC (rev 11551) @@ -57,7 +57,7 @@ if not os.path.isabs(scriptdir): scriptdir = os.path.abspath(os.path.join(os.curdir, scriptdir))
-# additional python packages (more exotic and problematic ones) +# additional python packages (non-default but common) try: import numpy as np from scipy import ndimage, fftpack, linalg#, signal @@ -78,6 +78,14 @@ except: # either raise the ImportError later or skip it pass + +# pywikipedia framework python packages +import wikipedia as pywikibot +import pagegenerators, catlib +import checkimages +import externals # allow import from externals + +# additional python packages (more exotic and problematic ones) # modules needing compilation are imported later on request: # (see https://jira.toolserver.org/browse/TS-1452) # e.g. opencv, jseg, slic, pydmtx, zbar, (pyml or equivalent) @@ -86,14 +94,8 @@ # TODO: # (pdfminer not used anymore/at the moment...) # python-djvulibre or python-djvu for djvu support - -# pywikipedia framework python packages -import wikipedia as pywikibot -import pagegenerators, catlib -import checkimages -import externals # check for and install needed -externals.check_setup('colormath') # 'externals' modules -externals.check_setup('jseg') # +externals.check_setup('colormath') # check for and install needed +externals.check_setup('jseg') # 'externals' modules externals.check_setup('jseg/jpeg-6b') # #externals.check_setup('_mlpy') # externals.check_setup('_music21') # @@ -106,7 +108,6 @@ from colormath.color_objects import RGBColor from py_w3c.validators.html.validator import HTMLValidator, ValidationFault #from pdfminer import pdfparser, pdfinterp, pdfdevice, converter, cmapdb, layout - #externals.check_setup('_ocropus')
locale.setlocale(locale.LC_ALL, '') @@ -3410,6 +3411,7 @@ # self._detect_AudioFeatures_YAAFE()
# midi audio feature extraction +# TODO: improve midi/audio stuff ... self._detect_AudioFeatures_MUSIC21()
def _existInformation(self, info, ignore = ['Properties', 'ColorAverage']):
Modified: trunk/pywikipedia/maintainer.py =================================================================== --- trunk/pywikipedia/maintainer.py 2013-05-18 19:42:20 UTC (rev 11550) +++ trunk/pywikipedia/maintainer.py 2013-05-19 09:16:42 UTC (rev 11551) @@ -12,8 +12,6 @@ # Author: Balasyum # http://hu.wikipedia.org/wiki/User:Balasyum
-from ircbot import SingleServerIRCBot -from irclib import nm_to_n import random import thread import threading @@ -21,6 +19,10 @@ import rciw import censure import wikipedia as pywikibot +import externals +externals.check_setup('irclib') +from ircbot import SingleServerIRCBot +from irclib import nm_to_n
ver = 1
Modified: trunk/pywikipedia/maintcont.py =================================================================== --- trunk/pywikipedia/maintcont.py 2013-05-18 19:42:20 UTC (rev 11550) +++ trunk/pywikipedia/maintcont.py 2013-05-19 09:16:42 UTC (rev 11551) @@ -13,6 +13,8 @@ # Author: Balasyum # http://hu.wikipedia.org/wiki/User:Balasyum
+import externals +externals.check_setup('irclib') from ircbot import SingleServerIRCBot from irclib import nm_to_n import threading