__init__.py (933B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\devtools\script\uiControlCatalog\__init__.py 2 from __future__ import print_function 3 import inspect 4 import pkgutil 5 import os 6 import imp 7 8 def Test(): 9 path = os.path.dirname(__file__) + '/controls' 10 ret = walk_modules(path) 11 print('RETURNING', ret) 12 return ret 13 14 15 def walk_modules(path): 16 for module_loader, name, ispkg in pkgutil.iter_modules([path]): 17 print(name, ispkg) 18 if ispkg: 19 return walk_modules(path + '/' + name) 20 module = get_module(module_loader, name) 21 print(module.__file__) 22 for n, val in inspect.getmembers(module): 23 if n == 'CLASS': 24 print('YES', val) 25 26 27 def get_module(module_loader, name): 28 module_path = module_loader.path + '/%s.py' % name 29 module = imp.load_source(name, module_path) 30 return module 31 32 33 if __name__ == '__main__': 34 Test()