mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
[mod] continue with pep8
This commit is contained in:
parent
7ce3981db1
commit
f931976667
6 changed files with 7 additions and 7 deletions
|
@ -2,4 +2,4 @@ language: python
|
||||||
install: "pip install pep8"
|
install: "pip install pep8"
|
||||||
python:
|
python:
|
||||||
- "2.7"
|
- "2.7"
|
||||||
script: "pep8 --ignore E501,E128 moulinette"
|
script: "pep8 --ignore E501,E128,E731 moulinette"
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from moulinette.core import init_interface, MoulinetteError
|
||||||
|
|
||||||
__title__ = 'moulinette'
|
__title__ = 'moulinette'
|
||||||
__version__ = '0.1'
|
__version__ = '0.1'
|
||||||
__author__ = ['Kload',
|
__author__ = ['Kload',
|
||||||
|
@ -29,8 +31,6 @@ __all__ = [
|
||||||
'init_interface', 'MoulinetteError',
|
'init_interface', 'MoulinetteError',
|
||||||
]
|
]
|
||||||
|
|
||||||
from moulinette.core import init_interface, MoulinetteError
|
|
||||||
|
|
||||||
|
|
||||||
# Package functions
|
# Package functions
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,7 @@ class BaseAuthenticator(object):
|
||||||
gpg.encoding = 'utf-8'
|
gpg.encoding = 'utf-8'
|
||||||
|
|
||||||
decrypted = gpg.decrypt(enc_pwd, passphrase=session_hash)
|
decrypted = gpg.decrypt(enc_pwd, passphrase=session_hash)
|
||||||
if decrypted.ok != True:
|
if decrypted.ok is not True:
|
||||||
logger.error("unable to decrypt password for the session: %s",
|
logger.error("unable to decrypt password for the session: %s",
|
||||||
decrypted.status)
|
decrypted.status)
|
||||||
raise MoulinetteError(errno.EINVAL,
|
raise MoulinetteError(errno.EINVAL,
|
||||||
|
|
|
@ -49,7 +49,7 @@ class Package(object):
|
||||||
self._cachedir = package.cachedir
|
self._cachedir = package.cachedir
|
||||||
|
|
||||||
def __setattr__(self, name, value):
|
def __setattr__(self, name, value):
|
||||||
if name[0] == '_' and self.__dict__.has_key(name):
|
if name[0] == '_' and name in self.__dict__:
|
||||||
# Deny reassignation of package directories
|
# Deny reassignation of package directories
|
||||||
logger.error("cannot reassign Package variable '%s'", name)
|
logger.error("cannot reassign Package variable '%s'", name)
|
||||||
return
|
return
|
||||||
|
|
|
@ -254,7 +254,7 @@ class BaseActionsMapParser(object):
|
||||||
else:
|
else:
|
||||||
if ifaces == 'all':
|
if ifaces == 'all':
|
||||||
conf['authenticate'] = ifaces
|
conf['authenticate'] = ifaces
|
||||||
elif ifaces == False:
|
elif ifaces is False:
|
||||||
conf['authenticate'] = False
|
conf['authenticate'] = False
|
||||||
elif isinstance(ifaces, list):
|
elif isinstance(ifaces, list):
|
||||||
# Store only if authentication is needed
|
# Store only if authentication is needed
|
||||||
|
|
|
@ -101,7 +101,7 @@ class MoulinetteLogger(Logger):
|
||||||
"""Append action_id if available to the extra."""
|
"""Append action_id if available to the extra."""
|
||||||
if self.action_id is not None:
|
if self.action_id is not None:
|
||||||
extra = kwargs.get('extra', {})
|
extra = kwargs.get('extra', {})
|
||||||
if not 'action_id' in extra:
|
if 'action_id' not in extra:
|
||||||
# FIXME: Get real action_id instead of logger/current one
|
# FIXME: Get real action_id instead of logger/current one
|
||||||
extra['action_id'] = _get_action_id()
|
extra['action_id'] = _get_action_id()
|
||||||
kwargs['extra'] = extra
|
kwargs['extra'] = extra
|
||||||
|
|
Loading…
Reference in a new issue