Skip to content

Commit

Permalink
fix: remove unused method and use six to reload module (frappe#875)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Thunderbottom committed Dec 15, 2019
1 parent 72c70b2 commit d2d5772
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
13 changes: 5 additions & 8 deletions bench/commands/update.py
@@ -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')
Expand Down Expand Up @@ -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...')
Expand Down
6 changes: 0 additions & 6 deletions bench/utils.py
Expand Up @@ -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:
Expand Down

0 comments on commit d2d5772

Please sign in to comment.