From 72c8c926b44638806fa7cc389a236e8624177a8a Mon Sep 17 00:00:00 2001 From: headshot2017 Date: Sun, 14 Mar 2021 00:00:38 -0400 Subject: [PATCH] add AO2XP_linux.spec and fix error on linux --- AO2XP_linux.spec | 27 +++++++++++++++++++++++++++ hardware.py | 10 +++++----- 2 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 AO2XP_linux.spec diff --git a/AO2XP_linux.spec b/AO2XP_linux.spec new file mode 100644 index 0000000..aa7e505 --- /dev/null +++ b/AO2XP_linux.spec @@ -0,0 +1,27 @@ +# -*- mode: python -*- + +block_cipher = None + + +a = Analysis(['AO2XP.py'], + pathex=['.'], + binaries=[("libbass.so", ".")], + datas=None, + hiddenimports=[], + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + name='AO2XP', + debug=False, + strip=False, + upx=True) diff --git a/hardware.py b/hardware.py index 872088c..b5c6f17 100644 --- a/hardware.py +++ b/hardware.py @@ -1,9 +1,9 @@ -import platform +import platform, os def get_hdid(): - os = platform.system() + osname = platform.system() - if os == "Windows": # what a mess... + if osname == "Windows": # what a mess... import _winreg registry = getattr(_winreg, "\x48\x4b\x45\x59\x5f\x4c\x4f\x43\x41\x4c\x5f\x4d\x41\x43\x48\x49\x4e\x45") address = "\x53\x4f\x46\x54\x57\x41\x52\x45\x5c\x4d\x69\x63\x72\x6f\x73\x6f\x66\x74\x5c\x43\x72\x79\x70\x74\x6f\x67\x72\x61\x70\x68\x79" @@ -13,10 +13,10 @@ def get_hdid(): _winreg.CloseKey(key) return value[0] - elif os == "Linux": + elif osname == "Linux": return os.popen("cat /var/lib/dbus/machine-id").read().rstrip() - elif os == "Darwin": # https://gist.github.com/erikng/46646ff81e55b42e5cfc + elif osname == "Darwin": # https://gist.github.com/erikng/46646ff81e55b42e5cfc import objc from Foundation import NSBundle