2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-09 08:30:39 +00:00

style: sort and optimize imports

This commit is contained in:
Gavin D'souza 2020-04-02 22:24:21 +05:30
parent 1f4994d434
commit 20152f2dce
7 changed files with 46 additions and 22 deletions

View File

@ -14,7 +14,6 @@ import bench.config.production_setup
import bench.config.redis
import bench.config.site_config
import bench.config.supervisor
import bench.utils
from bench.utils import exec_cmd, run_playbook

View File

@ -1,2 +1,4 @@
# imports - third party imports
from jinja2 import Environment, PackageLoader
env = Environment(loader=PackageLoader('bench.config'))

View File

@ -1,15 +1,20 @@
import bench, os, click, errno
from bench.utils import exec_cmd, CommandFailedError, update_common_site_config
from bench.config.site_config import update_site_config, remove_domain, get_domains
# imports - standard imports
import errno
import os
# imports - third party imports
import click
from crontab import CronTab
from six.moves.urllib.request import urlretrieve
# imports - module imports
import bench
from bench.config.common_site_config import get_config
from bench.config.nginx import make_nginx_conf
from bench.config.production_setup import service
from bench.config.common_site_config import get_config
from crontab import CronTab
from bench.config.site_config import get_domains, remove_domain, update_site_config
from bench.utils import CommandFailedError, exec_cmd, update_common_site_config
try:
from urllib.request import urlretrieve
except ImportError:
from urllib import urlretrieve
def setup_letsencrypt(site, custom_domain, bench_path, interactive):
@ -171,4 +176,3 @@ def setup_wildcard_ssl(domain, email, bench_path, exclude_base_domain):
make_nginx_conf(bench_path)
print("Restrting Nginx service")
service('nginx', 'restart')

View File

@ -1,7 +1,15 @@
import bench, os, click
from bench.utils import find_executable
# imports - standard imports
import os
# imports - third party imports
import click
# imports - module imports
import bench
from bench.app import use_rq
from bench.config.common_site_config import get_config
from bench.utils import find_executable
def setup_procfile(bench_path, yes=False, skip_redis=False):
config = get_config(bench_path=bench_path)

View File

@ -1,14 +1,13 @@
# imports - standard imports
import os
import sys
from distutils.spawn import find_executable
# imports - module imports
from bench.config.common_site_config import get_config
from bench.config.nginx import make_nginx_conf
from bench.config.supervisor import generate_supervisor_config
from bench.config.systemd import generate_systemd_config
from bench.utils import CommandFailedError, exec_cmd, fix_prod_setup_perms, get_bench_name, get_cmd_output
from bench.utils import CommandFailedError, exec_cmd, find_executable, fix_prod_setup_perms, get_bench_name, get_cmd_output
def setup_production_prerequisites():

View File

@ -1,8 +1,13 @@
import os, json
from bench.utils import get_sites
from bench.config.nginx import make_nginx_conf
# imports - standard imports
import json
import os
from collections import defaultdict
# imports - module imports
from bench.config.nginx import make_nginx_conf
from bench.utils import get_sites
def get_site_config(site, bench_path='.'):
config_path = os.path.join(bench_path, 'sites', site, 'site_config.json')
if not os.path.exists(config_path):

View File

@ -1,9 +1,16 @@
import os, getpass, click
# imports - standard imports
import getpass
import os
# imports - third partyimports
import click
# imports - module imports
import bench
from bench.utils import exec_cmd
from bench.app import get_current_frappe_version, use_rq
from bench.utils import get_bench_name, find_executable
from bench.config.common_site_config import get_config, update_config, get_gunicorn_workers
from bench.config.common_site_config import get_config, get_gunicorn_workers, update_config
from bench.utils import exec_cmd, find_executable, get_bench_name
def generate_systemd_config(bench_path, user=None, yes=False,
stop=False, create_symlinks=False,