1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-16 09:10:35 +03:00

Merge pull request #577 from EDCD/fix/575-Remove-old-anonymous

Remove all use of defunct 'anonymous' option
This commit is contained in:
Athanasius 2020-07-10 08:40:29 +01:00 committed by GitHub
commit accc361d54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 12 deletions

View File

@ -48,10 +48,7 @@ def export(data, kind=COMMODITY_DEFAULT, filename=None):
cmdr = data['commander']['name'].strip()
header_cmdr = cmdr
if config.getint('anonymous'):
header_cmdr = hashlib.md5(cmdr.encode('utf-8')).hexdigest()
elif sep in cmdr:
if sep in cmdr:
header_cmdr = f'"{cmdr}"'
rowheader = sep.join((header_cmdr, data['lastSystem']['name'], data['lastStarport']['name']))

View File

@ -91,13 +91,7 @@ class EDDN(object):
self.replayfile = None
def send(self, cmdr, msg):
if config.getint('anonymous'):
uploaderID = config.get('uploaderID')
if not uploaderID:
uploaderID = uuid.uuid4().hex
config.set('uploaderID', uploaderID)
else:
uploaderID = cmdr
uploaderID = cmdr
msg = OrderedDict([
('$schemaRef', msg['$schemaRef']),

11
td.py
View File

@ -30,7 +30,16 @@ def export(data):
# Format described here: https://bitbucket.org/kfsone/tradedangerous/wiki/Price%20Data
h = open(filename, 'wb') # codecs can't automatically handle line endings, so encode manually where required
h.write(('#! trade.py import -\n# Created by %s %s on %s%s.\n#\n# <item name> <sellCR> <buyCR> <demand> <stock> <timestamp>\n\n@ %s/%s\n' % (applongname, appversion, platform=='darwin' and "Mac OS" or system(), not config.getint('anonymous') and ' for Cmdr '+data['commander']['name'].strip() or '', data['lastSystem']['name'].strip(), data['lastStarport']['name'].strip())).encode('utf-8'))
h.write('#! trade.py import -\n# Created by {appname} {appversion} on {platform} for Cmdr {cmdr}.\n'
'#\n# <item name> <sellCR> <buyCR> <demand> <stock> <timestamp>\n\n'
'@ {system}/{starport}\n'.format(
appname=applongname,
appversion=appversion,
platform=platform == 'darwin' and "Mac OS" or system(),
cmdr=data['commander']['name'].strip(),
system=data['lastSystem']['name'].strip(),
starport=data['lastStarport']['name'].strip()
).encode('utf-8'))
# sort commodities by category
bycategory = defaultdict(list)