[wxPython-mac] Re: [Pythonmac-SIG] Wanted: working example of CFBundleTypeRole Shell

Chris Barker Chris.Barker@noaa.gov
Fri, 08 Mar 2002 15:59:59 -0800


Torsten Sadowski wrote:

> In my opinion is the Mac the only machine without a one-to-one
> file-application association.

Well, *nix has a None-to-one association. Recent Desktops for *nix (KDE,
GNOME) provide an association. KDE uses mime-types, which it tries to
figure out from both the filename and by examining the file itself. A
given mime-type can be associated with any number of applications.

> Every Mac-File has a TYPE and a CREATOR.

Which is a very nifty system, but unfortunately incompatable with other
systems, so when transfering files, we're back to doing something with a
filename. 

> And
> all programs who can deal with a certain type should be able to open that
> file.

sure. Of course, if the type gets contaminated (or is blank), you often
can't open it. That drives me crazy, and Apple has not made it easy for
the non-=programmer to examine or set the types and creators. I don't
ink it's even possible to change it with anything provided with a Mac,
out of the box.

Has Apple come up with some way to preserve the type-creator attributes
for OS-X?

> If you click on a file the prgram with the same creator will be
> opened.

What it that's not what you want? I want to edit rather than run this
Python file this time, other times I want to run it. I certainly don't
want a list of ALL the applications that can read a text file (imagine
that on OS_X, with all the classic text file utilities installed?)
Anyway, we're not designing OS-X's file manager or file system, so this
is not very relevant. The question is how to work with what Apple has
given us.

> There are different
> creators for the IDE and for python, so why not a third creator for
> wxwindows?

I like this idea..would it work for OS-X ?

> The Mac doesn't care for file endings at all.

Until it gets a file from another system that doesn't have a type and
creator, then it has to figure out what to do. I think that's what this
whole discussion is about.

Bill Bedford wrote:

> This is exactly what happens on my mac, if it doen't on your I
> suggest it is because at some time you have changed the creator from
> 'Pyth' to something else.

Or it never had that type to begin with: either it came form another
system, or was created by an editor that isn't python-aware. I find that
I sometimes use the IDE, sometimes BBEdit lite (which used to be able to
set the creator for me, but seems to have lost that capability). The
result is that I nevr click on a Python script, I always drag it onto
the app I want, The IDE, an editor, of the interpretter. This is
sometimes kind of awkward.

Kevin Altis wrote:

> The other problem with .pyc and .pywc (compiled version of .pyw) is that
> those files will not automatically be created unless a module is imported.
> distutils will automatically create compiled (.pyc) and optimized compiled
> (.pyo) files during an installation, but when you're developing, you are
> unlikely to have them for scripts that never get imported.

If you can figure out how to change the creator, you can figure out how
to compile a python scriipt.

> None of the main
> PythonCard sample scripts are compiled, demo.py in the wxPython distribution
> is not compiled, etc. There doesn't seem to be much of a speed increase in
> using the compiled or optimized compiled files, so I don't think people
> worry about them too much.

I agree that I don't, but I liek th *nix way anyway. On my mac, I'd live
to be able to make an application out of a script by just compiling it.
Come to think of it, it would be kind of like the current "Build Applet"
option. IN fact, that is exactly how I work on the Mac. While
developing, I want to Python files in an editor, and when I have a
working app that I want to just use, I make an applet out of it. Perhaps
approach should be preserved in OS-X.

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer
                                    		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker@noaa.gov