diff options
author | Miguel Jacq <mig@mig5.net> | 2019-04-20 14:43:04 +1000 |
---|---|---|
committer | Miguel Jacq <mig@mig5.net> | 2019-04-20 14:43:04 +1000 |
commit | d2281112b6efbbf82d38dd862add497aead481c8 (patch) | |
tree | b6445e177478dc79b67b78d85aaa2b129726f9a4 | |
parent | a7bbe818bff45a3248180aefa0b0a2a39e158f14 (diff) | |
download | onionshare-d2281112b6efbbf82d38dd862add497aead481c8.tar.gz onionshare-d2281112b6efbbf82d38dd862add497aead481c8.zip |
Fix loading custom config if provided
-rw-r--r-- | onionshare/onion.py | 3 | ||||
-rw-r--r-- | onionshare/settings.py | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/onionshare/onion.py b/onionshare/onion.py index bc2c4e1d..e2485b10 100644 --- a/onionshare/onion.py +++ b/onionshare/onion.py @@ -160,6 +160,9 @@ class Onion(object): # Either use settings that are passed in, or use them from common if custom_settings: self.settings = custom_settings + elif config: + self.common.load_settings(config) + self.settings = self.common.settings else: self.common.load_settings() self.settings = self.common.settings diff --git a/onionshare/settings.py b/onionshare/settings.py index 1eaa4e40..e4c09058 100644 --- a/onionshare/settings.py +++ b/onionshare/settings.py @@ -44,15 +44,17 @@ class Settings(object): self.common.log('Settings', '__init__') - # Default config - self.filename = self.build_filename() - # If a readable config file was provided, use that instead if config: if os.path.isfile(config): self.filename = config else: 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, # mapped to the language name, in that language |