verbose is False by default

we can launch gajim with -v to enable verbose
This commit is contained in:
Yann Leboulanger 2005-05-28 18:20:27 +00:00
parent 873ac33a5e
commit 8a974c8af6
4 changed files with 17 additions and 13 deletions

View file

@ -35,7 +35,7 @@ class Config:
__options = { __options = {
# name: [ type, value ] # name: [ type, value ]
'verbose': [ opt_bool, True ], 'verbose': [ opt_bool, False ],
'delauth': [ opt_bool, True ], 'delauth': [ opt_bool, True ],
'delroster': [ opt_bool, True ], 'delroster': [ opt_bool, True ],
'alwaysauth': [ opt_bool, False ], 'alwaysauth': [ opt_bool, False ],

View file

@ -534,7 +534,7 @@ class Connection:
'proxypass') 'proxypass')
else: else:
proxy = None proxy = None
if gajim.config.get('verbose'): if gajim.verbose:
con = common.xmpp.Client(hostname) con = common.xmpp.Client(hostname)
else: else:
con = common.xmpp.Client(hostname, debug = []) con = common.xmpp.Client(hostname, debug = [])

View file

@ -24,6 +24,7 @@ import common.logger
version = '0.7.1' version = '0.7.1'
config = common.config.Config() config = common.config.Config()
connections = {} connections = {}
verbose = config.get('verbose')
h = logging.StreamHandler() h = logging.StreamHandler()
f = logging.Formatter('%(asctime)s %(name)s: %(message)s', '%d %b %Y %H:%M:%S') f = logging.Formatter('%(asctime)s %(name)s: %(message)s', '%d %b %Y %H:%M:%S')

View file

@ -49,17 +49,20 @@ from common import optparser
profile = '' profile = ''
try: try:
opts, args = getopt.getopt(sys.argv[1:], 'hp:', [ 'help', 'profile=' ]) opts, args = getopt.getopt(sys.argv[1:], 'hvp:', [ 'help', 'verbose',
'profile='])
except getopt.error, msg: except getopt.error, msg:
print msg print msg
print 'for help use --help' print 'for help use --help'
sys.exit(2) sys.exit(2)
for o, a in opts: 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'): # gajim --profile name elif o in ('-v', '--verbose'):
profile = a gajim.verbose = True
elif o in ('-p', '--profile'): # gajim --profile name
profile = a
config_filename = os.path.expanduser('~/.gajim/config') config_filename = os.path.expanduser('~/.gajim/config')
@ -72,7 +75,7 @@ if os.name == 'nt':
config_filename = 'config' config_filename = 'config'
if profile: if profile:
config_filename += '.%s' % profile config_filename += '.%s' % profile
parser = optparser.OptionsParser(config_filename) parser = optparser.OptionsParser(config_filename)
@ -706,7 +709,7 @@ class Interface:
} }
parser.read() parser.read()
if gajim.config.get('verbose'): if gajim.verbose:
gajim.log.setLevel(gajim.logging.DEBUG) gajim.log.setLevel(gajim.logging.DEBUG)
else: else:
gajim.log.setLevel(None) gajim.log.setLevel(None)