mirror of
https://github.com/frappe/bench.git
synced 2025-01-10 00:37:51 +00:00
perf: Remove shutil from the import tree
This commit is contained in:
parent
6706b230da
commit
07ecaa1f77
@ -6,7 +6,6 @@ import json
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
@ -89,6 +88,7 @@ def remove_from_excluded_apps_txt(app, bench_path='.'):
|
||||
|
||||
def get_app(git_url, branch=None, bench_path='.', skip_assets=False, verbose=False, restart_bench=True, overwrite=False):
|
||||
import requests
|
||||
import shutil
|
||||
|
||||
if not os.path.exists(git_url):
|
||||
if not is_git_url(git_url):
|
||||
@ -195,6 +195,7 @@ def install_app(app, bench_path=".", verbose=False, no_cache=False, restart_benc
|
||||
|
||||
|
||||
def remove_app(app, bench_path='.'):
|
||||
import shutil
|
||||
from bench.config.common_site_config import get_config
|
||||
|
||||
if app not in get_apps(bench_path):
|
||||
|
@ -13,7 +13,6 @@ import os
|
||||
import pwd
|
||||
import re
|
||||
import select
|
||||
import shutil
|
||||
import site
|
||||
import subprocess
|
||||
import sys
|
||||
@ -261,6 +260,8 @@ def update(pull=False, apps=None, patch=False, build=False, requirements=False,
|
||||
|
||||
|
||||
def copy_patches_txt(bench_path):
|
||||
import shutil
|
||||
|
||||
shutil.copy(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'patches', 'patches.txt'),
|
||||
os.path.join(bench_path, 'patches.txt'))
|
||||
|
||||
@ -900,6 +901,8 @@ def get_bench_name(bench_path):
|
||||
|
||||
|
||||
def setup_fonts():
|
||||
import shutil
|
||||
|
||||
fonts_path = os.path.join('/tmp', 'fonts')
|
||||
|
||||
if os.path.exists('/etc/fonts_backup'):
|
||||
@ -972,6 +975,7 @@ def find_benches(directory=None):
|
||||
|
||||
|
||||
def migrate_env(python, backup=False):
|
||||
import shutil
|
||||
from six.moves.urllib.parse import urlparse
|
||||
from bench.config.common_site_config import get_config
|
||||
from bench.app import get_apps
|
||||
|
Loading…
Reference in New Issue
Block a user