Browse Source

Bugfix in plugin Validator

Now an empty string is replaced by None
Yann Weber 8 years ago
parent
commit
15e97bf2bd
1 changed files with 4 additions and 3 deletions
  1. 4
    3
      lodel/validator/validator.py

+ 4
- 3
lodel/validator/validator.py View File

362
 # @brief Validator for plugin name & optionnaly type
362
 # @brief Validator for plugin name & optionnaly type
363
 #
363
 #
364
 # Able to check that the value is a plugin and if it is of a specific type
364
 # Able to check that the value is a plugin and if it is of a specific type
365
-
366
-
365
+#@param value the plugin name
366
+#@param ptype : plugin type
367
 def plugin_validator(value, ptype=None):
367
 def plugin_validator(value, ptype=None):
368
     LodelContext.expose_modules(globals(), {
368
     LodelContext.expose_modules(globals(), {
369
         'lodel.plugin.hooks': ['LodelHook']})
369
         'lodel.plugin.hooks': ['LodelHook']})
370
-    value = copy.copy(value)
370
+    value = copy.copy(value.strip())
371
+    value = None if len(value) == 0 else value
371
 
372
 
372
     @LodelHook('lodel2_dyncode_bootstraped')
373
     @LodelHook('lodel2_dyncode_bootstraped')
373
     def plugin_type_checker(hookname, caller, payload):
374
     def plugin_type_checker(hookname, caller, payload):

Loading…
Cancel
Save