Skip to content

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

Description

@btgoodwin

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()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions