verbose is False by default
we can launch gajim with -v to enable verbose
This commit is contained in:
parent
873ac33a5e
commit
8a974c8af6
|
@ -35,7 +35,7 @@ class Config:
|
|||
|
||||
__options = {
|
||||
# name: [ type, value ]
|
||||
'verbose': [ opt_bool, True ],
|
||||
'verbose': [ opt_bool, False ],
|
||||
'delauth': [ opt_bool, True ],
|
||||
'delroster': [ opt_bool, True ],
|
||||
'alwaysauth': [ opt_bool, False ],
|
||||
|
|
|
@ -534,7 +534,7 @@ class Connection:
|
|||
'proxypass')
|
||||
else:
|
||||
proxy = None
|
||||
if gajim.config.get('verbose'):
|
||||
if gajim.verbose:
|
||||
con = common.xmpp.Client(hostname)
|
||||
else:
|
||||
con = common.xmpp.Client(hostname, debug = [])
|
||||
|
|
|
@ -24,6 +24,7 @@ import common.logger
|
|||
version = '0.7.1'
|
||||
config = common.config.Config()
|
||||
connections = {}
|
||||
verbose = config.get('verbose')
|
||||
|
||||
h = logging.StreamHandler()
|
||||
f = logging.Formatter('%(asctime)s %(name)s: %(message)s', '%d %b %Y %H:%M:%S')
|
||||
|
|
25
src/gajim.py
25
src/gajim.py
|
@ -49,17 +49,20 @@ from common import optparser
|
|||
|
||||
profile = ''
|
||||
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:
|
||||
print msg
|
||||
print 'for help use --help'
|
||||
sys.exit(2)
|
||||
print msg
|
||||
print 'for help use --help'
|
||||
sys.exit(2)
|
||||
for o, a in opts:
|
||||
if o in ('-h', '--help'):
|
||||
print 'gajim [--help] [--profile name]'
|
||||
sys.exit(0)
|
||||
elif o in ('-p', '--profile'): # gajim --profile name
|
||||
profile = a
|
||||
if o in ('-h', '--help'):
|
||||
print 'gajim [--help] [--profile name]'
|
||||
sys.exit(0)
|
||||
elif o in ('-v', '--verbose'):
|
||||
gajim.verbose = True
|
||||
elif o in ('-p', '--profile'): # gajim --profile name
|
||||
profile = a
|
||||
|
||||
|
||||
config_filename = os.path.expanduser('~/.gajim/config')
|
||||
|
@ -72,7 +75,7 @@ if os.name == 'nt':
|
|||
config_filename = 'config'
|
||||
|
||||
if profile:
|
||||
config_filename += '.%s' % profile
|
||||
config_filename += '.%s' % profile
|
||||
|
||||
parser = optparser.OptionsParser(config_filename)
|
||||
|
||||
|
@ -706,7 +709,7 @@ class Interface:
|
|||
}
|
||||
parser.read()
|
||||
|
||||
if gajim.config.get('verbose'):
|
||||
if gajim.verbose:
|
||||
gajim.log.setLevel(gajim.logging.DEBUG)
|
||||
else:
|
||||
gajim.log.setLevel(None)
|
||||
|
|
Loading…
Reference in New Issue