Ask Your Question
0

Command to get current user of the notebook ?

asked 2014-01-16 11:48:08 +0100

Eric Gaul gravatar image

updated 2014-01-16 11:48:53 +0100

The only command I found :

user = DATA.split('/home/sageservice/nbfiles.sagenb/home/')[0].split('sage_notebook.sagenb/home/')[1].split('/')[0];

parses a path to the current worksheet and returns the user which owns the current worksheet. This name may be different of the current user, in the case of a shared worksheet. The username I am looking for is in fact the one that is displayed on the top line of the screen...

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-01-18 07:52:03 +0100

ndomes gravatar image

updated 2014-01-18 08:15:08 +0100

See docstrings in sagenb.notebook.user_manager.py

For example:

    sage: from sagenb.notebook.user_manager import SimpleUserManager
    sage: U = SimpleUserManager()
    sage: U.create_default_users('password')
    sage: U.user_list()

Isn't this what you want? See also suitable docstrings in sagenb.notebook.notebook.py

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2014-01-16 11:48:08 +0100

Seen: 757 times

Last updated: Jan 18 '14