minor fixes and cleanups

This commit is contained in:
The MMGen Project 2021-10-13 20:44:44 +00:00
commit f9b6c78f4a
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
3 changed files with 11 additions and 9 deletions

View file

@ -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

View file

@ -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"

View file

@ -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