Skip to content

Configure will exception if a property has no initial value is defined #2

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

Open
btgoodwin opened this issue Jun 26, 2015 · 0 comments
Open

Comments

@btgoodwin
Copy link

Simple string properties on Components (and Devices) up through REDHAWK 1.10.2 that have no default value result in queryValue() returning None. This causes line model/redhawk.py line 109 to throw an exception. Refactoring to use the TYPE_MAP in ossie.utils prop_helper can solve the problem:

from ossie.utils import prop_helper

...

@background_task
def component_configure(self, domain_name, app_id, comp_id, new_properties):
    dom = self._get_domain(domain_name)
    comp = dom.find_component(app_id, comp_id)

    configure_changes = {}
    for prop in comp._properties:
        if prop.id in new_properties:
            if new_properties[prop.id] != prop.queryValue():
                TYPE = prop_helpers.TYPE_MAP.get(prop.type, [type(prop.queryValue())])
                configure_changes[prop.id] = (TYPE[0])(new_properties[prop.id])
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