I'm going to add
input += '_interact_.SAGE_CELL_BZ2TEXT=%r\n' %
bz2.compress(C.input_text())
to
~/sage/devel/sagenb/sagenb/notebook/worksheet.py
in function
start_next_comp()
It uses bz2 because it's already on worksheet.py and to avoid
string_inside_string problems.
This delays all cell computations but for now it will do.
Thank you for ideas and if a better came up please let me know.
Pedro
On 19 Fev, 01:11, Jason Grout <[email protected]> wrote:
> On 2/17/11 10:09 PM, William Stein wrote:
>
>
>
>
>
>
>
>
>
> > On Thu, Feb 17, 2011 at 4:24 AM, Pedro Cruz<[email protected]>
> > 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org