I was looking at this and the explanation in the bug seems a little
complicated.
One can create a project (of almost any kind) in Xcode and build it. I
called mine "sage" and got a "sage.app" from the build. Delete the
Resources directory. Take a /bin/sh script that calls "open -f
Terminal.app $location/sage" and move it to sage.app/Contents/MacOS/
sage.
This turns "sage.app" into a double-clickable app that launches sage
and shuts down.
The icon is just gravy.
- ray
I don't know if we could make Platypus <http://www.sveinbjorn.org/platypus
> part of the build process, but it's very nice and can easily
integrate into a command-line build process. It creates the bundle
and everything for you. It's GPL, if it helps. I would have
suggested this a lot sooner, but just starting the sage server isn't
that exciting to me. What I want is a dedicated application (like the
Macaulay front end), but one that opens a browser window instead of a
terminal.
What I use is a hacked up version of a Site Specific Browser created
with Fluid <http://fluidapp.com/> that starts the server in the
background and opens a browser window. Unfortunately, Fluid is closed
source, but something like Prism might work. It's been a while since
I looked at Prism, so it might suck less now. I could never even
figure out how to begin to build it (and the forums were no help
despite several people asking the same question--Argh!). Anyway, if I
have some time (not likely in the near future) I will look into a
Prism application, or creating an SSB from scratch to use with sage.
It really shouldn't be that hard, but my Cocoa skills aren't that
great. Either that or I might try and add browser windows to Platypus.
-Ivan
> Anyway, it sounds like what mabshoff really needs is just the best
> tarball possible to then be able to drop a Sage build into for a fully
> functional .app bundle. If that was created just once with Platypus
> by someone else, presumably for every new Sage release the new binary
> could just be dropped into the bundle.
Well, you have finally goaded me into doing something :-) I nearly
have a patch, and hopefully I'll post something to trac in the next
few days for review.
I do have one question though. What directory should I put the data
files in (the icon etc.)? My guess would be devel/sage-main/build/,
maybe in a new subdirectory, but I'm still not comfortable enough with
the directory structure to be sure.
-Ivan
P.S. Oops, I sent this from the wrong email address and it doesn't
look like it showed up.
It was the only icon I could find in the (admittedly short) time I
looked. Where could I get the icon (as large as possible)? Also, if
you can tell me what to do with dropped files I could easily add
that. i.e. how does one open a .sage file in the notebook from the
command line. I'm sure it's very simple, I just haven't looked at it
yet. Any other suggestions are welcome as well.
-Ivan
Hmm... there might actually be no way to do that. Just to start
thinking about this, we would need:
(1) a special URL to go to, e.g.,
http://localhost:8000/open_file/absolute_path_to_file_on_local_filesystem.sage
and
(2) a command line option, e.g.,
$ sage foo.sws
would start a notebook server if it isn't already running, and once it
is, would call basically (1) above for the default sage notebook
server running from $DOT_SAGE/sage_notebook.
William
I happen to prefer the orange perspective-cube. Just sayin'...
> And the hope is that now one could much
> more easily make incremental improvements to this skeleton in order to
> support e.g. dropping .sws or .sage files on it.
This sounds like a great idea. I've always liked that in OS X if you
drop a file on a program's icon, it does the obvious thing with it. I'm
sure we can get somethign working.
This is very nice work! I will install this on my Macbook as soon as I
can.
Dan
--
--- Dan Drake <dr...@kaist.edu>
----- KAIST Department of Mathematical Sciences
------- http://mathsci.kaist.ac.kr/~drake
+1
Martin
--
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://www.informatik.uni-bremen.de/~malb
_jab: martinr...@jabber.ccc.de
This would open the file dialog in my browser, right? AFAIK websites can't
just open local files and they shouldn't:
"""
Dear Sage user,
just click on this link to see a proof of the Riemann hypothesis done in Sage:
http://localhost:8000/open_file/etc/passwd
"""
Cheers,
Yes.
> AFAIK websites can't
> just open local files and they shouldn't:
Since this is localhost this is trivial to do. I don't understand why
you think it wouldn't be????
>
> """
> Dear Sage user,
>
> just click on this link to see a proof of the Riemann hypothesis done in Sage:
>
> http://localhost:8000/open_file/etc/passwd
> """
So? You could also type
os.system('cat /etc/passwd')
in any notebook cell and cell exactly the same thing.
-- William
Sorry, I meant to put some URL that is not localhost.
> os.system('cat /etc/passwd')
>
> in any notebook cell and cell exactly the same thing.
Yeah sure, if we're talking localhost only than everything is almost trivial.
However, the issue still is who's right to open the file are we invoking? The
user's (by letting the browser deal with the file reading/sending or the
server's (by calling open("/etc/passwd")). I think it should be the user's
since the server should not be able to read a user's $HOME if not run by the
user.
Bottomline: everything goes through the browser's file upload dialog anyway
and thus we don't have to worry about security implications.
So there would be a flag like SAGE_IMREALLYREALLYLOCAL which indicates that
the user who's using Sage is in fact the same person who started it? We don't
want to trigger reading files and such as a response to a simple HTTP GET
(think phishing and stuff) for server's which are not 100% local use only.
Well we could not have the option at all if the server isn't only
serving on localhost.
Thanks for pointing out this security implication.
William