Fixed errors that I introduced in last commit.

This commit is contained in:
Juan Pablo Caram 2016-06-11 19:50:19 -04:00
parent ee8e9f8f4b
commit 66901041d9
1 changed files with 4 additions and 4 deletions

View File

@ -26,11 +26,11 @@ def register_all_commands(app, commands):
"""
Static method which register all known commands.
Command should be for now in directory test_tclCommands and module should start with TCLCommand
Command should be for now in directory tclCommands and module should start with TCLCommand
Class have to follow same name as module.
we need import all modules in top section:
import test_tclCommands.TclCommandExteriors
import tclCommands.TclCommandExteriors
at this stage we can include only wanted commands with this, auto loading may be implemented in future
I have no enough knowledge about python's anatomy. Would be nice to include all classes which are descendant etc.
@ -39,10 +39,10 @@ def register_all_commands(app, commands):
:return: None
"""
tcl_modules = {k: v for k, v in sys.modules.items() if k.startswith('test_tclCommands.TclCommand')}
tcl_modules = {k: v for k, v in sys.modules.items() if k.startswith('tclCommands.TclCommand')}
for key, mod in tcl_modules.items():
if key != 'test_tclCommands.TclCommand':
if key != 'tclCommands.TclCommand':
class_name = key.split('.')[1]
class_type = getattr(mod, class_name)
command_instance = class_type(app)