|
@@ -114,13 +114,17 @@ class Plugin(object):
|
114
|
114
|
#@param plugin_path
|
115
|
115
|
#@return module existing
|
116
|
116
|
def _discover_plugin(self, plugin_path):
|
117
|
|
- import os
|
118
|
|
- try:
|
119
|
|
- for root, dirs, files in os.walk(plugin_path, topdown = True):
|
120
|
|
- return dirs
|
121
|
|
- except NameError:
|
122
|
|
- msg = "This plugin {plugin_path} is not valid"
|
123
|
|
-
|
|
117
|
+ res = os.listdir(plugin_path) is not None
|
|
118
|
+ if res:
|
|
119
|
+ dirname = os.path.dirname(plugin_path)
|
|
120
|
+ for f in os.listdir(plugin_path):
|
|
121
|
+ file_name = ''.join(dirname, f)
|
|
122
|
+ if f == '__init__.py':
|
|
123
|
+ self.check(file_name)
|
|
124
|
+ else:
|
|
125
|
+ self._discover_plugin(file_name)
|
|
126
|
+ else:
|
|
127
|
+ pass
|
124
|
128
|
|
125
|
129
|
|
126
|
130
|
##@brief Try to import a file from a variable in __init__.py
|