[Pythonmac-SIG] Python+Automator?

Bob Ippolito bob at redivi.com
Mon Jan 24 21:42:31 CET 2005


On Jan 24, 2005, at 2:52 PM, has wrote:


> Bob wrote:
>
>>> It's a question of marketing really: what type(s) of audience do you 
>>> wish to promote Python to, and what needs to be done to guarantee 
>>> each's capture?
>>
>> From the public documentation, you would trivially construct an 
>> Action in PyObjC with the following boilerplate:
>>
>> # MyAction.py
>> from Foundation import *
>> class MyAction(NSObject):
>>     def runWithInput_fromAction_error_(self, theInput, anAction):
>>         if somethingBadHappens:
>>             result = None
>>             error = someNSError
>>         else:
>>             result = [some output]
>>             error = None
>>         return result, error
>>
>> Is that so overwhelming?
>
> For you, not in the slightest. For me, well I've been doing this 
> Python thing a year now so think I can probably cope. So that's the 
> professional and hack markets covered.

That is the raw boilerplate for using the documented interface as-is.  
You could of course wrap that six ways to sunday if you wanted it to 
catch exceptions and throw an error automatically, or whatever.

I didn't present such a cleaned up interface because there isn't enough 
public information available to present an Automator interface that 
makes sense in that regard.  This is simply a good approximation of 
what the boilerplate will look like that *directly* interfaces with the 
documented Objective-C interface for Actions.  This means no middle-man 
whatsoever beyond the runtime bridge, no code written by anyone else, 
nothing but PyObjC 1.2 installed.

> Now, what about the newbies, the new blood? The folks who are complete 
> newcomers to Python and/or to programming in general? Try to see it 
> from their point of view:

Personally, I'd rather not be bothered catering to that class of users. 
  I'm more interested in making the things work correctly for the people 
who DO know what they're doing.  There are lots of people with more 
interest in making possible things easier, such as yourself, but I'm 
more inclined to expand what is possible in the first place (in my 
spare time anyway)... with occasional bouts of cleaning things up and 
hand-holding (writing documentation, speaking at PyCon, doing a 
tutorial now and then, answering the mailing lists, setting up 
websites, releasing software, etc.).

-bob


More information about the Pythonmac-SIG mailing list