Exemple #1
0
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)
Exemple #2
0
 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])
Exemple #3
0
 def load(self):
     data = loader.build_plugins('menus')
     root = self.tre_plugins.AddRoot('Plugins')
     self.addnode(root, data[1])