mirror of
https://github.com/frappe/bench.git
synced 2025-01-10 00:37:51 +00:00
style: sort and optimize imports
This commit is contained in:
parent
1f4994d434
commit
20152f2dce
@ -14,7 +14,6 @@ import bench.config.production_setup
|
|||||||
import bench.config.redis
|
import bench.config.redis
|
||||||
import bench.config.site_config
|
import bench.config.site_config
|
||||||
import bench.config.supervisor
|
import bench.config.supervisor
|
||||||
|
|
||||||
import bench.utils
|
import bench.utils
|
||||||
from bench.utils import exec_cmd, run_playbook
|
from bench.utils import exec_cmd, run_playbook
|
||||||
|
|
||||||
|
@ -1,2 +1,4 @@
|
|||||||
|
# imports - third party imports
|
||||||
from jinja2 import Environment, PackageLoader
|
from jinja2 import Environment, PackageLoader
|
||||||
|
|
||||||
env = Environment(loader=PackageLoader('bench.config'))
|
env = Environment(loader=PackageLoader('bench.config'))
|
||||||
|
@ -1,15 +1,20 @@
|
|||||||
import bench, os, click, errno
|
# imports - standard imports
|
||||||
from bench.utils import exec_cmd, CommandFailedError, update_common_site_config
|
import errno
|
||||||
from bench.config.site_config import update_site_config, remove_domain, get_domains
|
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.nginx import make_nginx_conf
|
||||||
from bench.config.production_setup import service
|
from bench.config.production_setup import service
|
||||||
from bench.config.common_site_config import get_config
|
from bench.config.site_config import get_domains, remove_domain, update_site_config
|
||||||
from crontab import CronTab
|
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):
|
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)
|
make_nginx_conf(bench_path)
|
||||||
print("Restrting Nginx service")
|
print("Restrting Nginx service")
|
||||||
service('nginx', 'restart')
|
service('nginx', 'restart')
|
||||||
|
|
||||||
|
@ -1,7 +1,15 @@
|
|||||||
import bench, os, click
|
# imports - standard imports
|
||||||
from bench.utils import find_executable
|
import os
|
||||||
|
|
||||||
|
# imports - third party imports
|
||||||
|
import click
|
||||||
|
|
||||||
|
# imports - module imports
|
||||||
|
import bench
|
||||||
from bench.app import use_rq
|
from bench.app import use_rq
|
||||||
from bench.config.common_site_config import get_config
|
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):
|
def setup_procfile(bench_path, yes=False, skip_redis=False):
|
||||||
config = get_config(bench_path=bench_path)
|
config = get_config(bench_path=bench_path)
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
# imports - standard imports
|
# imports - standard imports
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
from distutils.spawn import find_executable
|
|
||||||
|
|
||||||
# imports - module imports
|
# imports - module imports
|
||||||
from bench.config.common_site_config import get_config
|
from bench.config.common_site_config import get_config
|
||||||
from bench.config.nginx import make_nginx_conf
|
from bench.config.nginx import make_nginx_conf
|
||||||
from bench.config.supervisor import generate_supervisor_config
|
from bench.config.supervisor import generate_supervisor_config
|
||||||
from bench.config.systemd import generate_systemd_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():
|
def setup_production_prerequisites():
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
import os, json
|
# imports - standard imports
|
||||||
from bench.utils import get_sites
|
import json
|
||||||
from bench.config.nginx import make_nginx_conf
|
import os
|
||||||
from collections import defaultdict
|
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='.'):
|
def get_site_config(site, bench_path='.'):
|
||||||
config_path = os.path.join(bench_path, 'sites', site, 'site_config.json')
|
config_path = os.path.join(bench_path, 'sites', site, 'site_config.json')
|
||||||
if not os.path.exists(config_path):
|
if not os.path.exists(config_path):
|
||||||
|
@ -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
|
import bench
|
||||||
from bench.utils import exec_cmd
|
|
||||||
from bench.app import get_current_frappe_version, use_rq
|
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, get_gunicorn_workers, update_config
|
||||||
from bench.config.common_site_config import get_config, update_config, get_gunicorn_workers
|
from bench.utils import exec_cmd, find_executable, get_bench_name
|
||||||
|
|
||||||
|
|
||||||
def generate_systemd_config(bench_path, user=None, yes=False,
|
def generate_systemd_config(bench_path, user=None, yes=False,
|
||||||
stop=False, create_symlinks=False,
|
stop=False, create_symlinks=False,
|
||||||
|
Loading…
Reference in New Issue
Block a user