Skip to content

Commit

Permalink
Merge pull request #477 from RedBearAK/dev_beta
Browse files Browse the repository at this point in the history
Update class usage, machine context module
  • Loading branch information
RedBearAK authored Dec 21, 2024
2 parents 344e832 + 377021b commit 10a8776
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 132 deletions.
8 changes: 3 additions & 5 deletions lib/machine_context.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#!/usr/bin/env python3
__version__ = '20241214'
__version__ = '20241221'

import sys
import hashlib
import xwaykeyz.lib.logger

from signal import signal, SIGINT
from xwaykeyz.lib.logger import debug, error

xwaykeyz.lib.logger.VERBOSE = True

def handle_sigint(signum, frame):
print("\nSIGINT received. Exiting gracefully.\n")
Expand All @@ -29,7 +27,7 @@ def hash_value(value: str):

def print_hashed_value(value):
"""Print out the hashed value."""
debug(f"Hashed value for this machine, for use in your config file: '{value}'")
print(f"(ID) Hashed value for this machine, for use in your config file: '{value}'")


def get_machine_id_hash():
Expand All @@ -42,7 +40,7 @@ def get_machine_id_hash():
with open(path, "r") as f:
MACHINE_ID = f.read().strip()
obfuscated_ID = f"{MACHINE_ID[:5]} ... {MACHINE_ID[-5:]}"
debug(f"Machine ID read from {path} (obfuscated): '{obfuscated_ID}'")
print(f"(ID) Machine ID read from {path} (obfuscated): '{obfuscated_ID}'")
MACHINE_ID_HASH = hash_value(MACHINE_ID)
print_hashed_value(MACHINE_ID_HASH)
return MACHINE_ID_HASH
Expand Down
1 change: 1 addition & 0 deletions scripts/toshy_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
os.path.join(toshy_dir_path, 'toshy_tray.py'),
None,
os.path.join(lib_dir_path, 'env_context.py'),
os.path.join(lib_dir_path, 'machine_context.py'),
os.path.join(lib_dir_path, 'notification_manager.py'),
os.path.join(lib_dir_path, 'settings_class.py'),
None,
Expand Down
Loading

0 comments on commit 10a8776

Please sign in to comment.