diff --git a/moulinette/actionsmap.py b/moulinette/actionsmap.py index 2d1d852d..4921fb9c 100644 --- a/moulinette/actionsmap.py +++ b/moulinette/actionsmap.py @@ -103,6 +103,7 @@ class CommentParameter(_ExtraParameter): % value) return value + class AskParameter(_ExtraParameter): """ Ask for the argument value if possible and needed. @@ -229,12 +230,13 @@ class RequiredParameter(_ExtraParameter): % value) return value + """ The list of available extra parameters classes. It will keep to this list order on argument parsing. """ -extraparameters_list = [CommentParameter, AskParameter, PasswordParameter, +extraparameters_list = [CommentParameter, AskParameter, PasswordParameter, RequiredParameter, PatternParameter] # Extra parameters argument Parser diff --git a/moulinette/interfaces/__init__.py b/moulinette/interfaces/__init__.py index 30ba8ae9..678c9526 100644 --- a/moulinette/interfaces/__init__.py +++ b/moulinette/interfaces/__init__.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- import re -import os import errno import logging import argparse diff --git a/moulinette/interfaces/api.py b/moulinette/interfaces/api.py index c102d9af..4ce66294 100644 --- a/moulinette/interfaces/api.py +++ b/moulinette/interfaces/api.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- -import os import re import errno import logging diff --git a/moulinette/utils/filesystem.py b/moulinette/utils/filesystem.py index fab5aa98..8d229e29 100644 --- a/moulinette/utils/filesystem.py +++ b/moulinette/utils/filesystem.py @@ -7,7 +7,6 @@ import grp from pwd import getpwnam from moulinette import m18n -from moulinette.globals import CACHE_DIR from moulinette.core import MoulinetteError # Files & directories -------------------------------------------------- diff --git a/moulinette/utils/log.py b/moulinette/utils/log.py index 47c13a1e..69eb62cf 100644 --- a/moulinette/utils/log.py +++ b/moulinette/utils/log.py @@ -1,7 +1,7 @@ import os import logging -# import all constant because other modules tries to important them from this +# import all constants because other modules try to import them from this # module because SUCCESS is defined in this module from logging import (addLevelName, setLoggerClass, Logger, getLogger, NOTSET, DEBUG, INFO, WARNING, ERROR, CRITICAL) diff --git a/moulinette/utils/process.py b/moulinette/utils/process.py index 299b96d5..5f1b0ddb 100644 --- a/moulinette/utils/process.py +++ b/moulinette/utils/process.py @@ -1,10 +1,7 @@ -import errno import time import subprocess import os -from moulinette.core import MoulinetteError - # This import is unused in this file. It will be deleted in future (W0611 PEP8), # but for the momment we keep it due to yunohost moulinette script that used # process.quote syntax to access this module ! @@ -60,13 +57,13 @@ def call_async_output(args, callback, **kwargs): raise ValueError('%s argument not allowed, ' 'it will be overridden.' % a) - if "stdinfo" in kwargs and kwargs["stdinfo"] != None: + if "stdinfo" in kwargs and kwargs["stdinfo"] is not None: assert len(callback) == 3 stdinfo = kwargs.pop("stdinfo") os.mkfifo(stdinfo, 0600) # Open stdinfo for reading (in a nonblocking way, i.e. even # if command does not write in the stdinfo pipe...) - stdinfo_f = os.open(stdinfo, os.O_RDONLY|os.O_NONBLOCK) + stdinfo_f = os.open(stdinfo, os.O_RDONLY | os.O_NONBLOCK) else: kwargs.pop("stdinfo") stdinfo = None