Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: sandbox launch with initialize=False skips initial properties too #41

Open
btgoodwin opened this issue Jul 9, 2020 · 0 comments
Open

Comments

@btgoodwin
Copy link

The sandbox's sb.launch has this to say about the initialize argument:

      initialize   - If true, call initialize() after launching the component.
                     If false, defer initialization to the caller.

The true statement leads one to believe that if you set initialize=False, then your next step would be <thing>.initialize(). However that's not true. In ossie/utils/sandbox/local.py:314 (def setup()...), we can see that another critical step gets skipped when that argument is False: initializing initial property values.

Per the documentation above, the setup method should be setting those initial properties and then skip only the initialize() call if the argument is False, like this:

    def setup(self, comp):
        # Set initial property values for 'property' kind properties
        initvals = comp._getInitializeProperties()
        initvals.update(self._initProps)
        try:
            comp.initializeProperties(initvals)
        except:
            log.exception('Failure in component property initialization')

        if self._initialize:
            # Actually initialize the component
            comp.initialize()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant