diff --git a/paddlehub/commands/run.py b/paddlehub/commands/run.py index a3476f508a296cf13b255b2516a81093d6bf616c..5fe060ee2e51351ac2c822e0f91f830abe2da5b1 100644 --- a/paddlehub/commands/run.py +++ b/paddlehub/commands/run.py @@ -234,7 +234,7 @@ class RunCommand(BaseCommand): return False # If the module is not executable, give an alarm and exit - if not self.module.is_runable: + if not self.module.is_runnable: print("ERROR! Module %s is not executable." % module_name) return False diff --git a/paddlehub/module/module.py b/paddlehub/module/module.py index 447187256baad4f688401c8ba68e4d0e3a8ccf5f..351c8ecbef2cf2ccd4229d404d84a33edf0380e1 100644 --- a/paddlehub/module/module.py +++ b/paddlehub/module/module.py @@ -121,12 +121,12 @@ def create_module(directory, name, author, email, module_type, summary, os.chdir(_cwd) -_module_runable_func = {} +_module_runnable_func = {} -def runable(func): +def runnable(func): mod = func.__module__ + "." + inspect.stack()[1][3] - _module_runable_func[mod] = func.__name__ + _module_runnable_func[mod] = func.__name__ def _wrapper(*args, **kwargs): return func(*args, **kwargs) @@ -169,8 +169,8 @@ class Module(object): Module._record[id(self)] = True mod = self.__class__.__module__ + "." + self.__class__.__name__ - if mod in _module_runable_func: - _run_func_name = _module_runable_func[mod] + if mod in _module_runnable_func: + _run_func_name = _module_runnable_func[mod] self._run_func = getattr(self, _run_func_name) else: self._run_func = None @@ -272,7 +272,7 @@ class Module(object): return self._code_version @property - def is_runable(self): + def is_runnable(self): return self._run_func != None def _initialize(self): @@ -556,7 +556,7 @@ class ModuleV1(Module): raise ValueError("This Module is not callable!") @property - def is_runable(self): + def is_runnable(self): return self.default_signature != None def context(self,