Skip to content

Commit

Permalink
Fixes & improvements
Browse files Browse the repository at this point in the history
- Fixes a warning regarding odg if the default guides were already backed up (files not being able to move, expected behavior)
- Bound escape to destroy the info windows
  • Loading branch information
Egezenn committed Feb 22, 2025
1 parent 277c958 commit 9dcef19
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
25 changes: 16 additions & 9 deletions gui.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -455,15 +455,20 @@ class App:
exist_ok=True,
)
for name in os.listdir(mpaths.itembuilds_dir):
if name != "bkup":
os.rename(
os.path.join(
mpaths.itembuilds_dir, name
),
os.path.join(
mpaths.itembuilds_dir, "bkup", name
),
)
try:
if name != "bkup":
os.rename(
os.path.join(
mpaths.itembuilds_dir, name
),
os.path.join(
mpaths.itembuilds_dir,
"bkup",
name,
),
)
except FileExistsError:
pass # backup was created and opendotaguides was replacing the guides already
shutil.unpack_archive(
zip_path, temp_dump_path, "zip"
)
Expand All @@ -477,6 +482,8 @@ class App:
print(
"→ Replaced default guides with OpenDotaGuides guides."
)
if os.path.exists(zip_path):
os.remove(zip_path)
else:
print(
"→ Failed to download latest OpenDotaGuides guides."
Expand Down
1 change: 1 addition & 0 deletions helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def modInfo(widget, name, mod_path, event):
height=1,
width=10,
)
infoWindow.bind("<Escape>", lambda e: infoWindow.destroy())
close_button.grid(row=1, column=0, pady=5)


Expand Down

0 comments on commit 9dcef19

Please sign in to comment.