All OS-specific imports are currently done in the main sciber_yclocker.py module regardless of platform.
This means that OS-specific imports have to be overloaded with an EmptyModule shim.
This can be avoided by breaking out OS-specific functionality to their own files.
For example, in sciber_yclocker.py:
if platform.system() == "Windows":
from lib_win import lock_system, log_message
elif platform.system() == "Linux":
from lib_lx import lock_system, log_message
elif platform.system() == "Darwin":
from lib_mac import lock_system, log_message
...
def lock(self):
if self.get_removal_option() != RemovalOption.NOTHING:
lock_system(self.get_removal_option())
...
def logger(self, message):
log_message(message)
All OS-specific imports are currently done in the main sciber_yclocker.py module regardless of platform. This means that OS-specific imports have to be overloaded with an EmptyModule shim.
This can be avoided by breaking out OS-specific functionality to their own files.
For example, in
sciber_yclocker.py
:New file
lib_mac.py
:This removes the need for overloading modules with EmptyModule, and makes cross-platform development implementable via separate modules.