MCPcopy Create free account
hub / github.com/Image-Py/imagepy / buildMenuBarByPath

Function buildMenuBarByPath

imagepy/ui/pluginloader.py:44–62  ·  view source on GitHub ↗
(parent, path, extends, menuBar=None, report=False)

Source from the content-addressed store, hash-verified

42
43#!ToDO: tongguo lujing goujian menu
44def buildMenuBarByPath(parent, path, extends, menuBar=None, report=False):
45 datas = loader.build_plugins(path, report)
46 keydata = {}
47 for i in datas[1]:
48 if isinstance(i, tuple): keydata[i[0].__name__.split('.')[-1]] = i[1]
49 #print(keydata)
50 extends = glob(extends+'/*/menus')
51 for i in extends:
52 plgs = loader.build_plugins(i, report)
53 for j in plgs[1]:
54 if not isinstance(j, tuple): continue
55 name = j[0].__name__.split('.')[-1]
56 if name in keydata:
57 keydata[name].extend(j[1])
58 else: datas[1].append(j)
59 #if len(wgts)!=0: datas[1].extend(wgts[1])
60 # print(datas)
61 if not menuBar is None:menuBar.SetMenus([])
62 return buildMenuBar(parent, datas, menuBar)
63
64def codeSplit(txt):
65 sep = txt.split('-')

Callers

nothing calls this directly

Calls 2

buildMenuBarFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected