diff options
author | Brad Bishop <bradleyb@us.ibm.com> | 2016-08-31 12:37:35 -0400 |
---|---|---|
committer | Brad Bishop <bradleyb@us.ibm.com> | 2016-08-31 13:41:51 -0400 |
commit | 2a9fe6674a3499db33cdb8dd32e03e2f039e42dd (patch) | |
tree | 5011df99d216f9f4bef74104d61e47133b22aa8b /settings_manager.py | |
parent | 3322ff42d710729eb33d66624123f909650f2a11 (diff) | |
download | phosphor-settingsd-2a9fe6674a3499db33cdb8dd32e03e2f039e42dd.tar.gz phosphor-settingsd-2a9fe6674a3499db33cdb8dd32e03e2f039e42dd.zip |
manager: pep8 fixes
Change-Id: I3457da41acb1ed9e21c2c83f4a6e4509a79f71f7
Signed-of-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'settings_manager.py')
-rw-r--r-- | settings_manager.py | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/settings_manager.py b/settings_manager.py index d667a86..b990f21 100644 --- a/settings_manager.py +++ b/settings_manager.py @@ -13,6 +13,7 @@ DBUS_NAME = 'org.openbmc.settings.Host' OBJ_NAME = '/org/openbmc/settings/host0' CONTROL_INTF = 'org.openbmc.Settings' + class HostSettingsObject(DbusProperties): def __init__(self, bus, name, settings, path): DbusProperties.__init__(self) @@ -23,10 +24,11 @@ class HostSettingsObject(DbusProperties): os.mkdir(path) # Listen to changes in the property values and sync them to the BMC - bus.add_signal_receiver(self.settings_signal_handler, - dbus_interface = "org.freedesktop.DBus.Properties", - signal_name = "PropertiesChanged", - path = "/org/openbmc/settings/host0") + bus.add_signal_receiver( + self.settings_signal_handler, + dbus_interface="org.freedesktop.DBus.Properties", + signal_name="PropertiesChanged", + path="/org/openbmc/settings/host0") # Create the dbus properties for i in settings['host'].iterkeys(): @@ -43,17 +45,19 @@ class HostSettingsObject(DbusProperties): pass return None - # Create dbus properties based on bmc value. This will be either a value - # previously set, or the default file value if the BMC value does not exist. + # Create dbus properties based on bmc value. + # This will be either a value previously set, + # or the default file value if the BMC value + # does not exist. def set_settings_property(self, name, type, value): bmcv = self.get_bmc_value(name) if bmcv: value = bmcv - if type=="i": + if type == "i": self.Set(DBUS_NAME, name, value) - elif type=="s": + elif type == "s": self.Set(DBUS_NAME, name, str(value)) - elif type=="b": + elif type == "b": self.Set(DBUS_NAME, name, value) # Save the settings to the BMC. This will write the settings value in @@ -67,7 +71,8 @@ class HostSettingsObject(DbusProperties): # Signal handler for when one ore more settings properties were updated. # This will sync the changes to the BMC. - def settings_signal_handler(self, interface_name, changed_properties, invalidated_properties): + def settings_signal_handler( + self, interface_name, changed_properties, invalidated_properties): for name, value in changed_properties.items(): self.set_system_settings(name, value) @@ -86,4 +91,3 @@ if __name__ == '__main__': print "Running HostSettingsService" mainloop.run() - |