Beispiel #1
0
def main():
    # Load everything
    plugins = load_plugins()
    config_filename = get_config_filename()
    config = load_configuration(config_filename, plugins)
    config.read_data()

    # Init parser
    parser = get_command_line_parser(config, plugins)

    # Init all plugins
    for plugin in plugins:
        plugin.initialize(config, parser)
        
    # parse command line
    args = parser.parse_args()

    functions = ('add', 'resolve', 'edit', 'split', 'merge', 'fetch',
                 'preview', 'submit')

    if not args.command:
        print "Commands:", functions
        sys.exit(1)

    args.cmd_func(config, args)
Beispiel #2
0
def execute_edit(config, args):
    from sflf2t.config import get_config_filename
    editor = os.environ.get('EDITOR', 'vi')
    config_filename = get_config_filename()
    os.system("%s %s" % (editor, config_filename))