Re: [Pythonmac-SIG] Building a PreferencePane with PyObjC?

2009-04-20 Thread Bill Janssen
Ronald Oussoren ronaldousso...@mac.com wrote:

 If you don't add the IBAction decorator Interface Builder won't show
 your action methods as actions when you ctrl-drag a connection to an
 instance of your class.

Thanks, Ronald.

So this is part of what IB looks for when you tell it to scan the class
files.  I've been adding the actions myself manually to the class in IB,
before ctrl-dragging the connection, which is another way of doing it but
laborious.

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


Re: [Pythonmac-SIG] Building a PreferencePane with PyObjC?

2009-04-20 Thread Ronald Oussoren


On 20 Apr, 2009, at 17:24, Bill Janssen wrote:


Ronald Oussoren ronaldousso...@mac.com wrote:


If you don't add the IBAction decorator Interface Builder won't show
your action methods as actions when you ctrl-drag a connection to an
instance of your class.


Thanks, Ronald.

So this is part of what IB looks for when you tell it to scan the  
class
files.  I've been adding the actions myself manually to the class in  
IB,
before ctrl-dragging the connection, which is another way of doing  
it but

laborious.


That right. Interface Builder looks for the IBAction decorator to  
define outlets and IBOutlet definitions to define outlets:


class MyController (NSObject):

outlet = objc.IBOutlet()

@objc.IBAction
def myAction_(self, sender): pass

Ronald



Bill




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


Re: [Pythonmac-SIG] Use Setup.py to install to /usr

2009-04-20 Thread Christopher Barker

Pascal Schaedeli wrote:
Here is the temporary solution I've found for my case. Still looking for 
better suggestions.


my main suggestion is to don't do that. A few notes:

1) Ned's right -- DO NOT put stuff in /usr/lib -- use /usr/local/lib, if 
at all.


To recap, my problem is that by default, python setup.py install 
places all files under 
/Library/Frameworks/Python.framework/Versions/Current/bin/.


Right, that's the whole point of distutils -- it installs stuff where it 
belongs for the python the setup,oy is run with. If all else fails, you 
could do:


setup.py build

then hand-copy everything where you want it.

Unfortunately, sys.prefix is 
/Library/Frameworks/Python.framework/Versions/2.5, so the necessary 
imports in /usr/lib/python2.5/site-packages are never found (didn't 
research further, but this is probably a python compile time option).


it's doing the right thing -- you are trying to do something odd, so 
you'll need to add the extra path yourself.



I did two manual adjustments:

* Moved necessary imports from /usr/lib/python2.5/site-packages to
  /usr/lib/site-python to remove the python version specificity.


Bad idea -- version specificity is there for a reason -- 2.x and 2.x+n 
are not necessarily fully compatibile -- definitely not if they have any 
compiled extensions



  Let me know if there is any way to achieve this with setup.py.


I don't think so.


* Added /usr/lib/site-python to PYTHONPATH environment variable.


I dont like using PYTHONPATH -- it's global to ALL pythons, which can 
cause trouble.


Rather, I'd use a *.pth file, put in /Library/./site-packages. 
You can look at wxPython for an example, it uses a *.pth file to add 
paths in /usr/local so that the python,org an Apple pythons can share 
the same wxPython install -- note that those are both 2.5, though.



I'm still not sure what problem you are trying to solve. If you install 
in the usual way, and upgrade form 2.5.x to 2.5.x+1, it will just work.


If you upgrade to 2.6.*, it probably will need a new install of your 
package anyway.



 in order to be able to upgrade or switch to another
python version without affecting the availability of duplicity.


You can install a new python, and keep the old one around, so that it 
will still be able to run old code, so this may be a non-issue anyway.


-Chris




--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

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