[Pythonmac-SIG] Any suggestions for a questionnaire site?

2005-01-14 Thread Jack Jansen
Folks,
I want to do a questionnaire shortly, on the subject of which 
installers people want most (2.{3,4}.X for 10.{2,3}, mainly).
That'll help me spend my time most efficiently (my MacPython time, that 
is:-)

Does anyone know of a decent site that hosts such questionnaires that 
is both easy to use and cheap (preferably free:-)?
--
Jack Jansen, <[EMAIL PROTECTED]>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma 
Goldman

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


Re: [Pythonmac-SIG] Folder Actions in Python?

2005-01-14 Thread Michael J. Barber
You could write a folder action in AppleScript that uses "do shell 
script" in the Standard Additions to call out to a python script. The 
amount of AppleScript needed should be pretty minimal.

On Jan 13, 2005, at 8:03 PM, Wolfgang Keller wrote:
Is there a way to write "folder actions" for MacOS X in Python? I would
guess to enable this the corresponding script would at least have to be
applescript-able itself...?
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Python access to RS-232, USB, MIDI?

2005-01-14 Thread Arthur Elsenaar
On Jan 14, 2005, at 02:10, Lance Boyle wrote:
I'm brainstorming on a project that involves communicating with a head 
tracker (I need only azimuth). I haven't decided on an actual head 
tracker, but am looking at a Polhemus. (Comments on head trackers are 
also welcomed--gaming devices or 3D mice?)

It looks like that I might need to communicate via RS-232 or USB (is 
there a MIDI tracker?). I want to keep this simple and clobber the 
problem with minimum fuss, so naturally I think of Python, 
AppleScript, etc. I'm pretty much a neophyte with such things 
(although I wrote a 3D plotting program for a Tektronix pen plotter a 
_long_ time ago).
Have a look at what http://www.makingthings.com has to offer. They 
built really nice IO modules (USB, serial, etc.) for mere mortals (read 
artists) that hook up to almost anything from Flash to Max/MSP, Java, 
C, etc. I haven't checked recently if there's a python binding already, 
but it shouldn't be hard for an experienced programmer to create.

We've had great success with our art students working with these 
modules.

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


Re: [Pythonmac-SIG] Any suggestions for a questionnaire site?

2005-01-14 Thread Dethe Elza
Jack,
No personal experience with these, but a quick google shows:
http://free-online-surveys.co.uk/
http://freesurveysonline.com/
http://freeonlinesurveys.com/
No idea how reputable any of these are...
If all you want is a simple poll, my livingcode.org site is running on 
DreamHost, which offers a polling component.  I haven't tried it, but 
I'd be willing to figure it out and host the poll.

I seem to remember Sourceforge-hosted sites with polls, but I can't 
find any info on Sourceforge about their support for it.

HTH
--Dethe
There are only two industries that call their customers "users"


smime.p7s
Description: S/MIME cryptographic signature
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] Anyone script ChemDraw w/ Python?

2005-01-14 Thread fbartlet
Gentlefolk,

I have a mess of VBA and AppleScript scripts I wrote to automate Word & 
ChemDraw tasks. Now that everyone who needs this stuff has access to OS X, I 
thought I might try Python to make some improvements I've been asked for and 
which VBA and AppleScript don't seem to be able to deliver.

While I've used Python to script Word under Windows, I'm not terribly 
knowledgeable about Macs; so any and all clues will be received gratefully.

Thanks,
Fred

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


Re: [Pythonmac-SIG] Any suggestions for a questionnaire site?

2005-01-14 Thread Bob Ippolito
On Jan 14, 2005, at 9:58, Dethe Elza wrote:
No personal experience with these, but a quick google shows:
http://free-online-surveys.co.uk/
http://freesurveysonline.com/
http://freeonlinesurveys.com/
No idea how reputable any of these are...
If all you want is a simple poll, my livingcode.org site is running on 
DreamHost, which offers a polling component.  I haven't tried it, but 
I'd be willing to figure it out and host the poll.
pythonmac.org is also on DreamHost, and I'd do the same.
-bob

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


[Pythonmac-SIG] Using .pth to adjust Python on startup

2005-01-14 Thread Robert White
Last night, while researching a different problem, I ran across the usage of 'import' within ".pth" to run arbitrary code as the Python environment is being initialized.  I believe that this provides an alternative to using PYTHONPATH and possibly some of the other environment variables via  "~/.MacOSX/environment.plist".  Is this correct?  If so, I will document it as such in the wiki.  Thanks for your help.

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


Re: [Pythonmac-SIG] Folder Actions in Python?

2005-01-14 Thread has
Wolfgang Keller wrote:
Is there a way to write "folder actions" for MacOS X in Python?
Ideally, you'd use PythonOSA 
, but it doesn't 
yet support handling of arbitrary Apple events. For now, your options 
are:

1. Use an AppleScript to run your Python scripts via 'do shell 
script' when it receives Folder Action events.

2. Use an AppleScript to forward Folder Action events to a faceless 
background application (FBA). Scriptable FBAs are easy enough to 
write in Python using aem.receive (see 
).

BTW, the second option could be extended to create a general-purpose 
system for forwarding Folder Actions to user-installed shell scripts 
of any kind. If anyone is interested in writing such a thing, email 
me and I'll be happy to discuss further.

has
--
http://freespace.virgin.net/hamish.sanderson/
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Using .pth to adjust Python on startup

2005-01-14 Thread Bob Ippolito
On Jan 14, 2005, at 13:29, Robert White wrote:
Last night, while researching a different problem, I ran across the 
usage of 'import' within ".pth" to run arbitrary code as the Python 
environment is being initialized.  I believe that this provides an 
alternative to using PYTHONPATH and possibly some of the other 
environment variables via  "~/.MacOSX/environment.plist".  Is this 
correct?  If so, I will document it as such in the wiki.  Thanks for 
your help.
.pth files *without* using the import statement are a replacement for 
PYTHONPATH.  These .pth files get processed every time that site.py 
runs, which happens for more cases than just the interactive prompt 
(i.e. it is not a replacement for .pythonrc).  The fact that they can 
use import statements is a cute trick, but shouldn't be used very often 
-- I only use it to make "deep" sys.path modifications when necessary, 
such as to override parts of the standard library.

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


Re: [Pythonmac-SIG] Anyone script ChemDraw w/ Python?

2005-01-14 Thread has
fbartlet wrote:
I have a mess of VBA and AppleScript scripts I wrote to automate 
Word & ChemDraw tasks. Now that everyone who needs this stuff has 
access to OS X, I thought I might try Python to make some 
improvements I've been asked for and which VBA and AppleScript don't 
seem to be able to deliver.
Depends on the reason _why_ they can't deliver. If the limitation is 
in the application APIs, there's not much you can do about that 
except file a feature request with the application developer. But if 
it's just the language that's being lame and obnoxious then you can 
probably do something about that by switching to Python. Here's a 
link to Python's new application scripting support package (c/o yours 
truly):

http://freespace.virgin.net/hamish.sanderson/appscript.html

While I've used Python to script Word under Windows, I'm not 
terribly knowledgeable about Macs; so any and all clues will be 
received gratefully.
Word 2004 has a much expanded Apple event interface compared to 
previous versions. I think it's basically just a thin wrapper around 
the API used by VBA, so not very Mac-like but pretty comprehensive.

The MacScrpt mailing list 
 
has various crusty old application scripters who can advise on 
application-specific issues. Paul Berkowitz might be a particularly 
good person to answer Word scripting questions as he does a lot of 
scripting of Office apps (he sometimes posts on this list as well, so 
say his name three times and maybe he'll appear;).

I've yet to write up a proper introduction to Mac application 
scripting and appscript, but if you dig around the PythonMac SIG 
archives there's been a few threads discussing application scripting 
theory and principles. And if you're familiar with AppleScript then 
you shouldn't have any problems with appscript - the syntactic sugar 
is slightly different, but it behaves just about the same - see the 
appscript documentation for caveats and instructions.

HTH
has
--
http://freespace.virgin.net/hamish.sanderson/
___
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 Bob Ippolito
The issue you're having sounds like it's either something really easy 
or really hard to fix.  If you post code I'll track it down, but I 
don't have the time this weekend to debug-by-mail.

Your crash aside, it should be done in this order:
1) Install cfreactor
2) Load up all the classes
3) AppHelper.runEventLoop
4) From 'applicationDidFinishLaunching:' do any Twisted stuff.  You 
*should* call reactor.run() at the end.  It doesn't actually block 
because it integrates into the NSRunLoop, but it should still be 
called.

-bob
On Jan 14, 2005, at 15:32, Kevin Dangoor wrote:
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 Bob Ippolito
(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
On Jan 14, 2005, at 15:32, Kevin Dangoor wrote:
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
___
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 Bob Ippolito
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] Namespace conflict with WebWare and PyObjC / Import safety (Was: how do I use twisted cfreactor?)

2005-01-14 Thread Bob Ippolito
On Jan 14, 2005, at 17:14, Bob Ippolito wrote:
On Jan 14, 2005, at 16:56, Kevin Dangoor wrote:
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.
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...
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.
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] 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] Cheetah Templates and py2app (Was: how do I use twisted cfreactor?)

2005-01-14 Thread Bob Ippolito
Somebody else had a Cheetah and template issue with py2app.  The custom 
import hook is not recognized by py2app and I have no interest in 
writing that kind of Cheetah-specific stuff at this time (I don't use 
it, and I actually really don't like anything about it).  The person 
who had that problem managed to precompile the tempates into .pyc or 
something with some facility that comes with Cheetah or WebWare, which 
py2app could handle just fine.  I have no idea if this discussion was 
had on pythonmac-sig, pyobjc-dev, or #macpython, but that's what I 
remember of it.

-bob
On Jan 14, 2005, at 21:28, Kevin Dangoor wrote:
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