Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#6912 improved style in python install script #6917

Merged
merged 1 commit into from
Mar 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions beakerx/beakerx/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,9 @@ def _install_magics():
log.info("installing groovy magic for python...")
dir_path = os.path.join(sys.prefix, 'etc', 'ipython')
pathlib.Path(dir_path).mkdir(parents=True, exist_ok=True)
file = open(os.path.join(dir_path, 'ipython_config.py'), 'w+')
file.write("c = get_config()\n")
file.write("c.InteractiveShellApp.extensions = ['beakerx_magics.groovy_magic']\n")
file.close()
with open(os.path.join(dir_path, 'ipython_config.py'), 'w+') as ipython_config:
ipython_config.write("c = get_config()\n")
ipython_config.write("c.InteractiveShellApp.extensions = ['beakerx_magics.groovy_magic']\n")

def _set_conf_privileges():
config_path = os.path.join(paths.jupyter_config_dir(), 'beakerx.json')
Expand Down