1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 15:57: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 import signal
signal.signal(signal.SIGTERM, lambda sig, frame: pdb.Pdb().set_trace(frame)) 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 companion
import commodity import commodity
from commodity import COMMODITY_CSV from commodity import COMMODITY_CSV
@ -52,6 +49,7 @@ import stats
import prefs import prefs
import plug import plug
from hotkey import hotkeymgr from hotkey import hotkeymgr
from l10n import Translations
from monitor import monitor from monitor import monitor
from protocol import protocolhandler from protocol import protocolhandler
from dashboard import dashboard 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 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())) 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() root = tk.Tk()
app = AppWindow(root) app = AppWindow(root)
root.mainloop() root.mainloop()

View File

@ -26,6 +26,15 @@ if platform=='win32':
CalculatePopupWindowPosition = ctypes.windll.user32.CalculatePopupWindowPosition CalculatePopupWindowPosition = ctypes.windll.user32.CalculatePopupWindowPosition
CalculatePopupWindowPosition.argtypes = [ctypes.POINTER(POINT), ctypes.POINTER(SIZE), UINT, ctypes.POINTER(RECT), ctypes.POINTER(RECT)] CalculatePopupWindowPosition.argtypes = [ctypes.POINTER(POINT), ctypes.POINTER(SIZE), UINT, ctypes.POINTER(RECT), ctypes.POINTER(RECT)]
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 RANKS = [ # in output order
(_('Combat') , 'combat'), # Ranking (_('Combat') , 'combat'), # Ranking
(_('Trade') , 'trade'), # Ranking (_('Trade') , 'trade'), # Ranking
@ -121,15 +130,6 @@ RANK_NAMES = {
_('Rating 5')], # 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', {}) ranks = data['commander'].get('rank', {})
for title, thing in RANKS: for title, thing in RANKS:
rank = ranks.get(thing) rank = ranks.get(thing)