diff --git a/bench/app.py b/bench/app.py index a3a63ec8..689a5921 100755 --- a/bench/app.py +++ b/bench/app.py @@ -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): diff --git a/bench/utils.py b/bench/utils.py index 6a2614cf..a9f9a60c 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -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