Skip to content

Change default value for cleanup to False in latex_cleanup #251

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion jupyterlab_latex/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from .util import run_command

@contextmanager
def latex_cleanup(cleanup=True, workdir='.', whitelist=None, greylist=None):
def latex_cleanup(cleanup=False, workdir='.', whitelist=None, greylist=None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it work? It would seem this default is not used in:

with latex_cleanup(
cleanup=c.cleanup,

Can it be changed on the trait level?

cleanup = Bool(default_value=True, config=True,
help='Whether to clean up ".out/.aux" files or not.')

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I guess the help message should clarify that it is more aggressive than just out/aux

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it work? It would seem this default is not used in:

Right! Sorry I didn't catch how it's working.
I have modified config.py and clarified (I hope) the documentation.
Thanks for your review!

"""Context manager for changing directory and removing files when done.

By default it works in the current directory, and removes all files that
Expand All @@ -21,6 +21,9 @@ def latex_cleanup(cleanup=True, workdir='.', whitelist=None, greylist=None):
Parameters
----------

cleanup = bool, default=False
Whether to clean up files that were not in the working directory
or not.
workdir = string, optional
This represents a path to the working directory for running LaTeX (the
default is '.').
Expand Down
4 changes: 2 additions & 2 deletions jupyterlab_latex/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class LatexConfig(Configurable):
'to disallow all shell escapes')
run_times = Integer(default_value=1, config=True,
help='How many times to compile the ".tex" files.')
cleanup = Bool(default_value=True, config=True,
help='Whether to clean up ".out/.aux" files or not.')
cleanup = Bool(default_value=False, config=True,
help='Whether to clean up files that were not in the working directory or not.')
# Add a new configuration option to hold user-defined commands
manual_cmd_args = TraitletsList(Unicode(), default_value=[], config=True,
help='A list of user-defined command-line arguments with placeholders for ' +
Expand Down