summaryrefslogtreecommitdiff
path: root/cli/onionshare_cli/settings.py
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2021-08-20 14:43:21 -0700
committerGitHub <noreply@github.com>2021-08-20 14:43:21 -0700
commitb66e742bc20ae977232fc53f22d485c10173ac2f (patch)
treec6eb66c340c34b45bac5525350c5eb5c43fe33a6 /cli/onionshare_cli/settings.py
parent76104671c3eacbef53ad96fffd8a57512ab2d093 (diff)
parent02254b13bb4818745193092f2144fd83726d79e7 (diff)
downloadonionshare-b66e742bc20ae977232fc53f22d485c10173ac2f.tar.gz
onionshare-b66e742bc20ae977232fc53f22d485c10173ac2f.zip
Merge pull request #1395 from onionshare/developv2.3.3
Version 2.3.3, merge develop into stable
Diffstat (limited to 'cli/onionshare_cli/settings.py')
-rw-r--r--cli/onionshare_cli/settings.py22
1 files changed, 9 insertions, 13 deletions
diff --git a/cli/onionshare_cli/settings.py b/cli/onionshare_cli/settings.py
index a655d46c..137b690e 100644
--- a/cli/onionshare_cli/settings.py
+++ b/cli/onionshare_cli/settings.py
@@ -20,15 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import json
import os
-import platform
import locale
-try:
- # We only need pwd module in macOS, and it's not available in Windows
- import pwd
-except:
- pass
-
class Settings(object):
"""
@@ -71,25 +64,27 @@ class Settings(object):
"da": "Dansk", # Danish
"nl": "Nederlands", # Dutch
"en": "English", # English
- "fi": "Suomi", # Finnish
+ # "fi": "Suomi", # Finnish
"fr": "Français", # French
"gl": "Galego", # Galician
"de": "Deutsch", # German
"el": "Ελληνικά", # Greek
"is": "Íslenska", # Icelandic
+ "id": "Bahasa Indonesia", # Indonesian
# "ga": "Gaeilge", # Irish
"it": "Italiano", # Italian
"ja": "日本語", # Japanese
"ckb": "Soranî", # Kurdish (Central)
+ "lt": "Lietuvių Kalba", # Lithuanian
"nb_NO": "Norsk Bokmål", # Norwegian Bokmål
# "fa": "فارسی", # Persian
"pl": "Polski", # Polish
"pt_BR": "Português (Brasil)", # Portuguese Brazil
"pt_PT": "Português (Portugal)", # Portuguese Portugal
- "sk": "Slovenčina", # Slovak
# "ro": "Română", # Romanian
"ru": "Русский", # Russian
- # "sr_Latn": "Srpska (latinica)", # Serbian (latin)
+ "sr_Latn": "Srpska (latinica)", # Serbian (latin)
+ "sk": "Slovenčina", # Slovak
"es": "Español", # Spanish
"sv": "Svenska", # Swedish
# "te": "తెలుగు", # Telugu
@@ -116,6 +111,7 @@ class Settings(object):
"tor_bridges_use_custom_bridges": "",
"persistent_tabs": [],
"locale": None, # this gets defined in fill_in_defaults()
+ "theme": 0,
}
self._settings = {}
self.fill_in_defaults()
@@ -167,13 +163,13 @@ class Settings(object):
with open(self.filename, "r") as f:
self._settings = json.load(f)
self.fill_in_defaults()
- except:
+ except Exception:
pass
# Make sure data_dir exists
try:
os.makedirs(self.get("data_dir"), exist_ok=True)
- except:
+ except Exception:
pass
def save(self):
@@ -192,7 +188,7 @@ class Settings(object):
if key == "control_port_port" or key == "socks_port":
try:
val = int(val)
- except:
+ except Exception:
if key == "control_port_port":
val = self.default_settings["control_port_port"]
elif key == "socks_port":