Skip to content
  • Piergiorgio Pancino's avatar
    mapping: changed format string to be sure that we will always have a name for a device · df531401
    Piergiorgio Pancino authored
    * 'class' is equivalent to inst.__class__.__name__
    * renamed 'update_all_keys' to '_update_key_for_nodes' because it really updates 1 key for all nodes
        - added _ to make it a 'protected' member, since it can be dangerous depending which key is updated
    * added 'update_labels' to specifically update labels
        - special case of _update_key_for_nodes
        - the only one used in the code
    * removed default argument for format_node method
        - make caller more responsible of what he wants to format
        - makes code more readable
    * moved subprocess import on top of the file
    * removed unused method: '.get_node_name'
    * replaced 'hasattr' with try...except (better to ask forgiveness than permission)
    * renamed 'name' to 'key' in for loop, not to confuse with name attribute
        - makes code more readable
    df531401