1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-12 23:37:14 +03:00

Wait til log set up before installing translations

This commit is contained in:
Jonathan Harris 2019-04-09 10:10:33 -07:00
parent 3822cd61be
commit 70ec257934
2 changed files with 98 additions and 98 deletions

View File

@ -41,9 +41,6 @@ if __debug__:
import signal
signal.signal(signal.SIGTERM, lambda sig, frame: pdb.Pdb().set_trace(frame))
from l10n import Translations
Translations.install(config.get('language') or None)
import companion
import commodity
from commodity import COMMODITY_CSV
@ -52,6 +49,7 @@ import stats
import prefs
import plug
from hotkey import hotkeymgr
from l10n import Translations
from monitor import monitor
from protocol import protocolhandler
from dashboard import dashboard
@ -784,6 +782,8 @@ if __name__ == "__main__":
sys.stdout = sys.stderr = open(join(tempfile.gettempdir(), '%s.log' % appname), 'wt', 0) # unbuffered
print '%s %s %s' % (applongname, appversion, strftime('%Y-%m-%dT%H:%M:%S', localtime()))
Translations.install(config.get('language') or None) # Can generate errors so wait til log set up
root = tk.Tk()
app = AppWindow(root)
root.mainloop()

View File

@ -26,7 +26,16 @@ if platform=='win32':
CalculatePopupWindowPosition = ctypes.windll.user32.CalculatePopupWindowPosition
CalculatePopupWindowPosition.argtypes = [ctypes.POINTER(POINT), ctypes.POINTER(SIZE), UINT, ctypes.POINTER(RECT), ctypes.POINTER(RECT)]
RANKS = [ # in output order
def status(data):
# StatsResults assumes these three things are first
res = [ [_('Cmdr'), data['commander']['name']],
[_('Balance'), str(data['commander'].get('credits', 0))], # Cmdr stats
[_('Loan'), str(data['commander'].get('debt', 0))], # Cmdr stats
]
RANKS = [ # in output order
(_('Combat') , 'combat'), # Ranking
(_('Trade') , 'trade'), # Ranking
(_('Explorer') , 'explore'), # Ranking
@ -36,9 +45,9 @@ RANKS = [ # in output order
(_('Powerplay') , 'power'), # Ranking
# ??? , 'crime'), # Ranking
# ??? , 'service'), # Ranking
]
]
RANK_NAMES = {
RANK_NAMES = {
# http://elite-dangerous.wikia.com/wiki/Pilots_Federation#Ranks
'combat' : [_('Harmless'), # Combat rank
@ -119,16 +128,7 @@ RANK_NAMES = {
_('Rating 3'), # Power rank
_('Rating 4'), # Power rank
_('Rating 5')], # Power rank
}
def status(data):
# StatsResults assumes these three things are first
res = [ [_('Cmdr'), data['commander']['name']],
[_('Balance'), str(data['commander'].get('credits', 0))], # Cmdr stats
[_('Loan'), str(data['commander'].get('debt', 0))], # Cmdr stats
]
}
ranks = data['commander'].get('rank', {})
for title, thing in RANKS: