mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-15 00:30:33 +03:00
removed unused import
This commit is contained in:
parent
a546ecb735
commit
474c8d144f
10
collate.py
10
collate.py
@ -6,7 +6,7 @@
|
|||||||
import csv
|
import csv
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
from os.path import exists, isfile
|
from os.path import isfile
|
||||||
import sys
|
import sys
|
||||||
from traceback import print_exc
|
from traceback import print_exc
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ def addcommodities(data):
|
|||||||
with open(commodityfile) as csvfile:
|
with open(commodityfile) as csvfile:
|
||||||
reader = csv.DictReader(csvfile)
|
reader = csv.DictReader(csvfile)
|
||||||
for row in reader:
|
for row in reader:
|
||||||
commodities[int(row['id'])] = row # index by int for easier lookup and sorting
|
commodities[int(row['id'])] = row # index by int for easier lookup and sorting
|
||||||
|
|
||||||
size_pre = len(commodities)
|
size_pre = len(commodities)
|
||||||
|
|
||||||
@ -65,6 +65,7 @@ def addcommodities(data):
|
|||||||
|
|
||||||
print('Added %d new commodities' % (len(commodities) - size_pre))
|
print('Added %d new commodities' % (len(commodities) - size_pre))
|
||||||
|
|
||||||
|
|
||||||
# keep a summary of modules found
|
# keep a summary of modules found
|
||||||
def addmodules(data):
|
def addmodules(data):
|
||||||
if not data['lastStarport'].get('modules'): return
|
if not data['lastStarport'].get('modules'): return
|
||||||
@ -78,7 +79,7 @@ def addmodules(data):
|
|||||||
with open(outfile) as csvfile:
|
with open(outfile) as csvfile:
|
||||||
reader = csv.DictReader(csvfile, restval='')
|
reader = csv.DictReader(csvfile, restval='')
|
||||||
for row in reader:
|
for row in reader:
|
||||||
modules[int(row['id'])] = row # index by int for easier lookup and sorting
|
modules[int(row['id'])] = row # index by int for easier lookup and sorting
|
||||||
|
|
||||||
size_pre = len(modules)
|
size_pre = len(modules)
|
||||||
|
|
||||||
@ -123,6 +124,7 @@ def addmodules(data):
|
|||||||
|
|
||||||
print('Added %d new modules' % (len(modules) - size_pre))
|
print('Added %d new modules' % (len(modules) - size_pre))
|
||||||
|
|
||||||
|
|
||||||
# keep a summary of ships found
|
# keep a summary of ships found
|
||||||
def addships(data):
|
def addships(data):
|
||||||
if not data['lastStarport'].get('ships'): return
|
if not data['lastStarport'].get('ships'): return
|
||||||
@ -136,7 +138,7 @@ def addships(data):
|
|||||||
with open(shipfile) as csvfile:
|
with open(shipfile) as csvfile:
|
||||||
reader = csv.DictReader(csvfile, restval='')
|
reader = csv.DictReader(csvfile, restval='')
|
||||||
for row in reader:
|
for row in reader:
|
||||||
ships[int(row['id'])] = row # index by int for easier lookup and sorting
|
ships[int(row['id'])] = row # index by int for easier lookup and sorting
|
||||||
|
|
||||||
size_pre = len(ships)
|
size_pre = len(ships)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user