From 8b4dfce4f04a5128a281a672304707237f2ede4d Mon Sep 17 00:00:00 2001 From: Lev Vereshchagin Date: Fri, 10 Dec 2021 11:53:00 +0300 Subject: [PATCH] chore(lint): Run isort --- build/frappe-worker/bench | 3 +-- build/frappe-worker/commands/auto_migrate.py | 8 +++---- build/frappe-worker/commands/backup.py | 3 ++- .../commands/check_connection.py | 17 ++++++------- build/frappe-worker/commands/doctor.py | 2 +- build/frappe-worker/commands/migrate.py | 2 +- build/frappe-worker/commands/new.py | 11 +++------ build/frappe-worker/commands/push_backup.py | 14 ++++------- .../frappe-worker/commands/restore_backup.py | 24 +++++++++---------- build/frappe-worker/commands/utils.py | 4 ++-- 10 files changed, 40 insertions(+), 48 deletions(-) diff --git a/build/frappe-worker/bench b/build/frappe-worker/bench index b7d9280b..f702d0d7 100755 --- a/build/frappe-worker/bench +++ b/build/frappe-worker/bench @@ -1,9 +1,8 @@ #!/home/frappe/frappe-bench/env/bin/python +import os import subprocess import sys -import os - if __name__ == "__main__": bench_dir = os.path.join(os.sep, "home", "frappe", "frappe-bench") diff --git a/build/frappe-worker/commands/auto_migrate.py b/build/frappe-worker/commands/auto_migrate.py index 095830a3..a9f84743 100644 --- a/build/frappe-worker/commands/auto_migrate.py +++ b/build/frappe-worker/commands/auto_migrate.py @@ -1,14 +1,14 @@ import os -import semantic_version -import git +import git +import semantic_version from migrate import migrate_sites from utils import ( - save_version_file, get_apps, + get_config, get_container_versions, get_version_file, - get_config, + save_version_file, ) diff --git a/build/frappe-worker/commands/backup.py b/build/frappe-worker/commands/backup.py index 9a599d87..9338d207 100644 --- a/build/frappe-worker/commands/backup.py +++ b/build/frappe-worker/commands/backup.py @@ -1,7 +1,8 @@ import os + import frappe -from frappe.utils.backups import scheduled_backup from frappe.utils import cint, get_sites, now +from frappe.utils.backups import scheduled_backup def backup(sites, with_files=False): diff --git a/build/frappe-worker/commands/check_connection.py b/build/frappe-worker/commands/check_connection.py index c05dfb9a..d2bae21f 100644 --- a/build/frappe-worker/commands/check_connection.py +++ b/build/frappe-worker/commands/check_connection.py @@ -1,15 +1,16 @@ import socket import time + +from constants import ( + DB_HOST_KEY, + DB_PORT, + DB_PORT_KEY, + REDIS_CACHE_KEY, + REDIS_QUEUE_KEY, + REDIS_SOCKETIO_KEY, +) from six.moves.urllib.parse import urlparse from utils import get_config -from constants import ( - REDIS_QUEUE_KEY, - REDIS_CACHE_KEY, - REDIS_SOCKETIO_KEY, - DB_HOST_KEY, - DB_PORT_KEY, - DB_PORT, -) def is_open(ip, port, timeout=30): diff --git a/build/frappe-worker/commands/doctor.py b/build/frappe-worker/commands/doctor.py index 2874fc57..c7eac75f 100644 --- a/build/frappe-worker/commands/doctor.py +++ b/build/frappe-worker/commands/doctor.py @@ -1,10 +1,10 @@ import argparse from check_connection import ( - check_service, check_redis_cache, check_redis_queue, check_redis_socketio, + check_service, ) diff --git a/build/frappe-worker/commands/migrate.py b/build/frappe-worker/commands/migrate.py index 9c9402d2..2e99ed54 100644 --- a/build/frappe-worker/commands/migrate.py +++ b/build/frappe-worker/commands/migrate.py @@ -1,6 +1,6 @@ import os -import frappe +import frappe from frappe.utils import cint, get_sites from utils import get_config, save_config diff --git a/build/frappe-worker/commands/new.py b/build/frappe-worker/commands/new.py index 5f3c0ae6..546ef9d8 100644 --- a/build/frappe-worker/commands/new.py +++ b/build/frappe-worker/commands/new.py @@ -1,15 +1,10 @@ import os + import frappe import semantic_version - -from frappe.installer import update_site_config from constants import COMMON_SITE_CONFIG_FILE, RDS_DB, RDS_PRIVILEGES -from utils import ( - run_command, - get_config, - get_site_config, - get_password, -) +from frappe.installer import update_site_config +from utils import get_config, get_password, get_site_config, run_command # try to import _new_site from frappe, which could possibly # exist in either commands.py or installer.py, and so we need diff --git a/build/frappe-worker/commands/push_backup.py b/build/frappe-worker/commands/push_backup.py index cb466f5f..2a49933a 100644 --- a/build/frappe-worker/commands/push_backup.py +++ b/build/frappe-worker/commands/push_backup.py @@ -1,16 +1,12 @@ +import datetime import os import time -import boto3 - -import datetime from glob import glob -from frappe.utils import get_sites + +import boto3 from constants import DATE_FORMAT -from utils import ( - get_s3_config, - upload_file_to_s3, - check_s3_environment_variables, -) +from frappe.utils import get_sites +from utils import check_s3_environment_variables, get_s3_config, upload_file_to_s3 def get_file_ext(): diff --git a/build/frappe-worker/commands/restore_backup.py b/build/frappe-worker/commands/restore_backup.py index 6e19c2b9..1462cd27 100644 --- a/build/frappe-worker/commands/restore_backup.py +++ b/build/frappe-worker/commands/restore_backup.py @@ -1,26 +1,26 @@ -import os import datetime -import tarfile import hashlib -import frappe -import boto3 +import os +import tarfile -from frappe.utils import get_sites, random_string +import boto3 +import frappe +from constants import COMMON_SITE_CONFIG_FILE, DATE_FORMAT, RDS_DB, RDS_PRIVILEGES from frappe.installer import ( - make_conf, get_conf_params, + make_conf, make_site_dirs, update_site_config, ) -from constants import COMMON_SITE_CONFIG_FILE, DATE_FORMAT, RDS_DB, RDS_PRIVILEGES +from frappe.utils import get_sites, random_string from utils import ( - run_command, - list_directories, - set_key_in_site_config, - get_site_config, + check_s3_environment_variables, get_config, get_password, - check_s3_environment_variables, + get_site_config, + list_directories, + run_command, + set_key_in_site_config, ) diff --git a/build/frappe-worker/commands/utils.py b/build/frappe-worker/commands/utils.py index 5f81fdc6..7ea48225 100644 --- a/build/frappe-worker/commands/utils.py +++ b/build/frappe-worker/commands/utils.py @@ -1,11 +1,11 @@ import json import os import subprocess + import boto3 import git - -from frappe.installer import update_site_config from constants import APP_VERSIONS_JSON_FILE, APPS_TXT_FILE, COMMON_SITE_CONFIG_FILE +from frappe.installer import update_site_config def run_command(command, stdout=None, stdin=None, stderr=None):