mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 17:42:20 +03:00
Added whitespace on scope changes
This commit is contained in:
parent
a6d6599c3b
commit
40aa4f9e63
@ -131,7 +131,7 @@ class EDLogs(FileSystemEventHandler):
|
|||||||
|
|
||||||
# Latest pre-existing logfile - e.g. if E:D is already running. Assumes logs sort alphabetically.
|
# Latest pre-existing logfile - e.g. if E:D is already running. Assumes logs sort alphabetically.
|
||||||
# Do this before setting up the observer in case the journal directory has gone away
|
# Do this before setting up the observer in case the journal directory has gone away
|
||||||
try:
|
try: # TODO: This should be replaced with something specific ONLY wrapping listdir
|
||||||
logfiles = sorted(
|
logfiles = sorted(
|
||||||
(x for x in listdir(self.currentdir) if self._RE_LOGFILE.search(x)),
|
(x for x in listdir(self.currentdir) if self._RE_LOGFILE.search(x)),
|
||||||
key=lambda x: x.split('.')[1:]
|
key=lambda x: x.split('.')[1:]
|
||||||
@ -566,6 +566,7 @@ class EDLogs(FileSystemEventHandler):
|
|||||||
else: # Promotion
|
else: # Promotion
|
||||||
if 'Rank' in entry:
|
if 'Rank' in entry:
|
||||||
self.state['Engineers'][entry['Engineer']] = (entry['Rank'], entry.get('RankProgress', 0))
|
self.state['Engineers'][entry['Engineer']] = (entry['Rank'], entry.get('RankProgress', 0))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.state['Engineers'][entry['Engineer']] = entry['Progress']
|
self.state['Engineers'][entry['Engineer']] = entry['Progress']
|
||||||
|
|
||||||
@ -626,6 +627,7 @@ class EDLogs(FileSystemEventHandler):
|
|||||||
self.state[category][entry['Paid']['Material']] -= entry['Paid']['Quantity']
|
self.state[category][entry['Paid']['Material']] -= entry['Paid']['Quantity']
|
||||||
if self.state[category][entry['Paid']['Material']] <= 0:
|
if self.state[category][entry['Paid']['Material']] <= 0:
|
||||||
self.state[category].pop(entry['Paid']['Material'])
|
self.state[category].pop(entry['Paid']['Material'])
|
||||||
|
|
||||||
category = self.category(entry['Received']['Category'])
|
category = self.category(entry['Received']['Category'])
|
||||||
self.state[category][entry['Received']['Material']] += entry['Received']['Quantity']
|
self.state[category][entry['Received']['Material']] += entry['Received']['Quantity']
|
||||||
|
|
||||||
@ -739,6 +741,7 @@ class EDLogs(FileSystemEventHandler):
|
|||||||
elif entry['event'] == 'Friends':
|
elif entry['event'] == 'Friends':
|
||||||
if entry['Status'] in ['Online', 'Added']:
|
if entry['Status'] in ['Online', 'Added']:
|
||||||
self.state['Friends'].add(entry['Name'])
|
self.state['Friends'].add(entry['Name'])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.state['Friends'].discard(entry['Name'])
|
self.state['Friends'].discard(entry['Name'])
|
||||||
|
|
||||||
@ -899,6 +902,7 @@ class EDLogs(FileSystemEventHandler):
|
|||||||
filename = join(
|
filename = join(
|
||||||
config.get('outdir'), '{}.{}.txt'.format(ship, strftime('%Y-%m-%dT%H.%M.%S', localtime(time())))
|
config.get('outdir'), '{}.{}.txt'.format(ship, strftime('%Y-%m-%dT%H.%M.%S', localtime(time())))
|
||||||
)
|
)
|
||||||
|
|
||||||
with open(filename, 'wt') as h:
|
with open(filename, 'wt') as h:
|
||||||
h.write(string)
|
h.write(string)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user