From: Sapan Bhatia Date: Wed, 12 Aug 2009 18:28:08 +0000 (+0000) Subject: (no commit message) X-Git-Tag: sfa-0.9-1~95 X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=9cf2ea3dec0af93b86a2c413de3ea47b682c939a --- diff --git a/sfatables/commands.py b/sfatables/command.py similarity index 100% rename from sfatables/commands.py rename to sfatables/command.py diff --git a/sfatables/commands/__init__.py b/sfatables/commands/__init__.py index 34cd92ea..7f95863b 100644 --- a/sfatables/commands/__init__.py +++ b/sfatables/commands/__init__.py @@ -1,5 +1,6 @@ all = """ -add -delete -list +Add +Delete +List +SetDefault """.split() diff --git a/sfatables/sfatables.py b/sfatables/sfatables.py index d9dbcb54..f5393f63 100755 --- a/sfatables/sfatables.py +++ b/sfatables/sfatables.py @@ -12,7 +12,9 @@ import os import pdb from optparse import OptionParser -def load_extensions(module): +from sfatables import commands, matches, targets + +def load_extensions(module, list): command_dict={} module_path = ".".join(module.split('.')[:-1]) pdb.set_trace() @@ -38,7 +40,7 @@ def create_parser(command_dict): def main(): - command_dict = load_extensions("sfa.sfatables.commands") + command_dict = load_extensions("sfatables.commands") command_parser = create_parser(command_dict) (options, args) = command_parser.parse_args() @@ -52,12 +54,12 @@ def main(): target_options = None if (selected_command.matches): - match_dict = load_extensions("sfa.sfatables.matches") + match_dict = load_extensions("sfatables.matches") match_parser = create_parser(match_dict) (options, args) = match_parser.parse_args(args[2:]) if (selected_command.targets): - match_dict = load_extensions("sfa.sfatables.targets") + match_dict = load_extensions("sfatables.targets") target_parser = create_parser(match_dict) (options, args) = target_parser.parse_args(args[5:])