Re: [sage-devel] Re: Sage OSX Clickable App

2010-06-21 Thread Ivan Andrus
On Jun 21, 2010, at 8:34 AM, kcrisman wrote:
>> Okay, I created a simple application (none of the copyright is set for 
>> example) that does the following:
>> 
>> 1. On launch it runs sage -notebook (which will open the default browser 
>> etc. (unless there is a server running))
> 
> This would be if one had it in (say) /Applications and double-clicked
> a Sage icon?

Yes.

>> 2. It only appears as a menu extra which allows opening notebooks, the log, 
>> and several shell sessions (am I missing anything -- reveal SAGE_ROOT in 
>> Finder perhaps?).
> 
> I'm not sure exactly what this means.  I see the screenshot... but
> does that mean it doesn't appear in the Dock?  This seems
> counterintuitive to me; for instance, ideally one should be able to
> drag and drop a .sws file onto it (eventually, not immediately).

It doesn't show up in the dock.  That's easy to change though, it's just a 
little weird since I haven't hooked up any menus etc.  To change it, edit 
SageMenu-Info.plist (e.g. in Xcode under Resources), and change "Application is 
agent (UIElement)" to be unchecked.

> I really like the many options, though, and opening SAGE_ROOT in the
> Finder would be quite useful.

Okay, I'll add that when I have some time.  Any other suggestions?

>> 3. On quit it stops the server (should there be an option to quit without 
>> stopping the server?).
> 
> Probably not at this point.  It's supposed to be for those not
> interested in the command line, though of course usable by all.

That's kind of what I was thinking.

>> If you want to try it, I have put it up 
>> athttp://math.byu.edu/~gvol/files/SageMenu.zip
>> and a screen shot athttp://math.byu.edu/~gvol/files/sage-menu-screenshot.png
>> 
>> For testing purposes it creates a symlink in Contents/Resources/ to a local 
>> sage root directory.  In the distributed version I imagine that the sage 
>> root would reside there (like it does in the app created currently).  
>> Because of this, if you have problems running, it may be that sage is not in 
>> your path.  If this is the case then you will need to edit  Targets > 
>> SageMenu > Run Script  and change the default sage root directory.
>> 
>> Right now I created it completely outside of Sage, but I can of course 
>> replace the app that is in Sage, or add this in addition.  Does anyone 
>> prefer the application that is currently created?  Obviously sage -bdist 
>> will have to be changed as well, but that shouldn't be hard.
> 
> I will at least test it out... I think that having something that
> 'looks' as much like other math software does in Mac (including Mac-
> native Grapher) is important.  Right now, even if I put the contents
> of SageMenu in an app bundle (inside of Contents/Resources) it doesn't
> want to start (perhaps not surprisingly, since there isn't a MacOS
> directory?). Do the menu items have a different folder structure?

Oh sorry, I forgot to mention the very important point that it's only the 
source.  I didn't want to worry about creating a universal binary, 32 vs 64 bit 
etc.  Open the SageMenu.xcodeproj in Xcode and click the Build & Run button.  I 
always forget some "minor detail", sorry.

-Ivan

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


Re: [sage-devel] Re: Sage OSX Clickable App

2010-06-20 Thread Ivan Andrus
On Jun 10, 2010, at 11:08 AM, William Stein wrote:
> On Thu, Jun 10, 2010 at 8:07 AM, Robert Bradshaw
>  wrote:
>> On Jun 9, 2010, at 11:53 PM, Georg S. Weber wrote:
>>> On 10 Jun., 02:37, Jason Grout  wrote:
 
 Karl-Dieter just showed me how to get the OSX App built using sage
 -bdist:
 
 export SAGE_APP_BUNDLE=yes
 sage -bdist 4.4.2-app
 
 There are people I know that would *love* to have a clickable app on
 OSX.  Why do we not have this as a download option on the webpage?
>>> 
>>> As far as I remember, there was no consensus reached as to *what
>>> exactly* should happen if you "just click" on some Sage App Icon. As
>>> of now, there are at least three different possibilities:
>>> 
>>> a.) A "Sage shell" opens, i.e. a terminal that is already cd'ed to
>>> $SAGE_ROOT and "./sage -sh" is executed.
>>> b.) A "Sage interpreter" opens, i.e. a terminal that is already cd'ed
>>> to $SAGE_ROOT and  "./sage" is executed.
>>> c.) A "Sage notebook" opens, i.e. a terminal that is already cd'ed to
>>> $SAGE_ROOT and  "./sage -notebook" is executed.
>> 
>> I think for the vast majority of people wanting a double-clickable app
>> rather than the command line, (c) would be the way to go. The tricky part is
>> how to quit.
>> 
> 
> Many of us use OS X, so let's just assume we can program anything if
> we want.  What would be the best UI for Sage?
> 
> The first thing that pops into my mind is that Sage runs as some sort
> of server, kind of like say DropBox or any of the many other programs
> running with an icon in the bar at the top of the screen.   So I
> imagine that when one double clicks on the Sage icon,
> 
>   (1) the default browser opens with the Sage notebook running,
>   (2) a small Sage icon appears in the bar at the top of the screen.
>   (3) When clicked, the Sage icon in the bar has at least two options:
>  - Sage Notebook (which just opens the browser to the
> notebook server)
>  - Quit (which quits the Sage notebook server and makes
> the icon vanish)
> 
> It could (but probably shouldn't) also have some slightly more advanced 
> options:
>  - Log (pop up a Terminal window with "tail -f" on the
> notebook server log)
>  - Kill all running Sage sessions
> 
> This is basically how I use the Sage notebook on my laptop anyways,
> but with the bar/icon above replaced by a screen session.
> 
> Regarding (1), the notebook itself could be slightly modified to
> provide a reminder to the user about how to control the notebook
> server.

Okay, I created a simple application (none of the copyright is set for example) 
that does the following:

1. On launch it runs sage -notebook (which will open the default browser etc. 
(unless there is a server running))
2. It only appears as a menu extra which allows opening notebooks, the log, and 
several shell sessions (am I missing anything -- reveal SAGE_ROOT in Finder 
perhaps?).
3. On quit it stops the server (should there be an option to quit without 
stopping the server?).

If you want to try it, I have put it up at
http://math.byu.edu/~gvol/files/SageMenu.zip
and a screen shot at
http://math.byu.edu/~gvol/files/sage-menu-screenshot.png

For testing purposes it creates a symlink in Contents/Resources/ to a local 
sage root directory.  In the distributed version I imagine that the sage root 
would reside there (like it does in the app created currently).  Because of 
this, if you have problems running, it may be that sage is not in your path.  
If this is the case then you will need to edit  Targets > SageMenu > Run Script 
 and change the default sage root directory.

Right now I created it completely outside of Sage, but I can of course replace 
the app that is in Sage, or add this in addition.  Does anyone prefer the 
application that is currently created?  Obviously sage -bdist will have to be 
changed as well, but that shouldn't be hard.

I'm not a Cocoa expert by any means, so if someone knows how to improve things 
please let me know and/or send patches.  One thing that I would like it to do 
is turn red while the server is starting (is there a good way to detect this?).

Also, is there a way to do something like the following:
./sage -browse http://localhost:8000/
What I'm doing is
sage -c 'import sage.misc.viewer as b; os.system(b.browser() + " 
http://localhost:8000/";)'

Phew.  I don't know why my emails always turn out to be novels.

-Ivan

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


Re: [sage-devel] Re: Sage OSX Clickable App

2010-06-10 Thread Ivan Andrus
On Thu, Jun 10, 2010 at 11:48 PM, Ivan Andrus  wrote:

>
> I don't think that's actually the case.  If the disk image we
> distribute is HFS+ it should allow us to hard link directories so that
> each application can have it's own copy of the sage directory, without
> any real duplication (and we can have a copy at the top level as
> well).  Once you copy it onto your own disk the links will probably be
> broken though, which could be bad.  I wonder if zip files can preserve
> hard linked directories...


I spoke too soon.  I knew Time Machine uses hardlinks to directories, and I
assumed users could as well.  According to
http://stackoverflow.com/questions/1432540/creating-directory-hard-links-in-macos-x
that is not true in Snow Leopard, and not true from the shell in Leopard.

Nevertheless there must be some suitably clever way to get the same outcome.

-Ivan

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


Re: [sage-devel] Re: Sage OSX Clickable App

2010-06-10 Thread Ivan Andrus
On 6/10/10, William Stein  wrote:
> On Thu, Jun 10, 2010 at 8:07 AM, Robert Bradshaw
>  wrote:
>> On Jun 9, 2010, at 11:53 PM, Georg S. Weber wrote:
>>
>>> On 10 Jun., 02:37, Jason Grout  wrote:

 Karl-Dieter just showed me how to get the OSX App built using sage
 -bdist:

 export SAGE_APP_BUNDLE=yes
 sage -bdist 4.4.2-app

 There are people I know that would *love* to have a clickable app on
 OSX.  Why do we not have this as a download option on the webpage?
>>>
>>> As far as I remember, there was no consensus reached as to *what
>>> exactly* should happen if you "just click" on some Sage App Icon. As
>>> of now, there are at least three different possibilities:
>>>
>>> a.) A "Sage shell" opens, i.e. a terminal that is already cd'ed to
>>> $SAGE_ROOT and "./sage -sh" is executed.
>>> b.) A "Sage interpreter" opens, i.e. a terminal that is already cd'ed
>>> to $SAGE_ROOT and  "./sage" is executed.
>>> c.) A "Sage notebook" opens, i.e. a terminal that is already cd'ed to
>>> $SAGE_ROOT and  "./sage -notebook" is executed.
>>
>> I think for the vast majority of people wanting a double-clickable app
>> rather than the command line, (c) would be the way to go. The tricky part
>> is
>> how to quit.

Honestly I can't see much use for a or b, especially since if you want
to use the command line, you probably don't need us to hold your hand,
and you probably aren't using Terminal.app anyway.

What we have now is basically option c except that it opens a separate
application instead of a terminal, so that quitting does the right
thing.

> Many of us use OS X, so let's just assume we can program anything if
> we want.  What would be the best UI for Sage?
>
> The first thing that pops into my mind is that Sage runs as some sort
> of server, kind of like say DropBox or any of the many other programs
> running with an icon in the bar at the top of the screen.   So I
> imagine that when one double clicks on the Sage icon,
>
>(1) the default browser opens with the Sage notebook running,
>(2) a small Sage icon appears in the bar at the top of the screen.
>(3) When clicked, the Sage icon in the bar has at least two options:
>   - Sage Notebook (which just opens the browser to the
> notebook server)
>   - Quit (which quits the Sage notebook server and makes
> the icon vanish)
>
> It could (but probably shouldn't) also have some slightly more advanced
> options:
>   - Log (pop up a Terminal window with "tail -f" on the
> notebook server log)
>   - Kill all running Sage sessions
>
> This is basically how I use the Sage notebook on my laptop anyways,
> but with the bar/icon above replaced by a screen session.

Interesting.  My initial reaction is I have too many menu extras
already, but it does seem like a natural way to control a server.  I
think that at least for new users, however, something that acts as
much like a normal application as possible is desirable.

I think I am probably the only one who wants Sage to actually
be/have/use a separate browser so that it's easy to Cmd-TAB to, quit
etc.

>>> If one "exit"s, in all three cases any window etc. should be closed,
>>> so no "CTRL-C" the terminal after leaving the notebook etc. I'd really
>>> love to have some "true" Sage App" on OS X, i.e. having a status line
>>> that shows me which terminals are open, which notebook server(s) are
>>> running, and all this --- but that is a dream yet.

I think there was some talk of this recently, but I don't know what
became of it.  That seems to be recurring theme with OS X Sage
applications.  No decision or real progress gets made.  I think we
should start distributing what's there right now (perhaps as a
separate download) and start getting some feedback (release early,
release often).  It should be easy to add features such as opening sws
files later.  We can also include the source for the platypus-created
binary and modify that or replace it entirely if desired.  We can also
make a menu extra and see which people like (or have both).

>>> BTW.: If one makes a duplicate of the "sage" script in $SAGE_ROOT and
>>> renames it to "sage.tool", then it *is* clickable under OS X without
>>> the fuzzing around described in the OS X Readme.txt. I was already
>>> thinking about a ticket adding three scripts "sage-shell.tool", "sage-
>>> interpreter.tool" and "sage-notebook.tool" on OS X, but didn't get
>>> around to do so. I mean, personally I mostly use the "Sage
>>> shell" ("Sash" ?!?) and then do "sage -br", "exit", edit, "sage -br"
>>> etc. If there were someone to somehow add buttons to do *that*, I'd
>>> appreciate it ... but nobody has volunteered yet to even think about a
>>> really graphical "user experience". Let alone some graphical
>>> "developer experience" for Sage; AFAIK, most sage-devel people seem to
>>> be rather fine to use emacs, vim, ... instead of the likes of Eclipse,
>>> XCode, VisualStudio, ... (just like me, I use plain 

Re: [sage-devel] Re: Sage OSX Clickable App

2010-06-10 Thread William Stein
On Thu, Jun 10, 2010 at 8:07 AM, Robert Bradshaw
 wrote:
> On Jun 9, 2010, at 11:53 PM, Georg S. Weber wrote:
>
>> On 10 Jun., 02:37, Jason Grout  wrote:
>>>
>>> Karl-Dieter just showed me how to get the OSX App built using sage
>>> -bdist:
>>>
>>> export SAGE_APP_BUNDLE=yes
>>> sage -bdist 4.4.2-app
>>>
>>> There are people I know that would *love* to have a clickable app on
>>> OSX.  Why do we not have this as a download option on the webpage?
>>
>> As far as I remember, there was no consensus reached as to *what
>> exactly* should happen if you "just click" on some Sage App Icon. As
>> of now, there are at least three different possibilities:
>>
>> a.) A "Sage shell" opens, i.e. a terminal that is already cd'ed to
>> $SAGE_ROOT and "./sage -sh" is executed.
>> b.) A "Sage interpreter" opens, i.e. a terminal that is already cd'ed
>> to $SAGE_ROOT and  "./sage" is executed.
>> c.) A "Sage notebook" opens, i.e. a terminal that is already cd'ed to
>> $SAGE_ROOT and  "./sage -notebook" is executed.
>
> I think for the vast majority of people wanting a double-clickable app
> rather than the command line, (c) would be the way to go. The tricky part is
> how to quit.
>

Many of us use OS X, so let's just assume we can program anything if
we want.  What would be the best UI for Sage?

The first thing that pops into my mind is that Sage runs as some sort
of server, kind of like say DropBox or any of the many other programs
running with an icon in the bar at the top of the screen.   So I
imagine that when one double clicks on the Sage icon,

   (1) the default browser opens with the Sage notebook running,
   (2) a small Sage icon appears in the bar at the top of the screen.
   (3) When clicked, the Sage icon in the bar has at least two options:
  - Sage Notebook (which just opens the browser to the
notebook server)
  - Quit (which quits the Sage notebook server and makes
the icon vanish)

It could (but probably shouldn't) also have some slightly more advanced options:
  - Log (pop up a Terminal window with "tail -f" on the
notebook server log)
  - Kill all running Sage sessions

This is basically how I use the Sage notebook on my laptop anyways,
but with the bar/icon above replaced by a screen session.

Regarding (1), the notebook itself could be slightly modified to
provide a reminder to the user about how to control the notebook
server.

 -- William


>> If one "exit"s, in all three cases any window etc. should be closed,
>> so no "CTRL-C" the terminal after leaving the notebook etc. I'd really
>> love to have some "true" Sage App" on OS X, i.e. having a status line
>> that shows me which terminals are open, which notebook server(s) are
>> running, and all this --- but that is a dream yet.
>>
>> BTW.: If one makes a duplicate of the "sage" script in $SAGE_ROOT and
>> renames it to "sage.tool", then it *is* clickable under OS X without
>> the fuzzing around described in the OS X Readme.txt. I was already
>> thinking about a ticket adding three scripts "sage-shell.tool", "sage-
>> interpreter.tool" and "sage-notebook.tool" on OS X, but didn't get
>> around to do so. I mean, personally I mostly use the "Sage
>> shell" ("Sash" ?!?) and then do "sage -br", "exit", edit, "sage -br"
>> etc. If there were someone to somehow add buttons to do *that*, I'd
>> appreciate it ... but nobody has volunteered yet to even think about a
>> really graphical "user experience". Let alone some graphical
>> "developer experience" for Sage; AFAIK, most sage-devel people seem to
>> be rather fine to use emacs, vim, ... instead of the likes of Eclipse,
>> XCode, VisualStudio, ... (just like me, I use plain jEdit for coding)
>>
>> Back to the "Sage App" ticket(s)/patch(es). One problem is, that there
>> would be only one icon left on the desktop/in the program folder (like
>> e.g. for Firefox), i.e. one has (at least in the current absence of a
>> "full-scale" Sage App) to make a choice among a.), b.) c.)  --- but
>> then more or less one has to stick with that choice, because you can
>> no longer (easily) browse the directory, or do some different of the
>> three "with one click". Of course there is the possibility to always
>> to "./sage -sh" and let implicitly make that choice by ".sagerc" in
>> the users home dir --- but that is *very* Linuxish. And we wanted to
>> enhance the OS X user experience!
>> I don't really have made up my mind yet. But I'm happy to participate
>> in a discussion!
>>
>>
>> Cheers,
>> Georg
>>
>>>
>>> Thanks,
>>>
>>> Jason
>>
>> --
>> To post to this group, send an email to sage-devel@googlegroups.com
>> To unsubscribe from this group, send an email to
>> sage-devel+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/sage-devel
>> URL: http://www.sagemath.org
>
> --
> To post to this group, send an email to sage-devel@googlegroups.com
> To unsubscribe from this group, send an email to
> sage-devel+unsubscr...@goo

Re: [sage-devel] Re: Sage OSX Clickable App

2010-06-10 Thread Robert Bradshaw

On Jun 9, 2010, at 11:53 PM, Georg S. Weber wrote:


On 10 Jun., 02:37, Jason Grout  wrote:
Karl-Dieter just showed me how to get the OSX App built using sage - 
bdist:


export SAGE_APP_BUNDLE=yes
sage -bdist 4.4.2-app

There are people I know that would *love* to have a clickable app on
OSX.  Why do we not have this as a download option on the webpage?


As far as I remember, there was no consensus reached as to *what
exactly* should happen if you "just click" on some Sage App Icon. As
of now, there are at least three different possibilities:

a.) A "Sage shell" opens, i.e. a terminal that is already cd'ed to
$SAGE_ROOT and "./sage -sh" is executed.
b.) A "Sage interpreter" opens, i.e. a terminal that is already cd'ed
to $SAGE_ROOT and  "./sage" is executed.
c.) A "Sage notebook" opens, i.e. a terminal that is already cd'ed to
$SAGE_ROOT and  "./sage -notebook" is executed.


I think for the vast majority of people wanting a double-clickable app  
rather than the command line, (c) would be the way to go. The tricky  
part is how to quit.



If one "exit"s, in all three cases any window etc. should be closed,
so no "CTRL-C" the terminal after leaving the notebook etc. I'd really
love to have some "true" Sage App" on OS X, i.e. having a status line
that shows me which terminals are open, which notebook server(s) are
running, and all this --- but that is a dream yet.

BTW.: If one makes a duplicate of the "sage" script in $SAGE_ROOT and
renames it to "sage.tool", then it *is* clickable under OS X without
the fuzzing around described in the OS X Readme.txt. I was already
thinking about a ticket adding three scripts "sage-shell.tool", "sage-
interpreter.tool" and "sage-notebook.tool" on OS X, but didn't get
around to do so. I mean, personally I mostly use the "Sage
shell" ("Sash" ?!?) and then do "sage -br", "exit", edit, "sage -br"
etc. If there were someone to somehow add buttons to do *that*, I'd
appreciate it ... but nobody has volunteered yet to even think about a
really graphical "user experience". Let alone some graphical
"developer experience" for Sage; AFAIK, most sage-devel people seem to
be rather fine to use emacs, vim, ... instead of the likes of Eclipse,
XCode, VisualStudio, ... (just like me, I use plain jEdit for coding)

Back to the "Sage App" ticket(s)/patch(es). One problem is, that there
would be only one icon left on the desktop/in the program folder (like
e.g. for Firefox), i.e. one has (at least in the current absence of a
"full-scale" Sage App) to make a choice among a.), b.) c.)  --- but
then more or less one has to stick with that choice, because you can
no longer (easily) browse the directory, or do some different of the
three "with one click". Of course there is the possibility to always
to "./sage -sh" and let implicitly make that choice by ".sagerc" in
the users home dir --- but that is *very* Linuxish. And we wanted to
enhance the OS X user experience!
I don't really have made up my mind yet. But I'm happy to participate
in a discussion!


Cheers,
Georg



Thanks,

Jason


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


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