Skip to content

Commit cf4b29a

Browse files
committed
ensure async and docs
1 parent ec700b0 commit cf4b29a

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

jupyter_server/services/sessions/sessionmanager.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,14 +279,16 @@ async def create_session(
279279
async def get_kernel_env(self, path: str, name: Optional[str] = None) -> Dict[str, str]:
280280
"""Return the environment variables that need to be set in the kernel
281281
282+
path : str
283+
the path for the given session – seem to be a session id sometime.
282284
name: str
283285
Here the name is likely to be the name of the associated file
284286
with the current kernel at startup time.
285287
286288
287289
"""
288290
if name is not None:
289-
session_dir = await self.contents_manager.get_kernel_path(path=path)
291+
session_dir = await ensure_async(self.contents_manager.get_kernel_path(path=path))
290292
cwd = self.kernel_manager.cwd_for_path(path)
291293
path = os.path.join(cwd, session_dir, name)
292294
assert isinstance(path, str)
@@ -295,9 +297,15 @@ async def get_kernel_env(self, path: str, name: Optional[str] = None) -> Dict[st
295297
async def start_kernel_for_session(self, session_id, path, name, type, kernel_name):
296298
"""Start a new kernel for a given session.
297299
298-
name: str
300+
session_id : str
301+
uuid for the session; this method must be given a session_id
302+
path : str
303+
the path for the given session – seem to be a session id sometime.
304+
name : str
299305
Usually the model name, like the filename associated with current
300306
kernel.
307+
type : string
308+
the type of the session, seem to be unused.
301309
302310
"""
303311
# allow contents manager to specify kernels cwd
@@ -324,9 +332,9 @@ async def save_session(self, session_id, path=None, name=None, type=None, kernel
324332
uuid for the session; this method must be given a session_id
325333
path : str
326334
the path for the given session
327-
name: str
335+
name : str
328336
the name of the session
329-
type: string
337+
type : string
330338
the type of the session
331339
kernel_id : str
332340
a uuid for the kernel associated with this session

0 commit comments

Comments
 (0)