Post
by Emerah » Fri Mar 29, 2013 11:18 am
I have to spend sometime on the new modules to figure out what they do but here are the most obvious changes:
1. the import of the Capabilities module and the addition of the 'get_capabilities' function in the __init__.py module
2. the import of the 'with_statement' from __future__ module in the main script (must be imported on the 1st line of the script)
3. the use of 'with component_guard()' function under class __init__
4. the use of decorators like '@'
a quick remedy to L8 scripts is to add the with_statement import on the 1st line of the script like this:
from __future__ import with_statement
now under 'def __init__(self, c_instance)' add 'with component_guard()' like this:
class 'scriptName'(ControlSurface):
----def __init__(self, c_instance):
--------ControlSurface.__init__(self, c_instance)
--------with self.component_guard():
------------"continue writing your variables"
the decompiled L9 scripts are available here (search the forum if you don't have them already), take a look at any of the scripts for good examples. of course this is only what my eyes caught so far.
it never ends. neither does it begin where you think it does. its only in your mind.