Skip to content

Commit

Permalink
Update mine-timer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Goofert42 authored Nov 23, 2024
1 parent 72b46d1 commit ea9c7ee
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mine-timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def calculate_checksum(data):
return hashlib.sha256(data.encode()).hexdigest()

def get_playtime_file_path():
"""Get the path to the playtime file in the AppData directory."""
appdata_dir = os.getenv('APPDATA')
playtime_dir = os.path.join(appdata_dir, 'MineTimer')
if not os.path.exists(playtime_dir):
Expand All @@ -37,7 +36,6 @@ def write_playtime(file_path, playtime):
file.write(f"{data}\n{checksum}")

def read_playtime(file_path):
"""Read the playtime from the file and verify the checksum."""
if not os.path.exists(file_path):
write_playtime(file_path, 0)
return 0
Expand Down Expand Up @@ -157,7 +155,8 @@ def hide_window():
def open_website():
webbrowser.open("https://www.goofert.org/")

def open_github():webbrowser.open("https://github.com/Goofert42/MineTimer")
def open_github():
webbrowser.open("https://github.com/Goofert42/MineTimer")

def add_to_startup():
try:
Expand Down Expand Up @@ -238,4 +237,4 @@ def create_gui(startup=False):
startup = "--startup" in sys.argv
tray_thread = threading.Thread(target=run_tray_icon, daemon=True)
tray_thread.start()
create_gui(startup)
create_gui(startup)

0 comments on commit ea9c7ee

Please sign in to comment.