Merge branch 'pyfa-org:master' into master

This commit is contained in:
StormDelay
2025-05-20 18:33:48 +02:00
committed by GitHub
791 changed files with 382527 additions and 28685 deletions

View File

@@ -222,9 +222,9 @@ class NetworkSettings:
if prefix not in proxydict:
continue
proxyline = proxydict[prefix]
proto = "{0}://".format(prefix)
if proxyline[:len(proto)] == proto:
proxyline = proxyline[len(proto):]
proto_pos = proxyline.find('://')
if proto_pos != -1:
proxyline = proxyline[proto_pos+3:]
# sometimes proxyline contains "user:password@" section before proxy address
# remove it if present, so later split by ":" works
if '@' in proxyline:
@@ -376,6 +376,8 @@ class EsiSettings:
"timeout": 60,
"server": "Tranquility",
"exportCharges": True,
"exportImplants": True,
"exportBoosters": True,
"enforceJwtExpiration": True
}
@@ -390,6 +392,9 @@ class EsiSettings:
def set(self, type, value):
self.settings[type] = value
def keys(self):
return config.supported_servers.keys()
class StatViewSettings:
_instance = None
@@ -558,7 +563,7 @@ class LocaleSettings:
with open(os.path.join(config.pyfaPath, 'locale', 'progress.json'), "r") as f:
self.progress_data = json.load(f)
except FileNotFoundError:
self.progress_data = None
self.progress_data = {}
@classmethod
def getInstance(cls):
@@ -567,14 +572,14 @@ class LocaleSettings:
return cls._instance
def get_progress(self, lang):
if self.progress_data is None:
if not self.progress_data:
return None
if lang == self.defaults['locale']:
return None
return self.progress_data[lang]
return self.progress_data.get(lang)
@classmethod
def supported_langauges(cls):
def supported_languages(cls):
"""Requires the application to be initialized, otherwise wx.Translation isn't set."""
pyfalog.info(f'using "{config.CATALOG}" to fetch languages, relatively base path "{os.getcwd()}"')
return {x: wx.Locale.FindLanguageInfo(x) for x in wx.Translations.Get().GetAvailableTranslations(config.CATALOG)}
@@ -589,6 +594,6 @@ class LocaleSettings:
return val if val != self.defaults['eos_locale'] else self.settings['locale'].split("_")[0]
def set(self, key, value):
if key == 'locale' and value not in self.supported_langauges():
if key == 'locale' and value not in self.supported_languages():
self.settings[key] = self.DEFAULT
self.settings[key] = value