mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 17:42:20 +03:00
dashboard: Remove print_exc use (logger.exception instead)
# Conflicts: # dashboard.py
This commit is contained in:
parent
fd19ac337a
commit
137c66048a
14
dashboard.py
14
dashboard.py
@ -5,9 +5,6 @@ from os.path import isdir, isfile, join, getsize
|
||||
from sys import platform
|
||||
import time
|
||||
|
||||
if __debug__:
|
||||
from traceback import print_exc
|
||||
|
||||
from config import appcmdname, appname, config
|
||||
|
||||
if getenv("EDMC_NO_UI"):
|
||||
@ -144,17 +141,20 @@ class Dashboard(FileSystemEventHandler):
|
||||
try:
|
||||
with open(join(self.currentdir, 'Status.json'), 'rb') as h:
|
||||
data = h.read().strip()
|
||||
|
||||
if data: # Can be empty if polling while the file is being re-written
|
||||
entry = json.loads(data)
|
||||
|
||||
# Status file is shared between beta and live. So filter out status not in this game session.
|
||||
if (timegm(time.strptime(entry['timestamp'], '%Y-%m-%dT%H:%M:%SZ')) >= self.session_start and
|
||||
self.status != entry):
|
||||
if (
|
||||
timegm(time.strptime(entry['timestamp'], '%Y-%m-%dT%H:%M:%SZ')) >= self.session_start
|
||||
and self.status != entry
|
||||
):
|
||||
self.status = entry
|
||||
self.root.event_generate('<<DashboardEvent>>', when="tail")
|
||||
|
||||
except Exception:
|
||||
logger.exception('Reading Status.json')
|
||||
except Exception as e:
|
||||
logger.exception('Processing Status.json')
|
||||
|
||||
# singleton
|
||||
dashboard = Dashboard()
|
||||
|
Loading…
x
Reference in New Issue
Block a user