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

fix: remove unused method and use six to reload module (#875)

* remove download_chart_of_accounts method as it is not being used
  anywhere

* use reload_module from six for flake8 fixes

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
This commit is contained in:
Chinmay Pai 2019-12-15 10:41:27 +05:30 committed by GitHub
parent 72c70b23bf
commit d2d577201d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 14 deletions

View File

@ -1,11 +1,13 @@
import click
import sys, os
import sys
import os
from bench.config.common_site_config import get_config, update_config
from bench.app import pull_all_apps, is_version_upgrade, validate_branch
from bench.utils import (update_bench, validate_upgrade, pre_upgrade, post_upgrade, before_update,
update_requirements, update_node_packages, backup_all_sites, patch_sites, build_assets,
restart_supervisor_processes, restart_systemd_processes)
from bench import patches
from six import reload_module
@click.command('update')
@ -88,13 +90,8 @@ def _update(pull=False, patch=False, build=False, update_bench=False, auto=False
pre_upgrade(version_upgrade[1], version_upgrade[2], bench_path=bench_path)
import bench.utils, bench.app
print('Reloading bench...')
if sys.version_info >= (3, 4):
import importlib
importlib.reload(bench.utils)
importlib.reload(bench.app)
else:
reload(bench.utils)
reload(bench.app)
reload_module(bench.utils)
reload_module(bench.app)
if patch:
print('Patching sites...')

View File

@ -727,12 +727,6 @@ def update_translations(app, lang):
print('downloaded for', app, lang)
def download_chart_of_accounts():
charts_dir = os.path.join('apps', "erpnext", "erpnext", 'accounts', 'chart_of_accounts', "submitted")
csv_file = os.path.join(translations_dir, lang + '.csv')
url = "https://translate.erpnext.com/files/{}-{}.csv".format(app, lang)
r = requests.get(url, stream=True)
r.raise_for_status()
def print_output(p):
while p.poll() is None: