[Pythonmac-SIG] configure failing with Python 2.4

2004-12-23 Thread Kevin Dangoor
I'm thinking that I must be doing something simple wrong... hopefully 
that's the case.

I downloaded the Python 2.4 source and tried to run a basic ./configure 
to see what I get. What I got was this error:

checking for C++ compiler default output file name... configure: error: 
C++ compiler cannot create executables

which appears to be caused by
configure:1772: c++conftest.cc  >&5
ld: can't locate file for: -lcrt1.o
While I'm sure I can track that down, I figured that I must be doing 
something silly. Can anyone tell me what I'm missing?

Thanks,
Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] configure failing with Python 2.4

2004-12-23 Thread Kevin Dangoor
Err, while this might be enough info for someone to go on, I just 
realized that there's not much there...

I'm running Mac OS 10.3.6. I have XCode/Developer Tools installed, 
though that didn't seem to make any difference. I even tried moving my 
.bashrc and .profile files out of the way to be sure that those weren't 
causing any grief.

Kevin
Kevin Dangoor wrote:
I'm thinking that I must be doing something simple wrong... hopefully 
that's the case.

I downloaded the Python 2.4 source and tried to run a basic 
./configure to see what I get. What I got was this error:

checking for C++ compiler default output file name... configure: 
error: C++ compiler cannot create executables

which appears to be caused by
configure:1772: c++conftest.cc  >&5
ld: can't locate file for: -lcrt1.o
While I'm sure I can track that down, I figured that I must be doing 
something silly. Can anyone tell me what I'm missing?

Thanks,
Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] configure failing with Python 2.4

2004-12-23 Thread Kevin Dangoor
I actually just installed Xcode this morning. I do have Fink installed, 
but removed it from my path when I moved my bashrc and profile aside. I 
also had confirmed that gcc is in /usr/bin.

> gcc -v
Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
Thread model: posix
gcc version 3.3 20030304 (Apple Computer, Inc. build 1495)
That's what struck me as odd here... there's nothing very out of the 
ordinary that I'm aware of.

As I thought about it some more, I may just use my existing python 2.3 
until there's an official MacPython 2.4 release.

Kevin
Bob Ippolito wrote:
Reinstall Xcode and/or make sure you aren't using Fink or something 
which may have installed an alternate compiler (make sure "which cc" 
and "which gcc" point to /usr/bin).

On Dec 23, 2004, at 10:23 AM, Kevin Dangoor wrote:
Err, while this might be enough info for someone to go on, I just 
realized that there's not much there...

I'm running Mac OS 10.3.6. I have XCode/Developer Tools installed, 
though that didn't seem to make any difference. I even tried moving 
my .bashrc and .profile files out of the way to be sure that those 
weren't causing any grief.

Kevin
Kevin Dangoor wrote:
I'm thinking that I must be doing something simple wrong... 
hopefully that's the case.

I downloaded the Python 2.4 source and tried to run a basic 
./configure to see what I get. What I got was this error:

checking for C++ compiler default output file name... configure: 
error: C++ compiler cannot create executables

which appears to be caused by
configure:1772: c++conftest.cc  >&5
ld: can't locate file for: -lcrt1.o
While I'm sure I can track that down, I figured that I must be doing 
something silly. Can anyone tell me what I'm missing?

Thanks,
Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig



___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] configure failing with Python 2.4

2004-12-24 Thread Kevin Dangoor
After trying to build a module today (and failing), I went searching 
around for the answer to this problem. It turns out that there are 
installation problems with older versions of Xcode. I had installed 
Xcode 1.1 from my Panther CDs. Downloading and installing Xcode 1.5 
fixed the problem (and I've got Python 2.4 building in another window as 
I write this).

Kevin
Bob Ippolito wrote:
Reinstall Xcode and/or make sure you aren't using Fink or something 
which may have installed an alternate compiler (make sure "which cc" 
and "which gcc" point to /usr/bin).

On Dec 23, 2004, at 10:23 AM, Kevin Dangoor wrote:
Err, while this might be enough info for someone to go on, I just 
realized that there's not much there...

I'm running Mac OS 10.3.6. I have XCode/Developer Tools installed, 
though that didn't seem to make any difference. I even tried moving 
my .bashrc and .profile files out of the way to be sure that those 
weren't causing any grief.

Kevin
Kevin Dangoor wrote:
I'm thinking that I must be doing something simple wrong... 
hopefully that's the case.

I downloaded the Python 2.4 source and tried to run a basic 
./configure to see what I get. What I got was this error:

checking for C++ compiler default output file name... configure: 
error: C++ compiler cannot create executables

which appears to be caused by
configure:1772: c++conftest.cc  >&5
ld: can't locate file for: -lcrt1.o
While I'm sure I can track that down, I figured that I must be doing 
something silly. Can anyone tell me what I'm missing?

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] py2app error with _py_suffixes

2004-12-28 Thread Kevin Dangoor
First of all, thanks for all of the work put into py2app! Hard to 
imagine how much time it would have taken me to figure out all of the 
various things that it does (particularly since I'm new to Mac development).

I was just going to rebuild an app and ran into this error:
 File "/purelib/py2app/py2app/util.py", line 203, in byte_compile
NameError: global name '_py_suffixes' is not defined
It was trying to byte compile a ".pyc" to a ".pyc"
I don't see _py_suffixes defined anywhere...
Thanks again for the cool tool
Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] py2app error with _py_suffixes

2004-12-28 Thread Kevin Dangoor
One more bit of relevant info... I just noticed that the file in 
question was a ".ptl" file (from Quixote) that was compiled into a ".pyc".

Kevin
Kevin Dangoor wrote:
First of all, thanks for all of the work put into py2app! Hard to 
imagine how much time it would have taken me to figure out all of the 
various things that it does (particularly since I'm new to Mac 
development).

I was just going to rebuild an app and ran into this error:
 File "/purelib/py2app/py2app/util.py", line 203, in byte_compile
NameError: global name '_py_suffixes' is not defined
It was trying to byte compile a ".pyc" to a ".pyc"
I don't see _py_suffixes defined anywhere...
Thanks again for the cool tool
Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] py2app error with _py_suffixes

2004-12-28 Thread Kevin Dangoor
Bob Ippolito wrote:
On Dec 28, 2004, at 12:14 PM, Kevin Dangoor wrote:
Kevin Dangoor wrote:
I don't see _py_suffixes defined anywhere...

One more bit of relevant info... I just noticed that the file in 
question was a ".ptl" file (from Quixote) that was compiled into a 
".pyc".

That would probably explain it.  py2app may very well not be 
compatible with alternatively compiled bytecode, I will have to look 
into it.  Do you know if compiled ptl is compatible with py2exe?

-bob
I'm using py2app 0.1.6 (just downloaded today). At least in that 
version, there's a _py_suffixes referenced.

I had my build script drop a _py_suffixes into the util module and that 
worked fine.

Quixote's ptl compiler includes a handy function that compiles every ptl 
in a directory. Precompiling the ptls worked fine with py2app! That's a 
much more pleasant solution (to me, at least) than dropping the files in 
next to the app, which is what was suggested for py2exe.

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] how do I use twisted cfreactor?

2005-01-14 Thread Kevin Dangoor
   I'm trying to mix Twisted and a Mac interface. I'm using PyObjC 1.2 
and Twisted's trunk as of a few days back. All of this with Python 2.3. 
The combo appeared to be working until this morning. Intriguingly, the 
problem appeared when I added Cheetah (the template engine) to the mix. 
If I remove Cheetah *or* I remove PyObjC, everything appears to be happy.

The basic order in which I'm doing things is:
1) install cfreactor,
2) load up my nib-based controller class,
3) tell the reactor to start listening on a TCP port,
4) (reactor.run) -- I had this line in there but then removed it without 
a difference in behavior
5) AppHelper.runEventLoop

I'm not exactly sure how or why introducing Cheetah could have this 
effect. I even moved Cheetah's one C module out of the way (falling back 
to straight Python code), but that didn't seem to have an effect. I 
figured it was time to double check that I'm doing the right things in 
getting things running.

Is there anything glaringly obvious in that list of steps that should be 
different or in a different order?

Thanks,
Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] how do I use twisted cfreactor?

2005-01-14 Thread Kevin Dangoor
Replying to myself is always fun.
I decided to try a more minimal test, eliminating everything but PyObjC 
and Cheetah. It does indeed appear to be the case that I get a Bus Error 
if I render a Cheetah template from within an action called by a menu 
item. This happens even when Cheetah is 100% python.

The bus error occurs after my action returns. This leads me to believe 
that either there's something else I need to do in my class to handle 
that action properly, or there is a bug in Cheetah or PyObjC.

Even though Twisted is not at all at issue here, I'd still be curious to 
hear if I'm setting up event handling properly...

Kevin
Kevin Dangoor wrote:
   I'm trying to mix Twisted and a Mac interface. I'm using PyObjC 1.2 
and Twisted's trunk as of a few days back. All of this with Python 
2.3. The combo appeared to be working until this morning. 
Intriguingly, the problem appeared when I added Cheetah (the template 
engine) to the mix. If I remove Cheetah *or* I remove PyObjC, 
everything appears to be happy.

The basic order in which I'm doing things is:
1) install cfreactor,
2) load up my nib-based controller class,
3) tell the reactor to start listening on a TCP port,
4) (reactor.run) -- I had this line in there but then removed it 
without a difference in behavior
5) AppHelper.runEventLoop

I'm not exactly sure how or why introducing Cheetah could have this 
effect. I even moved Cheetah's one C module out of the way (falling 
back to straight Python code), but that didn't seem to have an effect. 
I figured it was time to double check that I'm doing the right things 
in getting things running.

Is there anything glaringly obvious in that list of steps that should 
be different or in a different order?

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] how do I use twisted cfreactor?

2005-01-14 Thread Kevin Dangoor
Replying to myself is always fun.
I decided to try a more minimal test, eliminating everything but PyObjC 
and Cheetah. It does indeed appear to be the case that I get a Bus Error 
if I render a Cheetah template from within an action called by a menu 
item. This happens even when Cheetah is 100% python.

The bus error occurs after my action returns. This leads me to believe 
that either there's something else I need to do in my class to handle 
that action properly, or there is a bug in Cheetah or PyObjC.

Even though Twisted is not at all at issue here, I'd still be curious to 
hear if I'm setting up event handling properly...

Kevin
Kevin Dangoor wrote:
   I'm trying to mix Twisted and a Mac interface. I'm using PyObjC 1.2 
and Twisted's trunk as of a few days back. All of this with Python 
2.3. The combo appeared to be working until this morning. 
Intriguingly, the problem appeared when I added Cheetah (the template 
engine) to the mix. If I remove Cheetah *or* I remove PyObjC, 
everything appears to be happy.

The basic order in which I'm doing things is:
1) install cfreactor,
2) load up my nib-based controller class,
3) tell the reactor to start listening on a TCP port,
4) (reactor.run) -- I had this line in there but then removed it 
without a difference in behavior
5) AppHelper.runEventLoop

I'm not exactly sure how or why introducing Cheetah could have this 
effect. I even moved Cheetah's one C module out of the way (falling 
back to straight Python code), but that didn't seem to have an effect. 
I figured it was time to double check that I'm doing the right things 
in getting things running.

Is there anything glaringly obvious in that list of steps that should 
be different or in a different order?

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] how do I use twisted cfreactor?

2005-01-14 Thread Kevin Dangoor
Wow. That was quick!
I didn't realize that there was a gotcha with the imports. That was just 
a premature optimization, so I can easily avoid that :)

Thanks for your help... that's certainly not the kind of thing I would 
have just guessed...

Kevin
Bob Ippolito wrote:
(Kevin sent me the test off-list, and I took a look at it).
I'm not sure exactly why your example crashes (somehow a retain 
message gets sent to a dead or non-object), however, the problem is 
that you are using an import statement from inside the implementation 
of the action.  Don't do that.  Do your imports in module level code.

-bob

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] how do I use twisted cfreactor?

2005-01-14 Thread Kevin Dangoor
That's good to hear. The more I thought about it, the more it seems like 
there are other cases where "non-standard" imports are more than a 
little useful. I'm actually running into another Cheetah-related problem 
when I use py2app (though this one is very clearly in Cheetah land), and 
it's also import related. If I spot anything wacky as I look at that 
problem, I'll let you know.

Kevin
Bob Ippolito wrote:
I don't think there is typically a gotcha with imports, I've certainly 
never seen this happen before, and I have done imports from 
applicationDidFinishLaunching: (pygame, in particular) before.  I have 
no idea if I should be blaming Cheetah, PyObjC or Python 2.3.0 
(haven't tested with 2.4 or CVS), but I will try and remember to dig 
in later.

-bob
On Jan 14, 2005, at 16:56, Kevin Dangoor wrote:
Wow. That was quick!
I didn't realize that there was a gotcha with the imports. That was 
just a premature optimization, so I can easily avoid that :)

Thanks for your help... that's certainly not the kind of thing I 
would have just guessed...

Kevin
Bob Ippolito wrote:
(Kevin sent me the test off-list, and I took a look at it).
I'm not sure exactly why your example crashes (somehow a retain 
message gets sent to a dead or non-object), however, the problem is 
that you are using an import statement from inside the 
implementation of the action.  Don't do that.  Do your imports in 
module level code.

-bob

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig



___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] Re: Namespace conflict with WebWare and PyObjC / Import safety (Was: how do I use twisted cfreactor?)

2005-01-14 Thread Kevin Dangoor
Fun indeed. Given that I'm not using WebWare, it would most definitely 
be picking up PyObjC's WebKit. Maybe there's something to be said for 
Java's package naming conventions :)

The py2app issue I was having was far less exciting. Cheetah seems to 
like dumping templates into /tmp and it drops in an __init__.py to 
pretend that /tmp is a package, and then imports from that package. It 
seems like there's gotta be a better way. Something to investigate 
tomorrow...

I wouldn't expect you to add Cheetah-specific stuff to py2app. It 
shouldn't need to do anything *that* magical. What I like about Cheetah 
is that it's concise (unlike TAL), is pleasant to work with (subjective 
to be sure, but I don't like ClearSilver's syntax), is reasonably 
performant, and strikes a nice balance between functionality and 
separation of concerns.

With the sleuthing you've done, I should be able to come up with 
something that works well for my needs.

Kevin
Bob Ippolito wrote:
I have traced the problem.  It is a two-parter:
(1) There is a module namespace conflict:
WebWare has a package named WebKit
PyObjC has a package named WebKit
(2) Cheetah.Servlet checks to see if WebWare's WebKit is available, 
and ends up importing PyObjC's WebKit.

(3) For whatever reason, it is not safe to import the WebKit wrapper 
from inside of an action (unless it's already imported, of course).  
Now this issue I will have to look further into.

---
So apparently it's more or less undefined behavior if you have both 
WebWare and PyObjC installed!  Fun :)

-bob


___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Mac User Python Newbies

2005-02-15 Thread Kevin Dangoor
Bob Ippolito wrote:
On Feb 14, 2005, at 12:09 PM, has wrote:
My preferred IDE architecture would be built on a completely 
component-oriented architecture. That way it can ship with the 
minimal components required to get started, and users can add, 
upgrade and remove components as and when they need them. For 
example, a new user needs everything visible so they can see what's 
available; an experience one may prefer everything driven by 
memorised keyboard combinations so they can devote screen estate to 
more important things like their code instead of floating palettes, 
on-screen help, etc.

I think Eclipse is intended to be like this -- though I can't say I 
have real experience using it.
Yes indeed. Since I just arrived back on planet python from javaland a 
couple of months back, I used Eclipse quite extensively. Eclipse has a 
tiny core and everything else is a plugin. IBM's WebSphere Application 
Developer package, I've gathered, consists of more than 500 plugins. Of 
course, the drawback to Eclipse is that it's Java. Whenever I would do 
some of my development on my Mac, I always found it to be a bit 
sluggish. I don't know if it's sluggish because of the plugins, or if 
it's sluggish because of the SWT gui toolkit.

Lately, I've been using JEdit (which is also Java, but I haven't found 
it to be sluggish).

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] mac python gui: Framework vs. wxPython

2005-02-19 Thread Kevin Dangoor
This question seems to come up a lot. Here's my quick summary:
1) EasyDialogs is nice but can only do really, really simple things.
2) If you're strictly doing Mac work, pyobjc is your best bet, because 
you can do basically anything that can be done in Objective-C. You
can really use the Mac GUI to its fullest.

3) wxPython's goal is to allow cross-platform programming using native 
widgets. Though it uses native widgets, you don't get the same level of 
control that you do with pyobjc. If you're not specifically setting out 
to do cross-platform deployment, use pyobjc.

There have been long threads on GUI toolkits within just the past couple 
of weeks... check out the mailing list archives for the full scoop.

Kevin
Chris Jerdonek wrote:
Newcomer question:
For making a GUI python application for Mac, what're the differences 
and pros/cons between (1) using wxPython and (2) using the MacPython 
modules described in the official python documentation (EasyDialogs, 
Framework, etc.)?

And what's the relationship between these two approaches?
Thanks in advance for any help,
CHRIS

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] trouble making a standalone app with Python 2.4

2005-02-23 Thread Kevin Dangoor
For a few reasons, I am moving my app to Python 2.4. It runs fine when I 
use py2app -A, but it doesn't work when I try to build a full standalone 
application. At first, "doesn't work" meant that Twisted's cfreactor 
couldn't find _CarbonEvt. If I specifically ask to include _CarbonEvt, I 
get a bus error.

I ran it through gdb and this is what I got:
Program received signal EXC_BAD_ACCESS, Could not access memory.
0x007615e4 in PyObjCFFI_BuildResult (methinfo=0xbdcae0, argOffset=2, 
pRetval=0x77e088, byref=0xbcf130, byref_out_count=0, self=0x1f690b0, 
flags=0) at Modules/objc/libffi_support.m:929
929 if (self != NULL && objc_result != self

I wanted to start with my basic setup and make sure that all is well:
When I built Python, I did it as a framework build. I also enabled 
toolkit glue, but I'm really not sure what that means and haven't seen 
any docs that tell me. Those were the only two configure options I used. 
I also just tried rebuilding Python without enable-toolkit-glue to see 
if it made a difference, and it didn't seem to.

I installed PyObjC 1.2 with python setup.py bdist_mpkg --open (this was 
after making sure that python 2.4 was what I was picking up from my 
path). I've also tried using py2app 0.1.7 and py2app's svn head.

I have an automated build setup that rebuilds all of my third party 
modules, so running that was easy and I know I have everything there.

As I mentioned at the beginning, it runs fine using py2app -A. I wanted 
to start with making sure the basic steps I've taken so far were okay 
and then troubleshoot more from there.

Anyone see something wrong from there? Suggestions for next steps?
Thanks,
Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] trouble making a standalone app with Python 2.4

2005-02-23 Thread Kevin Dangoor
Bob Ippolito wrote:
On Feb 23, 2005, at 9:08, Kevin Dangoor wrote:
For a few reasons, I am moving my app to Python 2.4. It runs fine 
when I use py2app -A, but it doesn't work when I try to build a full 
standalone application. At first, "doesn't work" meant that Twisted's 
cfreactor couldn't find _CarbonEvt. If I specifically ask to include 
_CarbonEvt, I get a bus error.

You didn't mention what version of Twisted this was.  Twisted 1.3.0 
has a broken cfreactor that assumes broken PyObjC 1.0 behavior, so you 
will need to use Twisted from SVN (or at least the cfsupport module) too.

I'm using the Twisted 2.0 pre-alpha that was sort of released a few days 
back (as in the tarballs were stuck up on radix's page).

Are you sure it's not that WebKit namespace collision again? :)  What 
was the rest of that backtrace?
Pretty sure about that one. Near the top of my main .py file, before 
Cheetah has a chance to get at anything, I have an "import WebKit" to 
make sure that WebKit is installed safely.

I added some more logging statements in Python to narrow the problem 
down to reactor.listenTCP(). So, this is after the cfreactor has 
been installed, but before reactor.run() was called.

Here is the full backtrace from gdb. It doesn't tell me anything, but 
maybe it will say something to you:

#0  0x007615e4 in PyObjCFFI_BuildResult (methinfo=0xbd3940, argOffset=2, 
pRetval=0x77e088, byref=0xbd4950, byref_out_count=0, self=0x1f820f0, 
flags=0) at Modules/objc/libffi_support.m:929
#1  0x00761ef8 in PyObjCFFI_Caller (aMeth=0x1f89188, self=0x1f820f0, 
args=0x0) at Modules/objc/libffi_support.m:1241
#2  0x00772a24 in objcsel_call (self=0x1f89188, args=0x2c5030) at 
Modules/objc/selector.m:502
#3  0x1000c798 in PyObject_Call (func=0x1, arg=0x77e088, kw=0x57fb) at 
Objects/abstract.c:1746
#4  0x1007cd2c in do_call (func=0x1f89188, pp_stack=0xbfffda5c, na=0, 
nk=7869788) at Python/ceval.c:3755
#5  0x1007ca24 in call_function (pp_stack=0x0, oparg=7856264) at 
Python/ceval.c:3570
#6  0x1007a488 in PyEval_EvalFrame (f=0x0) at Python/ceval.c:2163
#7  0x1007b5cc in PyEval_EvalCodeEx (co=0x0, globals=0x77e088, 
locals=0x1, args=0x0, argcount=1227680, kws=0x1007a478, kwcount=1, 
defs=0x1392ac, defcount=1, closure=0x0) at Python/ceval.c:2730
#8  0x1007cc14 in fast_function (func=0x1, pp_stack=0xbfffda5c, n=0, 
na=268756608, nk=2) at Python/ceval.c:3640
#9  0x1007ca0c in call_function (pp_stack=0xbfffdcac, oparg=7856264) at 
Python/ceval.c:3568
#10 0x1007a488 in PyEval_EvalFrame (f=0xbfffdcac) at Python/ceval.c:2163
#11 0x1007b5cc in PyEval_EvalCodeEx (co=0x1, globals=0x77e088, 
locals=0x1, args=0x1, argcount=1227680, kws=0x1007a478, kwcount=1, 
defs=0x1392ac, defcount=0, closure=0x0) at Python/ceval.c:2730
#12 0x10026738 in function_call (func=0x1f89188, arg=0x12bba0, 
kw=0xbfffdcac) at Objects/funcobject.c:550
#13 0x1000c798 in PyObject_Call (func=0x1, arg=0x77e088, kw=0x57fb) at 
Objects/abstract.c:1746
#14 0x10015ed8 in instancemethod_call (func=0x1952d70, arg=0x1f68210, 
kw=0x0) at Objects/classobject.c:2431
#15 0x1000c798 in PyObject_Call (func=0x1, arg=0x77e088, kw=0x57fb) at 
Objects/abstract.c:1746
#16 0x10059fac in slot_tp_init (self=0x6850f0, args=0x1f54c60, kwds=0x0) 
at Objects/typeobject.c:4752
#17 0x100531e8 in type_call (type=0x1a621e8, args=0x6850f0, 
kwds=0x1f54c60) at Objects/typeobject.c:435
#18 0x1000c798 in PyObject_Call (func=0x1, arg=0x77e088, kw=0x57fb) at 
Objects/abstract.c:1746
#19 0x1007cd2c in do_call (func=0xb40b00, pp_stack=0xbfffe38c, na=0, 
nk=7869788) at Python/ceval.c:3755
#20 0x1007ca24 in call_function (pp_stack=0x0, oparg=7856264) at 
Python/ceval.c:3570
#21 0x1007a488 in PyEval_EvalFrame (f=0x0) at Python/ceval.c:2163
#22 0x1007cb84 in fast_function (func=0x1, pp_stack=0xbfffe38c, n=0, 
na=268756608, nk=2) at Python/ceval.c:3629
#23 0x1007ca0c in call_function (pp_stack=0xbfffe53c, oparg=7856264) at 
Python/ceval.c:3568
#24 0x1007a488 in PyEval_EvalFrame (f=0xbfffe53c) at Python/ceval.c:2163
#25 0x1007cb84 in fast_function (func=0x1, pp_stack=0x0, n=3, 
na=268756608, nk=2) at Python/ceval.c:3629
#26 0x1007ca0c in call_function (pp_stack=0xbfffe6ec, oparg=7856264) at 
Python/ceval.c:3568
#27 0x1007a488 in PyEval_EvalFrame (f=0xbfffe6ec) at Python/ceval.c:2163
#28 0x1007cb84 in fast_function (func=0x1, pp_stack=0x0, n=2, 
na=268756608, nk=2) at Python/ceval.c:3629
#29 0x1007ca0c in call_function (pp_stack=0xbfffe89c, oparg=7856264) at 
Python/ceval.c:3568
#30 0x1007a488 in PyEval_EvalFrame (f=0xbfffe89c) at Python/ceval.c:2163
#31 0x1007cb84 in fast_function (func=0x1, pp_stack=0x0, n=1, 
na=268756608, nk=2) at Python/ceval.c:3629
#32 0x1007ca0c in call_function (pp_stack=0xbfffea4c, oparg=7856264) at 
Python/ceval.c:3568
#33 0x1007a488 in PyEval_EvalFrame (f=0xbfffea4c) at Python/ceval.c:2163
#34 0x1007b5cc in PyEval_EvalCodeEx (co=0x1, globals=0x77e088, 
locals=0x1, args=0x1, argcount=1227680, kws=0x1007a478, kwco

Re: [Pythonmac-SIG] trouble making a standalone app with Python 2.4

2005-02-23 Thread Kevin Dangoor
Bob Ippolito wrote:
On Feb 23, 2005, at 9:08, Kevin Dangoor wrote:
For a few reasons, I am moving my app to Python 2.4. It runs fine 
when I use py2app -A, but it doesn't work when I try to build a full 
standalone application. At first, "doesn't work" meant that Twisted's 
cfreactor couldn't find _CarbonEvt. If I specifically ask to include 
_CarbonEvt, I get a bus error.

You didn't mention what version of Twisted this was.  Twisted 1.3.0 
has a broken cfreactor that assumes broken PyObjC 1.0 behavior, so you 
will need to use Twisted from SVN (or at least the cfsupport module) too.

Are you sure it's not that WebKit namespace collision again? :)  What 
was the rest of that backtrace?
In Python, I have narrowed this down to here:
cfreactor.CFReactor.getRunLoop
   runLoop = nsRunLoop.getCFRunLoop()
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] trouble making a standalone app with Python 2.4

2005-02-23 Thread Kevin Dangoor
Bob Ippolito wrote:
On Feb 23, 2005, at 10:18, Kevin Dangoor wrote:
In Python, I have narrowed this down to here:
cfreactor.CFReactor.getRunLoop
   runLoop = nsRunLoop.getCFRunLoop()

Do the PyObjC Examples/Twisted examples work in your environment?
I tried WebServicesTool and had much the same experience. py2app -A 
worked fine. Without -A, the app couldn't find _CarbonEvt. I added -i 
_CarbonEvt and ran into a bus error (in what looks like the same place)

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] trouble making a standalone app with Python 2.4

2005-02-23 Thread Kevin Dangoor
Bob Ippolito wrote:
I probably won't be able to look at this until tomorrow, but try 
comparing sys.modules.keys() between your environment with py2app -A 
and py2app.
in getRunLoop, I added print sys.modules.keys() and then ran the Web 
Services Tool with and without -A.

Without -A (normal standalone app), the following had been imported. 
They were not imported with -A:
'AppKit.imp',
'AppKit.os',
'AppKit.sys',
'Foundation.imp',
'objc.imp',
'objc.sys',
'twisted.internet.imp',
'twisted.protocols.cStringIO',
'twisted.protocols.imp',
'twisted.protocols.os',
'zlib',
'zope.interface.imp',
'zope.interface.os',

I'm guessing that the "imp"s here are probably something special and 
automatic that py2app does.

Probably more relevant is the list of things that were imported with -A, 
but not without:
'Carbon.CF',
'Carbon._CF',
'_CF',

Seeing this, I added an explicit import for these in one of my modules. 
And it worked! Your intuition about the WebKit problem may have been on 
track. Just as with that case, these imports were ultimately getting 
called from within a block. Putting them at the module level fixed it.

Thanks for the suggestion of looking at sys.modules! I don't think that 
I was an avenue I would have gone down.

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Trouble installing mxdatetime

2005-03-12 Thread Kevin Dangoor
Sounds like you might not have Xcode/Developer Tools installed. They 
don't come installed by default.

Kevin
Jason Van Anden wrote:
Hi,
I was attempting to install mxdatetime on a mac mini - but it fails 
when I run setup.  Repeated messages tell me it was unable to execute 
gcc.  I unzipped the release in a temp folder and ran:

sudo python setup.py install
Advice appreciated.
J
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] py2app on Tiger

2005-03-16 Thread Kevin Dangoor
Given the buzz that Tiger is coming in a month, I was curious about 
whether it's possible to create Python apps on Tiger and run them on 
Panther (assuming, of course, that I'm not using Tiger features). I'm 
already using my own Python build, if that makes any difference.

I'd really like to upgrade to Tiger, but even more than that I'd really 
like for people running Panther to be able to buy my software :)

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] py2app on Tiger

2005-03-16 Thread Kevin Dangoor
Bob Ippolito wrote:
My recommendation is to:
-  Build your framework on the minimum target platform
-  Copy it over to your workstation
-  Use bdist_mpkg to build installer packages for the extensions you 
use from the minimum target platform
-  Install them on your workstation as needed
So, I guess the next question is: is it possible to have two versions of 
Mac OS X on one machine? My primary development box is a PowerBook. 
Would it be possible to keep 10.3 on an external firewire drive and boot 
from that when I need to produce my builds?

(Sorry for the fairly basic question there, but I haven't had to do that 
kind of thing on a Mac before...)

py2app doesn't compile anything, so it doesn't care which OS it runs 
on.  I have a Python framework plus extensions that were built on Mac 
OS X 10.2 (Jaguar) that I use to build a Mac OS X 10.2 compatible 
application with from Mac OS X 10.3.
Makes sense. I should've guessed that anything in C that links to OS 
libraries would not drop down to 10.3 easily.

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] emergency python recovery

2005-03-17 Thread Kevin Dangoor
Just an FYI to anyone else who sees this... I've tarred up the files for 
John.

Kevin
John Hunter wrote:
I was in the process of getting ready for a talk this morning at 9AM,
one that was largely a demo of python for scientific computing, when I
inadvertently did
 > sudo rm -rf 
/System/Library/Frameworks/Python/.framework/Versions/2.3/lib/python2.3
Ouch!  I had meant to just remove site-packages/matplotlib for a clean
install, and just screwed up.
Is there an easy way to get this directory back -- eg an installer or
package?
If not, could someone just tar up that directory and share it with me?
I'm using OS X 10.3 on a 12 inch powerbook G4.
Thanks!
JDH
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

 

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Re: IDE recommendation

2005-04-06 Thread Kevin Dangoor
On Mar 31, 2005 2:52 AM, Lee Cullens <[EMAIL PROTECTED]> wrote:
> TextWrangler is (to me) too much like its big brother - a do-all
> "develop it yourself" sandbox.  Great if that's what your into, but a
> sidetrack to me.  For the moment I'll stick with the simpler
> SubEthaEdit which I can even use in Terminal (instead of Pico).
> Besides I liked "The Hitchhikers Guide To The Galaxy" (origin of Sub
> Etha) - was it the late 70's or the 80's they serialized it on PBS (I'm
> forgetting too much)?

 I've become fond of TextMate lately. It's a fairly new editor and is
missing some features, but what it does it does well. It has good
project organization and makes it easy to switch between files in your
project. The really spiffy thing, though, is that it is very easily
extended via Unix filters. So, you can make filters that do anything
to your text in any language (eg Python) and have the result pop back
into your buffer. There are a fair number of add-ons available already
(because of how easy it is to extend), but they're only accessible via
a Subversion repository at the moment.

TextMate is $39, which is infinitely more than free, but considerably
less than BBEdit.

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] EasyDialogs and py2app

2005-05-12 Thread Kevin Dangoor
I have an application that uses EasyDialogs and is packaged up with
py2app. When I run it, it seems to have trouble finding dialogs.rsrc:

  File "EasyDialogs.pyc", line 193, in AskYesNoCancel
  File "EasyDialogs.pyc", line 49, in _initialize
  File "macresource.pyc", line 63, in need
macresource.ResourceFileNotFoundError: dialogs.rsrc

I'm using my own Python 2.4 framework build. Should I have to do
anything to be sure that this file is included? What's the *right* way
to point to the file in my setup?

Thanks,
Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] EasyDialogs and py2app

2005-05-12 Thread Kevin Dangoor
I should clarify: when I ask "what's the right way to point to the
file", I mean rather than hardcoding the path to the file in my Python
installation, if anyone knows the correct way to get the file path in
Python code. (I could do something like EasyDialogs.__file__ and then
grab the directory from there)

Kevin

On 5/12/05, Kevin Dangoor <[EMAIL PROTECTED]> wrote:
> I have an application that uses EasyDialogs and is packaged up with
> py2app. When I run it, it seems to have trouble finding dialogs.rsrc:
> 
>   File "EasyDialogs.pyc", line 193, in AskYesNoCancel
>   File "EasyDialogs.pyc", line 49, in _initialize
>   File "macresource.pyc", line 63, in need
> macresource.ResourceFileNotFoundError: dialogs.rsrc
> 
> I'm using my own Python 2.4 framework build. Should I have to do
> anything to be sure that this file is included? What's the *right* way
> to point to the file in my setup?
> 
> Thanks,
> Kevin
>
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] EasyDialogs and py2app

2005-05-12 Thread Kevin Dangoor
Thanks! That's what I figured, but I wanted to be sure I wasn't
missnig something.

On 5/12/05, Bob Ippolito <[EMAIL PROTECTED]> wrote:
> I'll put some hooks into py2app 0.2 to pick these up.. but:
> 
> from distutils.core import setup
> import py2app
> import os
> import EasyDialogs
> plat_mac = os.path.dirname(EasyDialogs.__file__)
> rsrcFile = os.path.join(plat_mac, 'dialogs.rsrc')
> setup(
>  data_files=[rsrcFile],
>  ...
> )
> 
> On May 12, 2005, at 3:18 PM, Kevin Dangoor wrote:
> 
> > I should clarify: when I ask "what's the right way to point to the
> > file", I mean rather than hardcoding the path to the file in my Python
> > installation, if anyone knows the correct way to get the file path in
> > Python code. (I could do something like EasyDialogs.__file__ and then
> > grab the directory from there)
> >
> > Kevin
> >
> > On 5/12/05, Kevin Dangoor <[EMAIL PROTECTED]> wrote:
> >
> >> I have an application that uses EasyDialogs and is packaged up with
> >> py2app. When I run it, it seems to have trouble finding dialogs.rsrc:
> >>
> >>   File "EasyDialogs.pyc", line 193, in AskYesNoCancel
> >>   File "EasyDialogs.pyc", line 49, in _initialize
> >>   File "macresource.pyc", line 63, in need
> >> macresource.ResourceFileNotFoundError: dialogs.rsrc
> >>
> >> I'm using my own Python 2.4 framework build. Should I have to do
> >> anything to be sure that this file is included? What's the *right*
> >> way
> >> to point to the file in my setup?
> >>
> >> Thanks,
> >> Kevin
> >>
> >>
> > ___
> > Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
> > http://mail.python.org/mailman/listinfo/pythonmac-sig
> >
> 
>
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] .pth use

2005-05-22 Thread Kevin Dangoor
On 5/22/05, Lee Cullens <[EMAIL PROTECTED]> wrote:
> What worked (at least so far) was to put a .pth file (containing /
> Users/Chinook/PythonProjects/MyUtilities) in /Library/Frameworks/
> Python.framework/Versions/2.4/lib/python2.4/site-packages

Since this is a user-specific path, you should put it in
~/Library/Python/2.4/site-packages

(/Users/Chinook/Library/Python/2.4/site-packages)

You'll likely have to create that directory.

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Best way to install pysqlite on 2.4 / Tiger?

2005-05-25 Thread Kevin Dangoor
On 5/24/05, Kenneth McDonald <[EMAIL PROTECTED]> wrote:
> I know that Apple includes SQLite with Tiger. My question; what is the
> 'best' way to install pysqlite, with the python 2.4 upgrade, under
> Tiger. Specifically;
> 
> - should I install a newer version of SQLite, or use the one Apple provides?
> - has anyone actually gotten pysqlite to work under Tiger?

I don't know what version of sqlite comes with Tiger (and typing
sqlite at the command line doesn't bring up anything). Personally, I'm
using the latest sqlite (alter table add column comes in handy now and
then ;)

I'm also running pysqlite 2.01. I didn't have any real trouble
building sqlite or pysqlite using fairly standard means (configure;
make and setup.py)

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] open() does'nt work with py2app

2005-07-12 Thread Kevin Dangoor
On 7/12/05, Mathieu Renauld <[EMAIL PROTECTED]> wrote:
> Hi!
> First forgive me for the language mistakes (I'm french)!!

Your English is more understandable than some native English writers
I've seen :)

> 
> I try to make a program using wxPython and Python 2.4.
> There's a function which creates a file like that:
> file = open('myfile.py','w')
> 
> when I launch the program from a shell (python test.py), it work perfectly
> and the file is created, but once I've 'compiled' it with py2app, the
> created app doesn't create anything.
> If somebody has already met that problem, please help me !! thanks!

I'd imagine it did create the file... you just have to know where to
look. When you fire up an app, your working directory is *inside the
app bundle*. This is good for many things, but not for writing files.
(If you look inside the .app bundle, you'll find your myfile.py down
in there...)

For the purposes of testing, you might try something like this:

import user
import os
fn = os.path.join(user.home, "myfile.py")
file = open(fn, "w")

That will create the file in your home directory.

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Zope.Interface won't build on 10.4

2005-07-13 Thread Kevin Dangoor
I encountered this as well. I *think* something needs to change within
zope.interface to work with gcc 4.x. Anyhow, all you need to do is:

sudo gcc_select 3.3

Kevin

On 7/13/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>  
> Maybe I should take this to one of  the Twisted or Zope lists, but this
> appears to be a Mac-specific issue so I thought it worth mentioning here.
> The problem is that Zope Interface 3.01 won't build on Mac OS 10.3 using
> either the stock Python 2.3 or Python 2.4.1 (error transcript at the
> bottom). 
>  
>  A Google search of the problem turned up a discussion on one of the Zope
> lists about this, but I didn't understand how to implement the suggested
> solution.  One message in the thread suggests the problem is that Python was
> compiled under gcc 3.x and Mac OS 10.4 defaults to using gcc 4.x, and that
> using gcc select can fix the problem. Any thoughts on how to do that?
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] Python Eggs and Mac OS version compatibility

2005-07-19 Thread Kevin Dangoor
I have been packaging up some of my python packages in eggs:
http://peak.telecommunity.com/DevCenter/PythonEggs

Basically, an egg has everything you need to use a package,
ready-to-run... including binary versions of extensions. It's a nice
format because it enables people to just run an "easy_install" program
to get a package, no compiler required. (Which is a bigger win on
Windows, to be sure, but even on the Mac it means that casual
scripters wouldn't need to install Developer Tools).

The way eggs are created right now generates a package name that looks
something like this:

[PackageName]-[Version]-py[PythonVersion]-darwin-8.2.0-Power_Macintosh.egg

As coded currently, updating from Mac OS 10.4.1 to 10.4.2 (which
bumped the Darwin version from 8.1.0 to 8.2.0), means that any eggs
compiled under 10.4.1 won't work any more under 10.4.2, because
setuptools is checking the full platform to see if it matches.

That's more than a little aggressive, compatibility-wise. We can
redefine for Mac OS what an appropriate platform string would be and
what the compatibility rules are.

That's where I need some help, because I don't know for certain what
the compatibility rules are. From reading this list for the past
several months, I have an idea:

1) an extension built for Python 2.4 on 10.3 should work under 10.4
2) an extension built for Python 2.4 on 10.4 might work on 10.3, but
don't count on it.

Would it then make sense for setuptools to do something like this:

- declare the platform as it does now (eg, darwin-8.2.0)
- specify that an egg is compatible if it's major version (8) is <=
your machine's major version.

Are there other compatibility gotchas or would that do the trick?

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Python Eggs and Mac OS version compatibility

2005-07-20 Thread Kevin Dangoor
On 7/19/05, Bob Ippolito <[EMAIL PROTECTED]> wrote:
> Pick out the sw_vers function from here:
> http://svn.red-bean.com/bob/py2app/trunk/src/bdist_mpkg/tools.py

That is more comforting than going with the Darwin version. I'll wrap
that up for Phillip and send him a patch.

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Python Eggs and Mac OS version compatibility

2005-07-20 Thread Kevin Dangoor
On 7/20/05, Michael Maibaum <[EMAIL PROTECTED]> wrote:
> On 20 Jul 2005, at 13:36, Kevin Dangoor wrote:
> > That is more comforting than going with the Darwin version. I'll wrap
> > that up for Phillip and send him a patch.
> 
> 
> Note that the 3 or 4 people in the world running (pure) Darwin
> systems will not have sw_vers as it is not part of Darwin.

Believe it or not, I actually thought of that as well. Don't worry, I
have those handful of people covered as well...

if sys.platform == "darwin":
try:
version = macosx_vers()
machine = os.uname()[4].replace(" ", "_")
return "macosx-%d.%d.%d-%s" % (int(version[0]), int(version[1]),
int(version[2]), machine)
except ValueError:
# if someone is running a non-Mac darwin system, this will fall
# through to the default implementation
pass

from distutils.util import get_platform
return get_platform()

On my machine, this returns:
macosx-10.4.2-Power_Macintosh

I thought it made sense to leave the Power_Macintosh in there because
of the upcoming Intel switch. I don't want to think about "Universal
Binary" eggs right now :)

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Python Eggs and Mac OS version compatibility

2005-07-20 Thread Kevin Dangoor
On 7/20/05, Ronald Oussoren <[EMAIL PROTECTED]> wrote:
> You don't mention the implementation of macosx_vers, but instead of
> calling /usr/bin/sw_vers you could also use platform.mac_ver,
> something like:

Ahh, I didn't know about that. macosx_vers is basically the sw_vers
function that Bob pointed to.

> 
>  if sys.platform == "darwin":
>  import platform
>  ver = platform.mac_ver()[0]
>  if ver != '':
>  return "macosx-%s.%s-%s"%tuple(ver.split('.')[:2] +
> [ platform.machine().replace(' ', '_') ])
>  # fall through to the generic version
> 
> This would return 'macosx-10.4-Power_Macintosh' on my system. Note
> that I explicitly drop the micro release number because OSX is binary
> compatible across all micro-releases in a release.

Yeah, maybe I should have dropped that as well. I included the micro
release number in the egg name, but excluded it from compatibility
computations. Now that I think about it, though, it would be better to
just drop the micro release altogether.

I noticed that mac_ver also returns "PowerPC" for the machine. Would
it be better to use that than "Power_Macintosh"?

> > I thought it made sense to leave the Power_Macintosh in there because
> > of the upcoming Intel switch. I don't want to think about "Universal
> > Binary" eggs right now :)
> 
> "Universal Binary" eggs should be automatic once someone teaches
> distutils to build "Univeral Binary" extensions. Building such
> extensions is easy enough (there's a hack in PyObjC's setup.py to do
> so), nicely integrating that in distutils is harder.

Automatic universal eggs will be cool.

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Solid GUI toolkits for Mac?

2005-07-27 Thread Kevin Dangoor
Actually, PyObjC is about as documented as it needs to be,
particularly if you start with Bob's more recent intro doc:

http://bob.pythonmac.org/archives/2005/07/05/pyobjc-first-steps/

Once you learn the PyObjC conventions, the only trickery at that point
is being able to read a bit of Objective-C and the API docs that are
out there. PyObjC is a bridge, so the idea is that whatever you do in
ObjC, you can now do in Python.

Kevin

On 7/27/05, Jon Rosebaugh <[EMAIL PROTECTED]> wrote:
> Where's the documentation? The webpage has a PyObjC version of Apple's
> CurrencyConverter tutorial, which really doesn't teach you much except
> how to align and connect things in IB and run py2app. The examples
> (well, at least the iClass example, which appears to be the most
> relevant one to my current needs) have no comments, so the only way to
> know for sure if a particular line of code is required for the class
> to work, or if it's just there to make life easier for the programmer
> is trial and error. I'm trying to figure out how TableViews work right
> now, and neither the apple documentation nor the iClass example is
> being very helpful.
> 
> This reminds me of trying to learn Twisted.
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] noob question: handling protocols and files

2005-08-05 Thread Kevin Dangoor
I've been looking through the docs on Apple's site a bit today, and
I'm not entirely certain where I *should* be looking. All I need is a
pointer to the correct terminology for what I'm trying to do (and if
PyObjC offers any specific bits that I should be aware of), and I
should be good to go from there.

I'm trying to figure out how to make my app open something the user
has requested to open from another app. My app is registered nicely
via LaunchServices with a trivial addition to Info.plist. I'm using
CFBundleURLTypes to register a URL scheme.

So, once that is registered, how do I actually get the incoming URL?

I've gathered that the application delegate gets called when the user
wants to open a file. Is a subclass of NibClassBuilder.AutoBaseClass
an application delegate?

Don't worry about writing a long description... any pointers at all
would be helpful, since the Apple docs are pretty good once you know
what you're looking for. Part of my problem is that searches on
Apple's site return an interesting mix of Carbon and Cocoa APIs,
making it less clear what the best way to do it is.

(For reference, my target is Python 2.4.1, Mac OS 10.3+, latest PyObjC...)

Thanks in advance!

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] noob question: handling protocols and files

2005-08-06 Thread Kevin Dangoor
On 8/5/05, Bob Ippolito <[EMAIL PROTECTED]> wrote:
> You may have to do that with a get URL apple event handler, see here:
> http://developer.apple.com/documentation/Cocoa/Conceptual/
> Scriptability/Concepts/ScriptabilityOverview.html
> (you shouldn't need any Carbon)

I had actually been to that page, but I wasn't completely sure that
was the right place. Having some confirmation is good... I'll head
down that path.

> Speaking of which, it might be cool if someone submitted a patch to
> the PyDocURLProtocol example to make it handle the "pydoc" URL scheme
> from other applications, rather than just its own WebKit view.
> https://svn.red-bean.com/pyobjc/trunk/pyobjc/Examples/WebKit/
> PyDocURLProtocol

Seems like that'll be easy once I figure out how to do this in my app.

> > I've gathered that the application delegate gets called when the user
> > wants to open a file. Is a subclass of NibClassBuilder.AutoBaseClass
> > an application delegate?
> 
> The application delegate is the object wired up to the delegate of
> the NSApplication instance.. it has nothing to do with what the
> superclass is.  NibClassBuilder.AutoBaseClass reads the nib file to
> determine what the superclass is.

I was confused about how this wiring was done, until I loaded one of
the example MainMenu.nib files in IB and noticed the delegate outlet.
D'oh. That's too easy.

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] noob question: handling protocols and files

2005-08-06 Thread Kevin Dangoor
On 8/5/05, Bob Ippolito <[EMAIL PROTECTED]> wrote:
> You may have to do that with a get URL apple event handler, see here:
> http://developer.apple.com/documentation/Cocoa/Conceptual/
> Scriptability/Concepts/ScriptabilityOverview.html
> (you shouldn't need any Carbon)

Before I go chasing around the Apple docs a bit more to see if I'm
registering the *correct* event handler, can you confirm if I'm doing
the right thing here?

The first questionable thing is that the constant for the type of
event is defined in the Apple Events docs (and in the AppleEvents
python module) as 'gurl'. However, the Apple Event Manager method call
is asking for an unsigned long. Should I convert "gurl" to
1735750252L?

Here's the objC example from Apple's doc:
[appleEventManager setEventHandler:self
andSelector:@selector(handleGetURLEvent:withReplyEvent:)
forEventClass:kAEInternetSuite andEventID:kAEISGetURL];

Here's my translation to Python:
sel = objc.selector(MacController.handleGetURLEvent_withReplyEvent_,
signature="vO:O:")
aem.setEventHandler_andSelector_forEventClass_andEventID_(self, 
sel, 
1735750252L, 1735750252L)

This is in my application delegate's applicationWillFinishLaunching_
method, which is where Apple recommended doing this. I can see that
this is getting called, but my handler itself doesn't get called.

I'm testing by just doing "open " at the
commandline, which does bring my app to the front but does not call my
handler method. Assuming all of the above is kosher, I'll do some more
digging around to make sure that this is, in fact, the specific
handler I want.

Thanks for your help so far!
Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] noob question: handling protocols and files

2005-08-06 Thread Kevin Dangoor
Less than 5 minutes ago, I said:
> I'm testing by just doing "open " at the
> commandline, which does bring my app to the front but does not call my
> handler method. Assuming all of the above is kosher, I'll do some more
> digging around to make sure that this is, in fact, the specific
> handler I want.

Something must not be wrong with what I'm doing there... the
LaunchServices docs specifically states that opening with a URL sends
the app a 'gurl' event, unless the URL scheme is file.

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] noob question: handling protocols and files

2005-08-07 Thread Kevin Dangoor
> $ open pydoc:///os.open
> 
> This will open the pydoc for os.open in the applet. I guess a  href="pydoc:///os.open"> in a HTML file will also work.

Wow. That should be a great example for me! Thanks!

> 
> The important issue that kept me guessing for a while is that the
> AppleEvent is GURL/GURL, while gurl/gurl is used in
> Carbon.AppleEvents (and the system headers, this is not really a bug
> in MacPython).

That's very odd. I did notice that the LaunchServices doc said GURL,
but I had been assuming that the Apple Events documentation (which
says gurl) was correct.

Thanks again. It's always good to have confirmation about exactly
where I'm going wrong :)

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] noob question: handling protocols and files

2005-08-07 Thread Kevin Dangoor
On 8/7/05, Ronald Oussoren <[EMAIL PROTECTED]> wrote:
> > Here's the objC example from Apple's doc:
> > [appleEventManager setEventHandler:self
> > andSelector:@selector(handleGetURLEvent:withReplyEvent:)
> > forEventClass:kAEInternetSuite andEventID:kAEISGetURL];
> >
> > Here's my translation to Python:
> > sel = objc.selector
> > (MacController.handleGetURLEvent_withReplyEvent_,
> > signature="vO:O:")
> >
> > aem.setEventHandler_andSelector_forEventClass_andEventID_(self,
> > sel,
> > 1735750252L, 1735750252L)
> 
> 
> That's very wrong. You shouldn't call objc.selector unless you're
> defining a new method (in a class definition on the argument for
> objc.classAddMethods). The call to objc.selector should be in the
> class definition of MacController.

I was confused by @selector(handleGetURLEvent:withReplyEvent:) and the
error message I got when I tried my first intuition. My first attempt
was to just pass my Python method, but that complained saying that SEL
was expected instead of an instance method.

I really don't think I would have guessed to pass a string with the
selector name. That and the use of GURL instead of gurl was all it
took to get my program called at the right time.

The PyObjC examples are hugely useful, so this is a great addition to
the pydoc example.

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] noob question: handling protocols and files

2005-08-07 Thread Kevin Dangoor
On 8/7/05, Bob Ippolito <[EMAIL PROTECTED]> wrote:
> > I was confused by @selector(handleGetURLEvent:withReplyEvent:) and the
> > error message I got when I tried my first intuition. My first attempt
> > was to just pass my Python method, but that complained saying that SEL
> > was expected instead of an instance method.
> 
> That should've worked.
> 
> > I really don't think I would have guessed to pass a string with the
> > selector name. That and the use of GURL instead of gurl was all it
> > took to get my program called at the right time.
> 
> Selectors themselves are just interned char*

Ahh... That I wouldn't have guessed. That's good to know.

That might also explain the error I got about passing an instance
method when a SEL was expected. I seem to remember getting that error
while doing some exploration at the Python prompt. It's entirely
possible that the method I was passing at that time was not properly
named for a selector.

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] py2app trying to create a symlink that already exists

2005-08-12 Thread Kevin Dangoor
I believe I ran into this before, but I didn't document it properly so
I'm doomed to repeat it. (I'll document it this time!)

I have an app that is running fine (and py2app is building it fine) on
Tiger. I'm working on getting a Panther build put together. On both
Tiger and Panther, I'm using Bob's unofficial official Python 2.4.1.
I'm using PyObjC 1.3.7 (downloaded the package for Panther, built from
source for Tiger), and the included py2app (0.2.1).

I'm using the embedded version of the Firebird database, and that is
where the problem is coming in. I built Firebird myself on both Tiger
and Panther. I've looked at /Library/Frameworks/Firebird.framework in
both and they look the same. So, now to what the problem is...

Looking through py2app's output, the first framework copied is
Firebird.framework, picked up as a dependency of kinterbasdb. As
py2app continues copying stuff over, it eventually hits
linking 
/Users/taz/projects/app/dist/myapp.app/Contents/Frameworks/Firebird.framework/Firebird
-> Versions/Current/Firebird

which runs into this problem:
  File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/py2app/py2app/build_app.py",
line 1064, in copy_tree
condition=condition)
  File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/py2app/py2app/util.py",
line 351, in copy_tree
os.symlink(link_dest, dst_name)
OSError: [Errno 17] File exists
> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/py2app/py2app/util.py(351)copy_tree()

Look at what's in myapp.app, the Firebird.framework in there doesn't
have a Versions/Current yet. It does, however, have a Firebird at the
top of the framework directory, which is not a symlink but the real
file. In my Tiger build, that Firebird at the top is a symlink to
Versions/Current/Firebird, which is also the case in
/Library/Frameworks/Firebird.framework on both machines.

I seem to remember seeing this problem when I first started using
Firebird, and I really wish I had written down how the problem was
solved. I did a clean checkout and build under Tiger to ensure that
the two OSes are really running the same things.

Any ideas?

Thanks!
Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] py2app trying to create a symlink that already exists

2005-08-16 Thread Kevin Dangoor
Following up to my own message. I just got back to looking at this
again this morning and managed to fix it. I don't have the full
answer, but thought I would post what I do know.

This morning, I spotted a couple of things.

1) the unnecessary bin directory was still in the Firebird.framework
on my Panther drive. I didn't run otool to see if any of those were
pointing at suspect things.

2) there was a copy of Firebird.framework already in the
build/bdist directory. Deleting that ultimately fixed the problem.
Creating an embedded Firebird on the Mac is a manual process right
now, so it's possible or even likely that the Firebird copy in there
was not in the final state.

The files in the Firebird.framework directory under build were not
symlinked in the same way as the ones in /Library/Firebird.framework.
So, py2app was copying over that one with real files, and then later
tried to copy from /Library/Firebird.framework which had symlinks in
place of some of those files. That's where it failed, because
copy_tree doesn't overwrite files with symlinks.

Kevin

On 8/12/05, Kevin Dangoor <[EMAIL PROTECTED]> wrote:
> I'm using the embedded version of the Firebird database, and that is
> where the problem is coming in. I built Firebird myself on both Tiger
> and Panther. I've looked at /Library/Frameworks/Firebird.framework in
> both and they look the same. So, now to what the problem is...
> 
> Looking through py2app's output, the first framework copied is
> Firebird.framework, picked up as a dependency of kinterbasdb. As
> py2app continues copying stuff over, it eventually hits
> linking 
> /Users/taz/projects/app/dist/myapp.app/Contents/Frameworks/Firebird.framework/Firebird
> -> Versions/Current/Firebird
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Python 2.4.1 not replacing earlier versions.

2005-08-31 Thread Kevin Dangoor
On 8/31/05, Simon Brunning <[EMAIL PROTECTED]> wrote:
> On 8/31/05, Craig Amundsen <[EMAIL PROTECTED]> wrote:
> > Did you mean #! /usr/local/bin/python
> > or  #! /usr/local/bin python ?
> 
> I meant the latter - the first version works for me too. Thanks.
> 
> I extrapolated "#! /usr/local/bin python" from the shebang line that
> ran stuff with the OS's version of Python, "#!/usr/bin/env python".
> Clearly, I don't have a clue as yet. ;-)

#!/usr/bin/env python

is actually saying to invoke the "env" command (you can type 'man env'
to see what that command's all about). This particular usage of env
does not actually do anything of value, as far as I can see. You could
have gotten the equivalent working with your python of choice by doing
this:

#!/usr/bin/env /usr/local/bin/python

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Speed up Python on the Mac?

2005-12-06 Thread Kevin Dangoor
> On Dec 6, 2005, at 11:07 AM, Louis Pecora wrote:
>
>
> I see there are many other approaches (SWIG, Pyrex, Psyco -- some may
>
> not be available on the Mac), so I thought I would start here to ask
>
> what people in this email list use and recommend.

Earlier in the year, Phillip Eby was optimizing his RuleDispatch
package. There were many tweaks he was able to do *completely in
Python* that resulted in a decent speedup. Here's one of his posting
on the topic:

http://dirtsimple.org/2005/02/optimization-surprises.html

Pyrex works on the Mac:
http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/

Kevin
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig