Skip to content
Snippets Groups Projects
Commit 010ad4c0 authored by jkerdreu's avatar jkerdreu
Browse files

Fix devtype regex and lint

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@3220 b32b6428-25c9-4566-ad07-03861ab6144f
parent ad506d85
No related branches found
No related tags found
No related merge requests found
...@@ -30,7 +30,7 @@ from configobj import ConfigObj ...@@ -30,7 +30,7 @@ from configobj import ConfigObj
from . import config from . import config
from .bindings import UUID from .bindings import UUID
XAAL_DEVTYPE_PATTERN = '^[a-zA-Z][a-zA-Z0-9_-]*\.[a-zA-Z][a-zA-Z0-9_-]*$' XAAL_DEVTYPE_PATTERN = '^[a-zA-Z][a-zA-Z0-9_-]*\\.[a-zA-Z][a-zA-Z0-9_-]*$'
def get_cfg_filename(name, cfg_dir=config.conf_dir): def get_cfg_filename(name, cfg_dir=config.conf_dir):
if name.startswith('xaal.'): if name.startswith('xaal.'):
...@@ -39,7 +39,7 @@ def get_cfg_filename(name, cfg_dir=config.conf_dir): ...@@ -39,7 +39,7 @@ def get_cfg_filename(name, cfg_dir=config.conf_dir):
if not os.path.isdir(cfg_dir): if not os.path.isdir(cfg_dir):
print("Your configuration directory doesn't exist: [%s]" % cfg_dir) print("Your configuration directory doesn't exist: [%s]" % cfg_dir)
return os.path.join(cfg_dir, filename) return os.path.join(cfg_dir, filename)
def load_cfg_file(filename): def load_cfg_file(filename):
""" load .ini file and return it as dict""" """ load .ini file and return it as dict"""
if os.path.isfile(filename): if os.path.isfile(filename):
...@@ -112,7 +112,7 @@ def pass2key(passphrase): ...@@ -112,7 +112,7 @@ def pass2key(passphrase):
memlimit: crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE memlimit: crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE
""" """
buf = passphrase.encode('utf-8') buf = passphrase.encode('utf-8')
KEY_BYTES = pysodium.crypto_pwhash_scryptsalsa208sha256_SALTBYTES #32 KEY_BYTES = pysodium.crypto_pwhash_scryptsalsa208sha256_SALTBYTES #32
# this should be: # this should be:
# salt = bytes(KEY_BYTES) # salt = bytes(KEY_BYTES)
# but due to bytes() stupid stuff in py2 we need this awfull stuff # but due to bytes() stupid stuff in py2 we need this awfull stuff
...@@ -127,4 +127,3 @@ def reduce_addr(addr): ...@@ -127,4 +127,3 @@ def reduce_addr(addr):
"""return a string based addred without all digits""" """return a string based addred without all digits"""
tmp = addr.str tmp = addr.str
return tmp[:5] + '..' + tmp[-5:] return tmp[:5] + '..' + tmp[-5:]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment