Skip to content

Commit 053830c

Browse files
committed
Remove Appmode.hidden_temp_files and use ContentsManager.allow_hidden instead
1 parent 844a99e commit 053830c

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

README.md

+3-10
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,11 @@ Appmode adds the following [configuration options](https://jupyter-notebook.read
5252
- `Appmode.show_edit_button` Show _Edit App_ button during Appmode. Default: True.
5353
- `Appmode.show_other_buttons` Show other buttons, e.g. Logout, during Appmode. Default: True.
5454
- `Appmode.temp_dir` Create temp notebooks under this directory. Default: Same directory as current notebook
55-
- `Appmode.hidden_temp_files` Create temp notebooks as hidden files. Default: True
5655

57-
Writing to hidden files is disabled in newer versions of notebook. You will need to enable one of the following
58-
configuration options to run appmode:
56+
Writing hidden files is by default disabled in newer versions of Jupyter.
57+
To allow Appmode to hide its temporary notebook copies the option `ContentsManager.allow_hidden` has to be set:
5958
```
60-
ContentsManager.allow_hidden=True
61-
or
62-
Appmode.hidden_temp_files=False
63-
```
64-
Example:
65-
```
66-
jupyter notebook --Appmode.hidden_temp_files=False
59+
jupyter notebook --ContentsManager.allow_hidden=True
6760
```
6861

6962
## Client Side Customization

appmode/server_extension.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class Appmode(LoggingConfigurable):
3232
show_edit_button = Bool(True, help="Show Edit App button during Appmode.", config=True)
3333
show_other_buttons = Bool(True, help="Show other buttons, e.g. Logout, during Appmode.", config=True)
3434
temp_dir = Unicode('', help="Create temporary Appmode notebooks in this directory.", config=True)
35-
hidden_temp_files = Bool(True, help="Temporary Appmode notebooks are hidden files.", config=True)
3635

3736
#===============================================================================
3837
class AppmodeHandler(IPythonHandler):
@@ -52,10 +51,6 @@ def show_other_buttons(self):
5251
def temp_dir(self):
5352
return self.settings['appmode'].temp_dir
5453

55-
@property
56-
def hidden_temp_files(self):
57-
return self.settings['appmode'].hidden_temp_files
58-
5954
#===========================================================================
6055
@web.authenticated
6156
async def get(self, path):
@@ -134,7 +129,7 @@ async def mk_tmp_copy(self, path):
134129
os.makedirs(dirname)
135130
fullbasename = os.path.basename(path)
136131
basename, ext = os.path.splitext(fullbasename)
137-
if self.hidden_temp_files:
132+
if cm.allow_hidden:
138133
basename = '.' + basename
139134
for i in itertools.count():
140135
tmp_path = "%s/%s-%i%s"%(dirname, basename, i, ext)

0 commit comments

Comments
 (0)