8
8
""" Coherence is a framework to host DLNA/UPnP devices
10
10
For more information about it and its available backends
11
point your browser to: http://coherence.beebits.net
11
point your browser to: http://coherence-project.org
18
from twisted.python import usage, text
21
18
from coherence import __version__
23
20
from coherence.extern.simple_config import Config,ConfigItem
22
from twisted.python import usage, text
26
26
thankfully taken from twisted.scripts._twistd_unix.py
283
287
print "no config file %r found" % options['configfile']
286
for k,v in options['options'].items():
290
290
if options['logfile'] != None:
291
if isinstance(config,ConfigItem):
292
config['logging'] = {}
291
if isinstance(config,(ConfigItem,dict)):
292
if 'logging' not in config:
293
config['logging'] = {}
293
294
config['logging']['logfile'] = options['logfile']
295
296
config['logfile'] = options['logfile']
298
for k,v in options['options'].items():
297
303
if options['daemon'] == 1:
298
if options['logfile'] == None:
299
if isinstance(config,ConfigItem):
300
config.get('logging').get('level','none')
304
if isinstance(config,(ConfigItem,dict)):
305
if config.get('logging',None) == None:
306
config['logging'] = {}
307
if config['logging'].get('logfile',None) == None:
308
config['logging']['level'] = 'none'
310
del config['logging']['logfile']
314
if config.get('logfile',None) == None:
302
315
config.set('logmode','none')
317
del config['logfile']
306
321
if(config.get('use_dbus', 'no') == 'yes' or
307
322
config.get('glib', 'no') == 'yes' or