On 2/17/11 10:09 PM, William Stein wrote:
On Thu, Feb 17, 2011 at 4:24 AM, Pedro Cruz<pedrocruzave...@gmail.com>  wrote:
I'm writting an application were a person develops an algorithm using
the sage notebook (on his computer, for example).

That algorithm will be developed inside a notebook cell.

Then I would like to store that cell contents in a common database
automatically avoiding "cut/paste" to another place.

I want to save the  "textual" class definition (not the bytecode of
the python/sage class).

Example:

--cell start---
class SomeClass:
    def make(self):
        print "do something"

print THIS_CELL_STRING_CONTENT() #including this line
----cell end----

Is there a command to get the "id" of current cell ?

sagenb.notebook.interact.SAGE_CELL_ID

Is there a command to read cell "id" contents (textual) ?

I don't think so.  The process that knows the cell contents is the
notebook server; the process running the actual code doesn't know the
contents of other cells, unfortunately.


You could probably write some javascript code that would use the cell id to extract the text. Then you would at least have it in your browser, if that helps.

In fact, if you could do it from your browser, I suppose you could just just attach a small button or something to each input cell using jquery.

Jason

--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to