[Pythonmac-SIG] appscript terminology caching

Bob Ippolito bob at redivi.com
Tue Oct 19 17:51:28 CEST 2004


On Oct 19, 2004, at 11:44, Eric Nieuwland wrote:

> On 19-okt-04, at 17:15, Bob Ippolito wrote:
>> On Oct 19, 2004, at 11:03, Eric Nieuwland wrote:
>>> On 19-okt-04, at 15:15, Bob Ippolito wrote:
>>>> On Oct 19, 2004, at 4:51, Eric Nieuwland wrote:
>>>>> On 18-okt-04, at 11:21, Jack Jansen wrote:
>>>>>> On 18 Oct 2004, at 00:47, Eric Nieuwland wrote:
>>>>>>> How will the caching system handle updates to an application of 
>>>>>>> which the terminology is cached?
>>>>>>
>>>>>> That's one of the problems we're trying to sort out. Has wants to 
>>>>>> do it automatically whereas Bob and myself seem to tend towards a 
>>>>>> more manual solution, whereby the script writer somehow 
>>>>>> explicitly triggers it.
>>>>>
>>>>> Why not add a parameter to the indicate whether or not to check 
>>>>> for changes if the terminology is cached?
>>>>> You'll have to rely on version numbers in the app to decide if the 
>>>>> app was updated, but that should be OK.
>>>>
>>>> The reason cached terminologies are useful is because *asking* for 
>>>> terminologies is slow.  If you have to ask if it's updated, you 
>>>> might as well not have cached it in the first place.  If you don't 
>>>> ask if it's updated, then it's impossible to know for sure whether 
>>>> or not your cached terminology is stale.
>>>
>>> OK. But to check the version you can access the app's Info.plist. Is 
>>> that slow as well?
>>
>> Info.plist isn't guaranteed to change when the application does.  
>> Heck, it's not even totally guaranteed to exist (remote apple events, 
>> CFM apps, OS9 apps running in Classic).
>
> Would adding a parameter with values 'always', 'if there is none', 
> 'never' to control when the terminology is to be generated do the 
> trick?

How is that better than having the option to explicitly "freeze" a 
terminology into an importable python module?

Remember - the ONLY reason to cache terminologies is to save ~0.5 
seconds per run.  If you have a script that you need to run very often 
or redistribute, you can spend a minute to freeze the terminology.

-bob



More information about the Pythonmac-SIG mailing list