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:
parent
3822cd61be
commit
70ec257934
@ -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()
|
||||||
|
190
stats.py
190
stats.py
@ -26,101 +26,6 @@ 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)]
|
||||||
|
|
||||||
RANKS = [ # in output order
|
|
||||||
(_('Combat') , 'combat'), # Ranking
|
|
||||||
(_('Trade') , 'trade'), # Ranking
|
|
||||||
(_('Explorer') , 'explore'), # Ranking
|
|
||||||
(_('CQC') , 'cqc'), # Ranking
|
|
||||||
(_('Federation') , 'federation'), # Ranking
|
|
||||||
(_('Empire') , 'empire'), # Ranking
|
|
||||||
(_('Powerplay') , 'power'), # Ranking
|
|
||||||
# ??? , 'crime'), # Ranking
|
|
||||||
# ??? , 'service'), # Ranking
|
|
||||||
]
|
|
||||||
|
|
||||||
RANK_NAMES = {
|
|
||||||
|
|
||||||
# http://elite-dangerous.wikia.com/wiki/Pilots_Federation#Ranks
|
|
||||||
'combat' : [_('Harmless'), # Combat rank
|
|
||||||
_('Mostly Harmless'), # Combat rank
|
|
||||||
_('Novice'), # Combat rank
|
|
||||||
_('Competent'), # Combat rank
|
|
||||||
_('Expert'), # Combat rank
|
|
||||||
_('Master'), # Combat rank
|
|
||||||
_('Dangerous'), # Combat rank
|
|
||||||
_('Deadly'), # Combat rank
|
|
||||||
_('Elite')], # Top rank
|
|
||||||
'trade' : [_('Penniless'), # Trade rank
|
|
||||||
_('Mostly Penniless'), # Trade rank
|
|
||||||
_('Peddler'), # Trade rank
|
|
||||||
_('Dealer'), # Trade rank
|
|
||||||
_('Merchant'), # Trade rank
|
|
||||||
_('Broker'), # Trade rank
|
|
||||||
_('Entrepreneur'), # Trade rank
|
|
||||||
_('Tycoon'), # Trade rank
|
|
||||||
_('Elite')], # Top rank
|
|
||||||
'explore' : [_('Aimless'), # Explorer rank
|
|
||||||
_('Mostly Aimless'), # Explorer rank
|
|
||||||
_('Scout'), # Explorer rank
|
|
||||||
_('Surveyor'), # Explorer rank
|
|
||||||
_('Trailblazer'), # Explorer rank
|
|
||||||
_('Pathfinder'), # Explorer rank
|
|
||||||
_('Ranger'), # Explorer rank
|
|
||||||
_('Pioneer'), # Explorer rank
|
|
||||||
_('Elite')], # Top rank
|
|
||||||
'cqc' : [_('Helpless'), # CQC rank
|
|
||||||
_('Mostly Helpless'), # CQC rank
|
|
||||||
_('Amateur'), # CQC rank
|
|
||||||
_('Semi Professional'), # CQC rank
|
|
||||||
_('Professional'), # CQC rank
|
|
||||||
_('Champion'), # CQC rank
|
|
||||||
_('Hero'), # CQC rank
|
|
||||||
_('Gladiator'), # CQC rank
|
|
||||||
_('Elite')], # Top rank
|
|
||||||
|
|
||||||
# http://elite-dangerous.wikia.com/wiki/Federation#Ranks
|
|
||||||
'federation' : [_('None'), # No rank
|
|
||||||
_('Recruit'), # Federation rank
|
|
||||||
_('Cadet'), # Federation rank
|
|
||||||
_('Midshipman'), # Federation rank
|
|
||||||
_('Petty Officer'), # Federation rank
|
|
||||||
_('Chief Petty Officer'), # Federation rank
|
|
||||||
_('Warrant Officer'), # Federation rank
|
|
||||||
_('Ensign'), # Federation rank
|
|
||||||
_('Lieutenant'), # Federation rank
|
|
||||||
_('Lieutenant Commander'), # Federation rank
|
|
||||||
_('Post Commander'), # Federation rank
|
|
||||||
_('Post Captain'), # Federation rank
|
|
||||||
_('Rear Admiral'), # Federation rank
|
|
||||||
_('Vice Admiral'), # Federation rank
|
|
||||||
_('Admiral')], # Federation rank
|
|
||||||
|
|
||||||
# http://elite-dangerous.wikia.com/wiki/Empire#Ranks
|
|
||||||
'empire' : [_('None'), # No rank
|
|
||||||
_('Outsider'), # Empire rank
|
|
||||||
_('Serf'), # Empire rank
|
|
||||||
_('Master'), # Empire rank
|
|
||||||
_('Squire'), # Empire rank
|
|
||||||
_('Knight'), # Empire rank
|
|
||||||
_('Lord'), # Empire rank
|
|
||||||
_('Baron'), # Empire rank
|
|
||||||
_('Viscount'), # Empire rank
|
|
||||||
_('Count'), # Empire rank
|
|
||||||
_('Earl'), # Empire rank
|
|
||||||
_('Marquis'), # Empire rank
|
|
||||||
_('Duke'), # Empire rank
|
|
||||||
_('Prince'), # Empire rank
|
|
||||||
_('King')], # Empire rank
|
|
||||||
|
|
||||||
# http://elite-dangerous.wikia.com/wiki/Ratings
|
|
||||||
'power' : [_('None'), # No rank
|
|
||||||
_('Rating 1'), # Power rank
|
|
||||||
_('Rating 2'), # Power rank
|
|
||||||
_('Rating 3'), # Power rank
|
|
||||||
_('Rating 4'), # Power rank
|
|
||||||
_('Rating 5')], # Power rank
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def status(data):
|
def status(data):
|
||||||
|
|
||||||
@ -130,6 +35,101 @@ def status(data):
|
|||||||
[_('Loan'), str(data['commander'].get('debt', 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
|
||||||
|
(_('CQC') , 'cqc'), # Ranking
|
||||||
|
(_('Federation') , 'federation'), # Ranking
|
||||||
|
(_('Empire') , 'empire'), # Ranking
|
||||||
|
(_('Powerplay') , 'power'), # Ranking
|
||||||
|
# ??? , 'crime'), # Ranking
|
||||||
|
# ??? , 'service'), # Ranking
|
||||||
|
]
|
||||||
|
|
||||||
|
RANK_NAMES = {
|
||||||
|
|
||||||
|
# http://elite-dangerous.wikia.com/wiki/Pilots_Federation#Ranks
|
||||||
|
'combat' : [_('Harmless'), # Combat rank
|
||||||
|
_('Mostly Harmless'), # Combat rank
|
||||||
|
_('Novice'), # Combat rank
|
||||||
|
_('Competent'), # Combat rank
|
||||||
|
_('Expert'), # Combat rank
|
||||||
|
_('Master'), # Combat rank
|
||||||
|
_('Dangerous'), # Combat rank
|
||||||
|
_('Deadly'), # Combat rank
|
||||||
|
_('Elite')], # Top rank
|
||||||
|
'trade' : [_('Penniless'), # Trade rank
|
||||||
|
_('Mostly Penniless'), # Trade rank
|
||||||
|
_('Peddler'), # Trade rank
|
||||||
|
_('Dealer'), # Trade rank
|
||||||
|
_('Merchant'), # Trade rank
|
||||||
|
_('Broker'), # Trade rank
|
||||||
|
_('Entrepreneur'), # Trade rank
|
||||||
|
_('Tycoon'), # Trade rank
|
||||||
|
_('Elite')], # Top rank
|
||||||
|
'explore' : [_('Aimless'), # Explorer rank
|
||||||
|
_('Mostly Aimless'), # Explorer rank
|
||||||
|
_('Scout'), # Explorer rank
|
||||||
|
_('Surveyor'), # Explorer rank
|
||||||
|
_('Trailblazer'), # Explorer rank
|
||||||
|
_('Pathfinder'), # Explorer rank
|
||||||
|
_('Ranger'), # Explorer rank
|
||||||
|
_('Pioneer'), # Explorer rank
|
||||||
|
_('Elite')], # Top rank
|
||||||
|
'cqc' : [_('Helpless'), # CQC rank
|
||||||
|
_('Mostly Helpless'), # CQC rank
|
||||||
|
_('Amateur'), # CQC rank
|
||||||
|
_('Semi Professional'), # CQC rank
|
||||||
|
_('Professional'), # CQC rank
|
||||||
|
_('Champion'), # CQC rank
|
||||||
|
_('Hero'), # CQC rank
|
||||||
|
_('Gladiator'), # CQC rank
|
||||||
|
_('Elite')], # Top rank
|
||||||
|
|
||||||
|
# http://elite-dangerous.wikia.com/wiki/Federation#Ranks
|
||||||
|
'federation' : [_('None'), # No rank
|
||||||
|
_('Recruit'), # Federation rank
|
||||||
|
_('Cadet'), # Federation rank
|
||||||
|
_('Midshipman'), # Federation rank
|
||||||
|
_('Petty Officer'), # Federation rank
|
||||||
|
_('Chief Petty Officer'), # Federation rank
|
||||||
|
_('Warrant Officer'), # Federation rank
|
||||||
|
_('Ensign'), # Federation rank
|
||||||
|
_('Lieutenant'), # Federation rank
|
||||||
|
_('Lieutenant Commander'), # Federation rank
|
||||||
|
_('Post Commander'), # Federation rank
|
||||||
|
_('Post Captain'), # Federation rank
|
||||||
|
_('Rear Admiral'), # Federation rank
|
||||||
|
_('Vice Admiral'), # Federation rank
|
||||||
|
_('Admiral')], # Federation rank
|
||||||
|
|
||||||
|
# http://elite-dangerous.wikia.com/wiki/Empire#Ranks
|
||||||
|
'empire' : [_('None'), # No rank
|
||||||
|
_('Outsider'), # Empire rank
|
||||||
|
_('Serf'), # Empire rank
|
||||||
|
_('Master'), # Empire rank
|
||||||
|
_('Squire'), # Empire rank
|
||||||
|
_('Knight'), # Empire rank
|
||||||
|
_('Lord'), # Empire rank
|
||||||
|
_('Baron'), # Empire rank
|
||||||
|
_('Viscount'), # Empire rank
|
||||||
|
_('Count'), # Empire rank
|
||||||
|
_('Earl'), # Empire rank
|
||||||
|
_('Marquis'), # Empire rank
|
||||||
|
_('Duke'), # Empire rank
|
||||||
|
_('Prince'), # Empire rank
|
||||||
|
_('King')], # Empire rank
|
||||||
|
|
||||||
|
# http://elite-dangerous.wikia.com/wiki/Ratings
|
||||||
|
'power' : [_('None'), # No rank
|
||||||
|
_('Rating 1'), # Power rank
|
||||||
|
_('Rating 2'), # Power rank
|
||||||
|
_('Rating 3'), # Power rank
|
||||||
|
_('Rating 4'), # Power rank
|
||||||
|
_('Rating 5')], # Power rank
|
||||||
|
}
|
||||||
|
|
||||||
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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user