profile argument scanning: it is better like that

This commit is contained in:
Nikos Kouremenos 2005-05-14 23:08:38 +00:00
parent 1a5927afb2
commit 9de8bdf86d
1 changed files with 2 additions and 4 deletions

View File

@ -45,9 +45,7 @@ gtk.glade.bindtextdomain(APP, i18n.DIR)
gtk.glade.textdomain(APP) gtk.glade.textdomain(APP)
from common import optparser from common import optparser
parser = optparser.OptionsParser('~/.gajim/config')
# gajim --profile devel
profile = '' profile = ''
try: try:
opts, args = getopt.getopt(sys.argv[1:], "hp:", [ "help", "profile=" ]) opts, args = getopt.getopt(sys.argv[1:], "hp:", [ "help", "profile=" ])
@ -59,14 +57,14 @@ for o, a in opts:
if o in ("-h", "--help"): if o in ("-h", "--help"):
print "gajim [--help] [--profile name]" print "gajim [--help] [--profile name]"
sys.exit(0) sys.exit(0)
elif o in ("-p", "--profile"): elif o in ("-p", "--profile"): # gajim --profile name
profile = a profile = a
config_name = "~/.gajim/config" config_name = "~/.gajim/config"
if profile: if profile:
config_name += ".%s" % profile config_name += ".%s" % profile
parser = common.optparser.OptionsParser(config_name) parser = optparser.OptionsParser(config_name)
try: try:
import winsound # windows-only built-in module for playing wav import winsound # windows-only built-in module for playing wav