Skip to content

Commit

Permalink
#6682 beaker config is moved to .bak by beakerx-install
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasz Mitusinski committed Jan 19, 2018
1 parent a5f7165 commit 7d52de5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions beakerx/beakerx/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

from string import Template
from jupyter_client.kernelspecapp import KernelSpecManager
from jupyter_core import paths
from traitlets.config.manager import BaseJSONConfigManager
from distutils import log

Expand Down Expand Up @@ -127,6 +128,14 @@ def _install_magics():
file.write("c.InteractiveShellApp.extensions = ['beakerx.groovy_magic']")
file.close()

def _create_conf_backup():
config_path = os.path.join(paths.jupyter_config_dir(), 'beakerx.json')
backup_path = config_path + ".bak"
if pathlib.Path(config_path).exists():
if pathlib.Path(backup_path).exists():
os.remove(backup_path)
os.rename(config_path, backup_path)


def _pretty(it):
return json.dumps(it, indent=2)
Expand Down Expand Up @@ -187,6 +196,7 @@ def _install_beakerx(args):
_copy_icons()
_install_kernelspec_manager(args.prefix)
_install_magics()
_create_conf_backup()


def install():
Expand Down

0 comments on commit 7d52de5

Please sign in to comment.