def InitPlugins(visFr): for mn in mods: #print mods logger.debug('Initializing %s plugin' % mn) m = __import__('PYME.LMVis.Extras.' + mn, fromlist=['PYME', 'LMVis', 'Extras']) m.Plug(visFr) for mn in config.get_plugins('visgui'): try: m = __import__(mn, fromlist=mn.split('.')[:-1]) m.Plug(visFr) except Exception as e: #import traceback #traceback.print_exc() logger.exception('Error loading plugin: %s' % mn)
from . import multiview from . import surface_fitting from . import acquisition from . import pyramid from . import pointcloud try: from . import skfilters except: logger.exception('Could not import skimage') pass try: from . import machine_learning except ImportError: pass from .base import ModuleCollection #load any custom recipe modules for mn in config.get_plugins('recipes'): try: print('Trying to load 3rd party recipe module %s' % mn) m = __import__(mn, fromlist=mn.split('.')[:-1]) print('Loaded 3rd party recipe module %s' % mn) except Exception as e: logger.exception('Error loading plugin: %s' % mn) def getModuleNames(): return base.all_modules.keys()
import os from imp import reload from PYME import config localmodules = [ os.path.splitext(os.path.split(p)[-1])[0] for p in glob.glob(__path__[0] + '/[a-zA-Z]*.py') ] modLocations = {} for m in localmodules: modLocations[m] = ['PYME', 'DSView', 'modules'] for m in config.get_plugins('dsviewer'): ms = m.split('.') modLocations[ms[-1]] = ms[:-1] def allmodules(): am = list(modLocations.keys()) am.sort() return am basemodules = [ 'shell', 'metadataView', 'eventView', 'deconvolution', 'tiling', 'recipes' ] liteModules = [