First time here? Check out the FAQ!

Ask Your Question
0

Command to get current user of the notebook ?

asked 11 years ago

Eric Gaul gravatar image

updated 11 years ago

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...

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 11 years ago

ndomes gravatar image

updated 11 years ago

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

Preview: (hide)
link

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: 11 years ago

Seen: 943 times

Last updated: Jan 18 '14