Skip to content

Commit

Permalink
Tools: tu-deck-grabber: added eds/hds (enemy/host deck size) output, …
Browse files Browse the repository at this point in the history
…timestamp output reordered
  • Loading branch information
dsuchka committed Dec 21, 2016
1 parent dd061a8 commit 8bb46ff
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/tu-deck-grabber.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ def doGrabLastDeck(http):
enemy_id = int(res['enemy_id'] or -1)
enemy_name = res['enemy_name'] if ('enemy_name' in res) else '__UNNAMED__'
enemy_size = int(res['eds'] or 1000)
host_size = int(res['hds'] or 1000)
enemy_udb_entry = user_db.id2entry[enemy_id] if (enemy_id in user_db.id2entry) else None
end_time = int(res['end_time']) if ('end_time' in res) else int(time.time())
winner = int(res['winner']) if ('winner' in res) else None
Expand Down Expand Up @@ -390,6 +391,8 @@ def doGrabLastDeck(http):
out = ""
if config.getboolean('CORE', 'output_game_type'):
out += game_type + '.'
if config.getboolean('CORE', 'output_timestamp'):
out += time.strftime('%Y%m%d', time.localtime(end_time)) + '.'
if config.getboolean('CORE', 'output_winlose'):
if winner is not None:
out += 'Win.' if winner else 'Lose.'
Expand All @@ -398,8 +401,10 @@ def doGrabLastDeck(http):
if config.getboolean('CORE', 'output_pvp_points'):
if pvp_points is not None:
out += 'pvp{:02d}.'.format(pvp_points)
if config.getboolean('CORE', 'output_timestamp'):
out += time.strftime('%Y%m%d', time.localtime(end_time)) + '.'
if config.getboolean('CORE', 'output_hds'):
out += "hds{:02d}.".format(host_size)
if config.getboolean('CORE', 'output_eds'):
out += "eds{:02d}.".format(enemy_size)
if config.getboolean('CORE', 'output_guild'):
out += re.sub('[^\w]', '_', enemy_guild_name) + '.'
out += re.sub('[^\w]', '_', enemy_name)
Expand Down

0 comments on commit 8bb46ff

Please sign in to comment.