get current username on the server side

asked 2013-02-11 09:09:27 +0100

lehalle gravatar image

updated 2013-02-11 18:01:01 +0100

I am writing a code that I will put on the server side of SAGE/notebook (i.e. in the SAGE_PATH, not locally in a sheet or attached to a sheet). I want this code to know the name of the user launching it, how can I have it?

following http://https://groups.google.com/foru... , I found an ugly way to do it:

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

tell me if you have better

edit retag flag offensive close merge delete