Skip to content

Commit

Permalink
fix: export team with less than 5 members
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroRin committed May 31, 2024
1 parent 1144c78 commit 1089765
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,14 +487,17 @@ def export(self):
text.pack(expand=True, fill="both")
print("export")
pos = [7, 8, 9, 12, 13]
code = "1|"
for i, record in enumerate(self.g_records):
code += f"{record['idx']}-{pos[i%5]}-{record['eid1']}-{record['eid2']}-{record['eid3']};"
if i % 5 == 4:
code = standard_b64encode((code[:-1] + "|0").encode()).decode()
print(code)
text.insert("end", code + "\n")
code = "1|"

for i in range(0, len(self.g_records), 5):
gun_codes = ["0-0-0-0-0"] * 5
for j, record in enumerate(self.g_records[i : i + 5]):
gun_codes[j] = (
f"{record['idx']}-{pos[i%5]}-{record['eid1']}-{record['eid2']}-{record['eid3']}"
)
code = "1|" + ";".join(gun_codes) + "|0"
code = standard_b64encode(code.encode()).decode()
print(code)
text.insert("end", code + "\n")
text.configure(state="disabled") # 设置为不可编辑状态


Expand Down

0 comments on commit 1089765

Please sign in to comment.