Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
Fix bug: sum value of same prop in pull_mitama
Browse files Browse the repository at this point in the history
  • Loading branch information
jiajunsu committed Jul 9, 2018
1 parent 5dde64c commit 815ad73
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions calculator_of_Onmyoji/pull_mitama.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,19 @@ def generate_mitama_list(acc_id, filename,
continue
mitama_pos = str(mitama_info['pos'])
mitama_name = mitama_info['name']
mitama_attrs = {i[0]: i[1] for i in mitama_info['attrs']}
mitama_attrs = dict()
for prop, value in mitama_info['attrs']:
value = int(value.replace('%', ''))
if prop not in mitama_attrs:
mitama_attrs[prop] = value
else:
mitama_attrs[prop] += value

mitama_sheet.write(mitama_num, 0, label=mitama_id)
mitama_sheet.write(mitama_num, 1, label=mitama_name)
mitama_sheet.write(mitama_num, 2, label=mitama_pos)
for i, prop in enumerate(data_format.MITAMA_PROPS):
prop_value = mitama_attrs.get(prop, '').replace('%', '')
prop_value = mitama_attrs.get(prop, '')
mitama_sheet.write(mitama_num, 3+i, label=prop_value)

mitama_num += 1
Expand Down

0 comments on commit 815ad73

Please sign in to comment.