Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I don't know about re-naming users, but here are all the steps you need to delete a user (adding one is easy enough):

1) Find your notebook directory. The default is $HOME/.sage/sage_notebook.sagenb (on Linux at least). If unsure, start your notebook server. On my machine, there is a line printed that says:

The notebook files are stored in: sage_notebook.sagenb

2) On my machine, this is what I did to delete a user:

sage: nb = sagenb.notebook.notebook.load_notebook("/home/goofy/.sage/sage_notebook.sagenb")
sage: nb.users()
{'admin': admin, 'user2': user2, 'user1': user1}
sage: nb.del_user("user2")
sage: nb.users()
{'admin': admin, 'user1': user1}
sage: nb.save()

3) Remarks

a) In the above example, nothing is done to the actual notebook files until the final step.

b) The function sagenb.notebook.notebook.load_notebook(dir) requires dir NOT to have a trailing "/" to work properly. So, if you use tab-completion (very handy!), be sure to remove that trailing slash. Otherwise, load_notebook would create a new notebook directory (.sagenb) within dir instead of simply opening dir itself as a notebook.