mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-26 07:49:48 -05:00
Fix loading custom config if provided
This commit is contained in:
parent
a7bbe818bf
commit
d2281112b6
@ -160,6 +160,9 @@ class Onion(object):
|
|||||||
# Either use settings that are passed in, or use them from common
|
# Either use settings that are passed in, or use them from common
|
||||||
if custom_settings:
|
if custom_settings:
|
||||||
self.settings = custom_settings
|
self.settings = custom_settings
|
||||||
|
elif config:
|
||||||
|
self.common.load_settings(config)
|
||||||
|
self.settings = self.common.settings
|
||||||
else:
|
else:
|
||||||
self.common.load_settings()
|
self.common.load_settings()
|
||||||
self.settings = self.common.settings
|
self.settings = self.common.settings
|
||||||
|
@ -44,15 +44,17 @@ class Settings(object):
|
|||||||
|
|
||||||
self.common.log('Settings', '__init__')
|
self.common.log('Settings', '__init__')
|
||||||
|
|
||||||
# Default config
|
|
||||||
self.filename = self.build_filename()
|
|
||||||
|
|
||||||
# If a readable config file was provided, use that instead
|
# If a readable config file was provided, use that instead
|
||||||
if config:
|
if config:
|
||||||
if os.path.isfile(config):
|
if os.path.isfile(config):
|
||||||
self.filename = config
|
self.filename = config
|
||||||
else:
|
else:
|
||||||
self.common.log('Settings', '__init__', 'Supplied config does not exist or is unreadable. Falling back to default location')
|
self.common.log('Settings', '__init__', 'Supplied config does not exist or is unreadable. Falling back to default location')
|
||||||
|
self.filename = self.build_filename()
|
||||||
|
|
||||||
|
else:
|
||||||
|
# Default config
|
||||||
|
self.filename = self.build_filename()
|
||||||
|
|
||||||
# Dictionary of available languages in this version of OnionShare,
|
# Dictionary of available languages in this version of OnionShare,
|
||||||
# mapped to the language name, in that language
|
# mapped to the language name, in that language
|
||||||
|
Loading…
Reference in New Issue
Block a user