(parent, path, extends, menuBar=None, report=False)
| 42 | |
| 43 | #!ToDO: tongguo lujing goujian menu |
| 44 | def 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 | |
| 64 | def codeSplit(txt): |
| 65 | sep = txt.split('-') |
nothing calls this directly
no test coverage detected