flask notebook beta (please test!)

53 views
Skip to first unread message

Jason Grout

unread,
Oct 15, 2011, 6:06:06 PM10/15/11
to sage-notebook
I think we've fixed the last few regressions in the flask notebook [1].
In particular, it is possible to see the worksheets that were shared
with you again.

I've updated test.sagenb.org with the latest version. Please test the
daylights out of it, or point out any more regressions. If you are so
inclined, please glance at the latest commits at

http://code.google.com/r/jasongrout-flask-sagenb/source/list

or install it yourself by following the instructions at:

http://code.google.com/r/jasongrout-flask-sagenb/

There is one last point that needs to be addressed. The sharing
worksheets thing needs to update some information a single time from the
list of shared worksheets (i.e., it needs to record the shared sheets in
the User object of each person that the sheet is shared with). Is there
an easy way to run a function the first time a notebook without this
information is opened to migrate that information?

Thanks,

Jason

[1]
http://code.google.com/p/sagenb/issues/list?can=2&q=label%3Aflask&colspec=ID+Type+Status+Priority+Milestone+Owner+Summary&cells=tiles

kcrisman

unread,
Oct 15, 2011, 9:33:19 PM10/15/11
to sage-notebook
Great news!

+++

I just tried to share a worksheet with the user jason.grout, but no
luck. At least, it appears to be no luck.

In particular, after I type in the person to share with, I get sent to
http://test.sagenb.org/home/kcrisman/0/invite_collab and that is a
blank page.

Oh, I see what happened! If you click the "Share" link for a
worksheet in the list of worksheets, this bad thing happens. But if
you do it from within the worksheet, all is well. I assume this
problem is fixable.

+++

Also, I'm not sure about the new names for the editing things.

Worksheet View Plain View Text

I'm not sure which of these is which. I mean, I figured it out by
trying, but it's not at all obvious to someone used to the previous
version. The "Worksheet View" will be confusing - maybe "default", or
whatever it was before? And the other two are particularly weird
because clicking on "Text" yields something that says "View plain
text", which is two different uses of "plain", I would say.

- kcrisman

kcrisman

unread,
Oct 15, 2011, 9:34:46 PM10/15/11
to sage-notebook
> Oh, I see what happened!  If you click the "Share" link for a
> worksheet in the list of worksheets, this bad thing happens.  But if
> you do it from within the worksheet, all is well.  I assume this
> problem is fixable.

Going back and forth a few times, it seems to happen in both contexts,
but not reliably...

Jason Grout

unread,
Oct 15, 2011, 9:53:20 PM10/15/11
to sage-n...@googlegroups.com

Can you try it again? I think I fixed it.

Thanks,

Jason

kcrisman

unread,
Oct 15, 2011, 10:21:54 PM10/15/11
to sage-notebook
Seems to be okay. Can you view http://test.sagenb.org/home/kcrisman/0/,
and does it show up in your list? Can you share one with me I can try
to see?

- kcrisman

Jason Grout

unread,
Oct 15, 2011, 10:59:47 PM10/15/11
to sage-n...@googlegroups.com

It's great. It did expose a bug, though. When I look at your worksheet
and then do "save and quit" it tries to send me to your home page
instead of mine, so I get a message like:

User 'jason.grout' does not have permission to view the home page of
'kcrisman'.

Thanks,

Jason


kcrisman

unread,
Oct 15, 2011, 11:36:26 PM10/15/11
to sage-notebook
> It's great.  It did expose a bug, though.  When I look at your worksheet
> and then do "save and quit" it tries to send me to your home page
> instead of mine, so I get a message like:
>
> User 'jason.grout' does not have permission to view the home page of
> 'kcrisman'.

I get that too.

I have another weird bug on the test.sagenb.org now, which I didn't
get before. When I type in (say) 2+2, and do Shift-Enter, it behaves
like "Enter" (I get a new line in the cell), and nothing evaluates.
Just the green bar. Even using the 'evaluate' link has this
problem. You know what browser I have ;0

On a possibly unrelated note, sagenb.org has over 300 users right
now. Big spike. Which I got by evaluating things on that server, and
didn't get that problem above :)

Good night.

- kcrisman

Jason Grout

unread,
Oct 16, 2011, 12:16:12 AM10/16/11
to sage-n...@googlegroups.com
On 10/15/11 10:36 PM, kcrisman wrote:
>> It's great. It did expose a bug, though. When I look at your worksheet
>> and then do "save and quit" it tries to send me to your home page
>> instead of mine, so I get a message like:
>>
>> User 'jason.grout' does not have permission to view the home page of
>> 'kcrisman'.
>
> I get that too.

I'm working on it. Mike or Rado: any idea where this redirection is
happening? I thought it was in the worksheet command decorators, but
I'm having a hard time seeing exactly where a redirection is happening.


>
> I have another weird bug on the test.sagenb.org now, which I didn't
> get before. When I type in (say) 2+2, and do Shift-Enter, it behaves
> like "Enter" (I get a new line in the cell), and nothing evaluates.
> Just the green bar. Even using the 'evaluate' link has this
> problem. You know what browser I have ;0

I think you have javascript problems with that browser ;). Safari 5.1.1
behaves just fine for me. Weird. What happens with Firefox?

I just pushed another bugfix and some more fixes to the new twisted 11
that test.sagenb.org is running. The culmination is that twist.py is
now *deleted* and everything is moved out to other files.


>
> On a possibly unrelated note, sagenb.org has over 300 users right
> now. Big spike. Which I got by evaluating things on that server, and
> didn't get that problem above :)

Interesting. How do you know it has over 300 users? I see from the
server admin script that it has 269 worksheets (I think that means
simultaneous active worksheets).

Jason

P Purkayastha

unread,
Oct 16, 2011, 2:23:57 AM10/16/11
to sage-n...@googlegroups.com
"Worksheet View" "Plain View" "Text"  to 
"Default View" "Edit Raw Text" "Text"

How about this? It should also take up the same amount of space that it took earlier :P

I shared a worksheet with you and then edited the worksheet and shared it again with you and jason. If you are able to see the edited version then let me know :)

P Purkayastha

unread,
Oct 16, 2011, 2:32:23 AM10/16/11
to sage-n...@googlegroups.com
3D seems to be broken. I get the following error in jmol:
"No atoms found
for file string
type Xyz"

Dima Pasechnik

unread,
Oct 16, 2011, 3:06:56 AM10/16/11
to sage-n...@googlegroups.com
works for me (on safari too). Could be just a temporary server overload.

P Purkayastha

unread,
Oct 16, 2011, 8:18:39 AM10/16/11
to sage-n...@googlegroups.com


On Sunday, October 16, 2011 3:06:56 PM UTC+8, Dima Pasechnik wrote:
works for me (on safari too). Could be just a temporary server overload.

Doesn't work on firefox-7.0.1, opera-11.51, and opera-12-alpha on my 64bit linux. On this same installation my local sage + jmol works fine. Also, it seems the jmol in test.sagenb is the older version. I remember there being a newer version of jmol on test.sagenb which had a menu with extra controls on the right.

But jmol in test.sagenb works on a 32-bit linux installation + firefox-5 and opera-11.51 in Virtualbox.

P Purkayastha

unread,
Oct 17, 2011, 7:23:18 AM10/17/11
to sage-n...@googlegroups.com
There is one problem with the flask notebook (even with rkirov-flask and also with the one in test.sagenb) that I should mention: it no longer says whether a worksheet is currently running or not. In the older version of the notebook, it says (Running) if a worksheet is currently open.

Jason Grout

unread,
Oct 17, 2011, 12:14:20 PM10/17/11
to sage-n...@googlegroups.com
On 10/16/11 1:23 AM, P Purkayastha wrote:

>
> +++
>
> Also, I'm not sure about the new names for the editing things.
>
> Worksheet View Plain View Text
>
> I'm not sure which of these is which. I mean, I figured it out by
> trying, but it's not at all obvious to someone used to the previous
> version. The "Worksheet View" will be confusing - maybe "default", or
> whatever it was before? And the other two are particularly weird
> because clicking on "Text" yields something that says "View plain
> text", which is two different uses of "plain", I would say.
>
> - kcrisman
>
>
> "Worksheet View" "Plain View" "Text" to
> "Default View" "Edit Raw Text" "Text"
>
> How about this? It should also take up the same amount of space that it
> took earlier :P

I say we revert the text to what it has been and have this discussion
after we get this first flask notebook release out the door. Again, the
focus for right now is actually getting a bug/regression-free (as much
as we can) functionally-equivalent flask notebook into Sage.

>
> I shared a worksheet with you and then edited the worksheet and shared
> it again with you and jason. If you are able to see the edited version
> then let me know :)


I can see it, and it says you edited it at the top. So apparently it works.

Thanks,

Jason

Jason Grout

unread,
Oct 17, 2011, 12:17:07 PM10/17/11
to sage-n...@googlegroups.com
On 10/16/11 7:18 AM, P Purkayastha wrote:
>
>
> On Sunday, October 16, 2011 3:06:56 PM UTC+8, Dima Pasechnik wrote:
>
> works for me (on safari too). Could be just a temporary server overload.
>
>
> Doesn't work on firefox-7.0.1, opera-11.51, and opera-12-alpha on my
> 64bit linux. On this same installation my local sage + jmol works fine.
> Also, it seems the jmol in test.sagenb is the older version. I remember
> there being a newer version of jmol on test.sagenb which had a menu with
> extra controls on the right.

I've reverted the new version of JMOL until we first accomplish the goal
of getting a regression-free replacement flask notebook into Sage. Then
the JMOL and MathJax patches get top priority.

So the relevant question is: does the current test.sagenb.org not do
something that the current notebook in sage 4.7.1 does do?

Thanks,

Jason

Jason Grout

unread,
Oct 17, 2011, 12:38:30 PM10/17/11
to sage-n...@googlegroups.com
On 10/17/11 11:14 AM, Jason Grout wrote:
> I say we revert the text to what it has been and have this discussion
> after we get this first flask notebook release out the door. Again, the
> focus for right now is actually getting a bug/regression-free (as much
> as we can) functionally-equivalent flask notebook into Sage.

Okay, I've reverted the text to what is in the old notebook (except I
left the Undo->Revisions change since there didn't seem to be any
problem with it). I've updated test.sagenb.org with this change.

Again, let's have the renaming design discussion after we get the flask
notebook released.

Thanks,

Jason

Jason Grout

unread,
Oct 17, 2011, 12:40:51 PM10/17/11
to sage-n...@googlegroups.com
On 10/15/11 11:16 PM, Jason Grout wrote:
> I'm working on it. Mike or Rado: any idea where this redirection is
> happening? I thought it was in the worksheet command decorators, but
> I'm having a hard time seeing exactly where a redirection is happening.

I fixed this, just FYI. The problem was that the worksheet owner and
the current user was being confused in the javascript. See
http://code.google.com/r/jasongrout-flask-sagenb/source/detail?r=5dbf782794f4f3eb18ea1837b27964d8b41028f4

Thanks,

Jason

Jason Grout

unread,
Oct 17, 2011, 3:07:17 PM10/17/11
to sage-n...@googlegroups.com

I think I've fixed this. Can you test it?

FYI, the commit is:
http://code.google.com/r/jasongrout-flask-sagenb/source/detail?r=b25111ba199ef827560a01b547edde60b32cb946

Thanks,

Jason

Jason Grout

unread,
Oct 17, 2011, 3:41:06 PM10/17/11
to sage-n...@googlegroups.com
On 10/15/11 5:06 PM, Jason Grout wrote:
> I think we've fixed the last few regressions in the flask notebook [1].
> In particular, it is possible to see the worksheets that were shared
> with you again.
>
> I've updated test.sagenb.org with the latest version. Please test the
> daylights out of it, or point out any more regressions. If you are so
> inclined, please glance at the latest commits at
>
> http://code.google.com/r/jasongrout-flask-sagenb/source/list
>
> or install it yourself by following the instructions at:
>
> http://code.google.com/r/jasongrout-flask-sagenb/
>
> There is one last point that needs to be addressed. The sharing
> worksheets thing needs to update some information a single time from the
> list of shared worksheets (i.e., it needs to record the shared sheets in
> the User object of each person that the sheet is shared with). Is there
> an easy way to run a function the first time a notebook without this
> information is opened to migrate that information?

I tried to doctest the notebook files and got a number of
UndefinedErrors from using gettext in the template files. Does anyone
know what is going on here?

File
"/Users/grout/projects/sagenb-googlecode/sagenb/notebook/notebook.py",
line 1638:
sage: nb.html(W.filename(), 'admin')
Exception raised:
Traceback (most recent call last):
File "/Users/grout/sage/local/bin/ncadoctest.py", line 1231, in
run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/grout/sage/local/bin/sagedoctest.py", line 38, in
run_one_example
OrigDocTestRunner.run_one_example(self, test, example,
filename, compileflags)
File "/Users/grout/sage/local/bin/ncadoctest.py", line 1172, in
run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_44[4]>", line 1, in <module>
nb.html(W.filename(), 'admin')###line 1638:
sage: nb.html(W.filename(), 'admin')
File
"/Users/grout/projects/sagenb-googlecode/sagenb/notebook/notebook.py",
line 1666, in html
username = username)
File
"/Users/grout/projects/sagenb-googlecode/sagenb/notebook/template.py",
line 154, in template
r = tmpl.render(**context)
File
"/Users/grout/sage/local/lib/python2.6/site-packages/Jinja2-2.5.5-py2.6.egg/jinja2/environment.py",
line 891, in render
return self.environment.handle_exception(exc_info, True)
File
"/Users/grout/projects/sagenb-googlecode/sagenb/data/sage/html/notebook/worksheet_page.html",
line 1, in top-level template code
{% extends "html/notebook/base.html" %}
File
"/Users/grout/projects/sagenb-googlecode/sagenb/data/sage/html/notebook/base.html",
line 11, in top-level template code
{% set system_names = worksheet.notebook().system_names() %}
File
"/Users/grout/projects/sagenb-googlecode/sagenb/data/sage/html/base_authenticated.html",
line 1, in top-level template code
{% extends "html/base.html" %}
File
"/Users/grout/projects/sagenb-googlecode/sagenb/data/sage/html/base.html",
line 26, in top-level template code
{% block body %}
File
"/Users/grout/projects/sagenb-googlecode/sagenb/data/sage/html/base.html",
line 28, in block "body"
{% block header %}
File
"/Users/grout/projects/sagenb-googlecode/sagenb/data/sage/html/base.html",
line 32, in block "header"
<img align="top" src="/images/sagenb.png" alt="Sage" /><span>{{
gettext('The Sage Notebook') }}</span>
UndefinedError: 'gettext' is undefined

Thanks,

Jason

Dima Pasechnik

unread,
Oct 17, 2011, 3:51:20 PM10/17/11
to sage-n...@googlegroups.com
I have reported a very similar problem in the thread on twisted-11.

kcrisman

unread,
Oct 17, 2011, 3:51:28 PM10/17/11
to sage-notebook
> > There is one problem with the flask notebook (even with rkirov-flask and
> > also with the one in test.sagenb) that I should mention: it no longer
> > says whether a worksheet is currently running or not. In the older
> > version of the notebook, it says (Running) if a worksheet is currently open.
>
> I think I've fixed this.  Can you test it?
>

Yeah, this seems to work now.

Also, ppurka did "I added this text cell after sharing. Does it show
up?" - yes, ppurka, it does!

Getting closer - thanks SO much for this work, Jason, esp. the
emphasis on "get the flask/optimized NB in, not with all the bells and
whistles". Once it's in, it will be much easier for `οι πολλοι to
actually fiddle with things.

- kcrisman

Jason Grout

unread,
Oct 17, 2011, 4:11:34 PM10/17/11
to sage-n...@googlegroups.com
On 10/17/11 2:51 PM, Dima Pasechnik wrote:
> I have reported a very similar problem in the thread on twisted-11.

Ah. I knew I saw this problem somewhere, but couldn't find it.

Mike (Hansen), do you know what is going on?

Thanks,

Jason

Jason Grout

unread,
Oct 17, 2011, 4:27:51 PM10/17/11
to sage-n...@googlegroups.com

In template.py, the context passed to the template rendering function
looks like:

default_context = {'sitename': gettext('Sage Notebook'),
'sage_version': SAGE_VERSION,
'JSMATH': JSMATH,
#'gettext': lambda x: x,
'JEDITABLE_TINYMCE': JEDITABLE_TINYMCE,
'conf': notebook.conf() if notebook else None}

Notice that gettext is commented out! It's weird that this doesn't
cause a problem in the actual running of a notebook. If I change that
gettext line to:

'gettext': gettext,

then all of the gettext errors go away.

So my new question is: how come templates seem to work fine in the
actual notebook if that gettext line is commented out?

Thanks,

Jason


P Purkayastha

unread,
Oct 18, 2011, 1:06:59 AM10/18/11
to sage-n...@googlegroups.com
Thanks a lot Jason! It works nice.

Jason Grout

unread,
Oct 18, 2011, 4:18:55 AM10/18/11
to sage-n...@googlegroups.com
On 10/15/11 5:06 PM, Jason Grout wrote:
> I think we've fixed the last few regressions in the flask notebook [1].

Okay, I think everything that people brought up here has been fixed and
uploaded to test.sagenb.org. I've posted a message to sage-devel asking
for wider testing. Let's continue this conversation over on sage-devel.

Thanks,

Jason

Dima Pasechnik

unread,
Oct 18, 2011, 4:37:56 AM10/18/11
to sage-n...@googlegroups.com
Rado is saying that he started seeing these things after the change done here:

http://code.google.com/r/rkirov-flask/source/detail?r=87c1e74824ea1041a85e4a27b31e611597a19628


and he approves of your 
"gettext" : gettext
hack.

Jason Grout

unread,
Oct 18, 2011, 4:59:56 AM10/18/11
to sage-n...@googlegroups.com

Yes, thanks. I talked with him via google chat and got the same
message. I'm glad you posted it here in the open.

Thanks,

Jason

Reply all
Reply to author
Forward
0 new messages