[Pythonmac-SIG] creating file associations with apps via bundlebuilder?

Bob Ippolito bob at redivi.com
Wed Aug 18 17:54:58 CEST 2004


On Aug 18, 2004, at 11:37 AM, Kevin Altis wrote:

> On Aug 18, 2004, at 7:54 AM, Kevin Altis wrote:
>
>> On Aug 17, 2004, at 11:10 PM, Bob Ippolito wrote:
>>
>>> On Aug 17, 2004, at 8:50 PM, Kevin Altis wrote:
>>>
>>>> I have a few bundlebuilder scripts that all seem to be making  
>>>> standalones from my PythonCard/wxPython scripts just fine, so  
>>>> thanks to Bob, etc. for that. However, I can't figure out what I  
>>>> need to do to get file extension assocations for those apps. For  
>>>> example, the CodeEditor standalone should be able to open .txt,  
>>>> .text, .xml, .htm, .html, .py, and .pyw at a minimum. If I try and  
>>>> choose the CodeEditor app I built via the Finder Get Info dialog  
>>>> with a .py file it doesn't think CodeEditor is a recommended  
>>>> application. So, I'm assuming there is some .plist file I have to  
>>>> create as well or do some other magic?
>>>
>>> Yes, Info.plist.  It's not magic, everything that LaunchServices  
>>> knows about is in that one file.
>>>
>>> http://developer.apple.com/documentation/MacOSX/Conceptual/ 
>>> BPRuntimeConfig/Concepts/PListKeys.html#//apple_ref/doc/uid/ 
>>> 20001431/TPXREF107
>>>
>>> -bob
>>>
>> Thanks. I cobbled together my own Info.plist file using PythonIDE and  
>> SubEthaEdit and the doc page as examples. I have a script that I've  
>> been using to make the standalone rather than providing a whole lot  
>> of command-line args to bundlebuilder. I've included the script below  
>> in case it points out some fundamental mistake on my part. I can't  
>> figure out a way to provide my own Info.plist file as a variable.  
>> Glancing at the bundlebuilder.py script it looks like I would have to  
>> read in and parse the Info.plist file using plistlib.PlistParser  
>> before setting the parsed XML to myapp.plist? Is there another way?
>>
> Doh, I wasn't paying attention to the optional arg handling.  
> Plist.fromFile does the trick.
>
> myapp.plist = bundlebuilder.Plist.fromFile(os.path.join(packageroot,  
> "Info.plist"))

I would say plistlib.Plist ..  bundlebuilder doesn't or shouldn't  
export Plist in its "public API".

-bob



More information about the Pythonmac-SIG mailing list