From 66901041d943c68b6c4a757f451a60d08ca6d5ee Mon Sep 17 00:00:00 2001 From: Juan Pablo Caram Date: Sat, 11 Jun 2016 19:50:19 -0400 Subject: [PATCH] Fixed errors that I introduced in last commit. --- tclCommands/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tclCommands/__init__.py b/tclCommands/__init__.py index f02b02d9..47e65b42 100644 --- a/tclCommands/__init__.py +++ b/tclCommands/__init__.py @@ -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)