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

Use tempfile.mkstemp to create tempfiles #152

Merged
merged 1 commit into from
Jul 16, 2017
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: 4 additions & 3 deletions jupyterthemes/stylefx.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import lesscpy
from IPython.core.display import HTML
from glob import glob
from tempfile import mkstemp

# path to local site-packages/jupyterthemes
package_dir = os.path.dirname(os.path.realpath(__file__))
Expand All @@ -14,8 +15,8 @@
user_dir = os.path.join(os.path.expanduser('~'), '.jupyter-themes')

# path to save tempfile with style_less before reading/compiling
tempfile = os.path.join(package_dir, 'tempfile.less')
vimtemp = os.path.join(package_dir, 'vimtemp.less')
_, tempfile = mkstemp('.less')
_, vimtemp = mkstemp('.less')

# path to install custom.css file (~/.jupyter/custom/)
jupyter_home = jupyter_config_dir()
Expand Down Expand Up @@ -74,7 +75,7 @@ def write_final_css(style_css):


def remove_temp_file():
# remove tempfile.less from package_dir
# remove tempfile.less
os.remove(tempfile)


Expand Down