From e3327a4b739fa601ee8c824400b636c9a562d8f2 Mon Sep 17 00:00:00 2001 From: liangyongxiong Date: Wed, 22 Apr 2020 08:57:31 +0800 Subject: [PATCH] fix pylint warnings --- mindinsight/backend/run.py | 8 ++++---- mindinsight/scripts/stop.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mindinsight/backend/run.py b/mindinsight/backend/run.py index 2036f0d..e864832 100644 --- a/mindinsight/backend/run.py +++ b/mindinsight/backend/run.py @@ -231,7 +231,7 @@ def start(): log_size = _get_file_size(errorlog_abspath) - stdout = setup_logger('mindinsight', 'stdout', console=True, logfile=False, formatter='%(message)s') + console = setup_logger('mindinsight', 'console', console=True, logfile=False, formatter='%(message)s') # start server process = subprocess.Popen( @@ -243,15 +243,15 @@ def start(): ) _, stderr = process.communicate() if stderr: - stdout.error(stderr.decode()) + console.error(stderr.decode()) # wait command success to end when gunicorn running in daemon. if gunicorn_conf.daemon and process.wait() == 0: state_result = _check_server_start_stat(errorlog_abspath, log_size) # print gunicorn start state to stdout - stdout.info('Web address: http://{}:{}'.format(settings.HOST, settings.PORT)) + console.info('Web address: http://%s:%s', settings.HOST, settings.PORT) for line in state_result["prompt_message"]: - stdout.info(line) + console.info(line) if __name__ == '__main__': diff --git a/mindinsight/scripts/stop.py b/mindinsight/scripts/stop.py index 38867af..60d7553 100644 --- a/mindinsight/scripts/stop.py +++ b/mindinsight/scripts/stop.py @@ -109,7 +109,7 @@ class Command(BaseCommand): try: os.kill(pid, signal.SIGKILL) except PermissionError: - self.console.info('kill pid %s failed due to permission error' % pid) + self.console.info('kill pid %s failed due to permission error', pid) sys.exit(1) # cleanup gunicorn worker processes -- GitLab