def load_plugins(): from imagepy.core.loader import loader loader.build_plugins('menus', True) from glob import glob extends = glob('plugins/*/menus') for i in extends: loader.build_plugins(i, True)
def load(self): datas = loader.build_plugins('menus') keydata = {} for i in datas[1]: if isinstance(i, tuple): keydata[i[0].__name__.split('.')[-1]] = i[1] #print(keydata) extends = glob('plugins/*/menus') for i in extends: plgs = loader.build_plugins(i) for j in plgs[1]: if not isinstance(j, tuple): continue name = j[0].__name__.split('.')[-1] if name in keydata: keydata[name].extend(j[1]) else: datas[1].append(j) root = self.tre_plugins.AddRoot('Plugins') self.addnode(root, datas[1])
def load(self): data = loader.build_plugins('menus') root = self.tre_plugins.AddRoot('Plugins') self.addnode(root, data[1])