#11026: Add double clicking of sws files for Mac app
----------------------------------+-----------------------------------------
Reporter: iandrus | Owner: iandrus
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.3
Component: user interface | Resolution:
Keywords: mac app | Work issues:
Report Upstream: N/A | Reviewers: Karl-Dieter Crisman
Authors: Ivan Andrus | Merged in:
Dependencies: #8473, #13121 | Stopgaps:
----------------------------------+-----------------------------------------
Comment (by iandrus):
Replying to [comment:35 kcrisman]:
> On Tiger, I do indeed need to do the universal cross-develop as I think
the readme directs. I get two warnings for implicit declaration of sleep,
and two for webview perhaps not responding to isloading. Whatever?
Actually, this could be part or all of the program. Supposedly the
isLoading method is available on Mac OS X v10.4.11 and later. I do check
whether it's available, and if it's not available I just sleep for 1
second instead of waiting. I think this might cause it to think the
server has started when it really hasn't yet. I assumed it would never
actually happen, since I thought most people would be on 10.4.11. It's
possible that you have a slightly out of date SDK, or just that it issues
the warning. More worrisome to me is the warning for implicit declaration
of sleep, because that means some header didn't get included and then even
the sleep might not work.
You could try adding
{{{
#import <Foundation/Foundation.h>
}}}
to the top of `AppDelegate.m` and see if that fixes the sleep warning.
Anyway all this is related to detection of whether the server is running,
but only if you are using Sage.app as the browser. Now that I think about
it, I don't think you can use Sage.app as the browser on Tiger, so that
shouldn't be the problem.
> On the plus side, the new intro screen is nicer! (I'm doing it with
5.2.beta0 on this computer.) Asks for an executable well.
>
> I'm having trouble even getting previously existing functionality to
work this way, though. I get, for `http://localhost:8000/new_worksheet`,
"Not Found The resource /new_worksheet cannot be found." when doing "New
worksheet" from the Sage menu item, and "Open Notebook" doesn't have the
login. (Though when I initially start the app it does do automatic
login.) I also had the trouble with the Mac app skeleton in the
sage-5.2.beta0 binary conflicting with the one I built.
>
> And now even trouble with the regular login, on clicking on an sws
> {{{
> Safari can’t open the page
“http://localhost:8000/?startup_token=64130e35bb235d83b5337f2a920eae0f”
because Safari can’t connect to the server “localhost”.
> }}}
> and
> {{{
> The resource
/upload_worksheet?url=file://localhost/Users/crisman/Desktop/Untitled.sws
cannot be found.
> }}}
This sounds like the server isn't running, or isn't running correctly.
Maybe it's running on a different port or something?
> But then stopping everything, quitting Sage.app, and restarting (without
double-clicking) gives me the Sage server - at port 8001! And works ok.
But not the stuff on this ticket.
> {{{
> There was an error uploading
'file://localhost/Users/crisman/Desktop/Untitled.sws' (please recheck the
URL). Return to Upload File.
> }}}
> which was from the URL
> {{{
>
http://localhost:8001/upload_worksheet?url=file://localhost/Users/crisman/Desktop/Untitled.sws
> }}}
That sounds like you're using an old version of the sage server. What
version does it say on the Notebook page under the Sage logo in the upper
left?
> I have to admit that because of the above problem with the phantom
Sage.app I had two Sage servers running... so after killing both python
processes, I tried ''again'' and got THREE open windows. One with a
normal worksheet list; one with a login token URL with an error message,
and one with the error message in the browser about an invalid URL for the
upload itself.
> {{{
>
> 2012-07-13 22:32:33-0400 [HTTPChannel,3,127.0.0.1] Exception rendering:
> 2012-07-13 22:32:33-0400 [HTTPChannel,3,127.0.0.1] Unhandled Error
> Traceback (most recent call last):
> Failure: twisted.python.failure.DefaultException: Bad token
>
> }}}
> among other error message in sage.log.
Hmm. I'm not sure what might cause a "Bad token" error.
There is #2935 which might or might not be related. It seems to have
about the same level of weirdness. :-)
There is a work around there. Well, for whatever Jaap's problem was which
is probably not the same problem you are having.
> The more I try, the weirder it gets, including a server running but with
a gray menu icon, more stuff running on port 8001, ... anyway, it's
certainly not behaving consistently, and I have yet to get it to upload a
worksheet on Tiger. It ''could'' all be because of having multiple
Sage.apps, but this is even after I dump the phantom ones (skeleton) in
the Trash.
Just a wild guess, but maybe you have something other than Sage running on
port 8000.
> I could try doing a bdist next and dumping everything else in the Trash,
but that seems a little drastic. Especially since I only have 1.34 GB
left free on the device!
>
> Now, some of these problems turn out to been caused by using the wrong
binary at first. And I did finally upload a file by clicking it! But
some of the issues are still around - gray icon even though there is (at
least one) server running, intro splash screen continuing to show up even
though already running server, using extra ports even after killing
processes, logging in too fast after starting the server - aack! Seems
like even properly shutting down the server and quitting the app don't
remove these extra python2.7 processes, I have to kill them by hand.
I think the main problem is it doesn't detect the running server. That is
what the grey icon means, and it will continue to try starting the server
thereby putting up the splash screen etc. It also won't shut the server
down. So the question is why doesn't it know that a server is started.
If you start a server from the command line and then launch Sage.app does
it recognize it? You can try running `Sage.app/Contents/Resources/sage-
is-running-on-port.sh` by hand to see what it says. Does it even turn
green when tell it to start the server?
> So maybe the warnings about sleep and webview weren't wrong! I could,
as a non-expert, think of interpretations for some of what is happening in
terms of the natural English meaning of those words.
>
> If you have some advice, that would be helpful. We could also
reasonably say "this doesn't work on Tiger reliably", I suppose, because
it's an enhancement, but I don't really see what Tiger has to do with
this.
Tiger doesn't have all of the capabilities of later operating systems.
For example it doesn't work to show up in the Dock (did I document that
somewhere...). So it's conceivable it's a Tiger only issue.
I guess my advice would be to reboot and start completely fresh. Maybe
drink your favorite beverage. :-)
Thanks again for all the testing. I really wish I had access to a 10.4
machine.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11026#comment:36>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
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-trac?hl=en.