1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-14 08:17:13 +03:00

Made dict copy clearer

While `dict(somedict)` does the same thing as `somedict.copy()`, the
.copy is clearer as to intent
This commit is contained in:
A_D 2020-07-07 18:46:23 +02:00
parent 4aa8e2ca0e
commit 0b6ef97f41
No known key found for this signature in database
GPG Key ID: 4BE9EB7DF45076C4

View File

@ -480,7 +480,6 @@ class Session(object):
def dump(self, r):
print('cAPI\t' + r.url, r.status_code, r.reason and r.reason or 'None', r.text)
# Returns a shallow copy of the received data suitable for export to older tools
# English commodity names and anomalies fixed up
def fixup(data):
@ -560,8 +559,8 @@ def fixup(data):
commodities.append(new)
# return a shallow copy
datacopy = dict(data)
datacopy['lastStarport'] = dict(data['lastStarport'])
datacopy = data.copy()
datacopy['lastStarport'] = data['lastStarport'].copy()
datacopy['lastStarport']['commodities'] = commodities
return datacopy