-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
46 lines (35 loc) · 1.08 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Automatic setup for custom Jupyter CSS
Authored by Eric Easthope
MIT License
Copyright (c) 2020
"""
from setuptools import setup
import os
import subprocess
from shutil import copyfile
def _post_install(setup):
def _post_actions():
# Get Jupyter notebook config directory
command = "jupyter --config-dir"
process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
output, error = process.communicate()
config_dir = output.decode("utf-8").replace("\n", "")
# Get path to Jupyter notebook custom CSS
custom_path = os.path.join(config_dir, "custom")
# Get path to Darkglow theme CSS
darkglow_path = os.path.join(os.getcwd(), "css", "darkglow.css")
# Copy theme to replace Jupyter notebook custom CSS
copyfile(darkglow_path, os.path.join(custom_path, "custom.css"))
_post_actions()
return setup
_post_install(
setup(
name="nbstyle",
version="0.0.1",
author="Eric Easthope",
include_package_data=True,
)
)