File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -1264,16 +1264,22 @@ def _update_pylab(self, change):
1264
1264
1265
1265
@observe ('notebook_dir' )
1266
1266
def _update_notebook_dir (self , change ):
1267
+ if self ._root_dir_set :
1268
+ # only use deprecated config if new config is not set
1269
+ return
1267
1270
self .log .warning (_ ("notebook_dir is deprecated, use root_dir" ))
1268
1271
self .root_dir = change ['new' ]
1269
1272
1270
- root_dir = Unicode (config = True ,
1273
+ root_dir = Unicode (
1274
+ config = True ,
1271
1275
help = _ ("The directory to use for notebooks and kernels." )
1272
1276
)
1277
+ _root_dir_set = False
1273
1278
1274
1279
@default ('root_dir' )
1275
1280
def _default_root_dir (self ):
1276
1281
if self .file_to_run :
1282
+ self ._root_dir_set = True
1277
1283
return os .path .dirname (os .path .abspath (self .file_to_run ))
1278
1284
else :
1279
1285
return py3compat .getcwd ()
@@ -1294,6 +1300,10 @@ def _root_dir_validate(self, proposal):
1294
1300
raise TraitError (trans .gettext ("No such notebook dir: '%r'" ) % value )
1295
1301
return value
1296
1302
1303
+ @observe ('root_dir' )
1304
+ def _root_dir_changed (self , change ):
1305
+ self ._root_dir_set = True
1306
+
1297
1307
@observe ('server_extensions' )
1298
1308
def _update_server_extensions (self , change ):
1299
1309
self .log .warning (_ ("server_extensions is deprecated, use jpserver_extensions" ))
You can’t perform that action at this time.
0 commit comments