From e6efcebfa8e1857a10df9ae46d91eb47ca325d6a Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Fri, 29 May 2009 09:18:55 +0200 Subject: [PATCH] add -c option to history_manager. Fixes #5058 --- src/history_manager.py | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/history_manager.py b/src/history_manager.py index 9b68372a7..8f8faced9 100644 --- a/src/history_manager.py +++ b/src/history_manager.py @@ -53,9 +53,34 @@ import gobject import time import locale +import getopt from common import i18n + +def parseOpts(): + config_path = None + + try: + shortargs = 'hc:' + longargs = 'help config_path=' + opts = getopt.getopt(sys.argv[1:], shortargs, longargs.split())[0] + except getopt.error, msg: + print str(msg) + print 'for help use --help' + sys.exit(2) + for o, a in opts: + if o in ('-h', '--help'): + print 'history_manager [--help] [--config-path]' + sys.exit() + elif o in ('-c', '--config-path'): + config_path = a + return config_path + +config_path = parseOpts() +del parseOpts + import common.configpaths -common.configpaths.gajimpaths.init() +common.configpaths.gajimpaths.init(config_path) +del config_path common.configpaths.gajimpaths.init_profile() from common import exceptions import dialogs