From f9b6c78f4a84b845ffa193f78c671b6c062647b0 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Wed, 13 Oct 2021 20:44:44 +0000 Subject: [PATCH] minor fixes and cleanups --- mmgen/led.py | 11 ++++------- setup.cfg | 2 +- test/unit_tests_d/ut_dep.py | 7 ++++++- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/mmgen/led.py b/mmgen/led.py index bc7929bd..197d2503 100755 --- a/mmgen/led.py +++ b/mmgen/led.py @@ -101,21 +101,18 @@ class LEDControl: iv = init_val or open(fn).read().strip() open(fn,'w').write(f'{iv}\n') return True - except: - msg('\n'+fmt(f""" + except PermissionError: + ydie(1,'\n'+fmt(f""" You do not have access to the {desc} file To allow access, run the following command: sudo chmod 0666 {fn} """,indent=' ',strip_char='\t')) - return False - if not check_access(board.status,desc='status LED control'): - sys.exit(1) + check_access(board.status,desc='status LED control') if board.trigger: - if not check_access(board.trigger,desc='LED trigger',init_val=board.trigger_states[0]): - sys.exit(1) + check_access(board.trigger,desc='LED trigger',init_val=board.trigger_states[0]) self.board = board diff --git a/setup.cfg b/setup.cfg index b7991bf4..1714b2de 100644 --- a/setup.cfg +++ b/setup.cfg @@ -34,7 +34,7 @@ install_requires = requests pysocks # xmrwallet.py pexpect - scrypt + scrypt; platform_system != "Windows" # requires user intervention to install on MSYS2 semantic-version # scripts/create-token.py aiohttp; platform_system != "Windows" pysha3; platform_system != "Windows" diff --git a/test/unit_tests_d/ut_dep.py b/test/unit_tests_d/ut_dep.py index de05f4e2..fd5dc988 100755 --- a/test/unit_tests_d/ut_dep.py +++ b/test/unit_tests_d/ut_dep.py @@ -11,7 +11,12 @@ from mmgen.common import * class unit_tests: altcoin_deps = ('pysha3','py_ecc') - win_skip = ('aiohttp','pysha3') + win_skip = ('aiohttp','pysha3','led') + + def led(self,name,ut): + from mmgen.led import LEDControl + LEDControl(enabled=True) + return True def pysha3(self,name,ut): # ETH,XMR from sha3 import keccak_256