Best Python code snippet using localstack_python
main.py
Source:main.py
...106 # settings.add_json_panel('My Label', self.config, 'settings.json')107 settings.register_type('drivepath', drivepathsetting.SettingDrivePath)108 settings.register_type('drivepath_short', drivepathsetting.SettingDrivePathShort)109 settings.add_json_panel('My Label', self.config, data=json)110 def on_config_change(self, config, section, key, value):111 """112 Respond to changes in the configuration.113 """114 Logger.info("main.py: App.on_config_change: {0}, {1}, {2}, {3}".format(115 config, section, key, value))116 if section == "My Label":117 if key == "text":118 self.root.ids.label.text = value119 elif key == 'font_size':120 self.root.ids.label.font_size = float(value)121 def close_settings(self, settings=None):122 """123 The settings panel has been closed.124 """125 Logger.info("main.py: App.close_settings: {0}".format(settings))126 super(MyApp, self).close_settings(settings)127class MySettingsWithTabbedPanel(SettingsWithTabbedPanel):128 """129 It is not usually necessary to create subclass of a settings panel. There130 are many built-in types that you can use out of the box131 (SettingsWithSidebar, SettingsWithSpinner etc.).132 You would only want to create a Settings subclass like this if you want to133 change the behavior or appearance of an existing Settings class.134 """135 def on_close(self):136 Logger.info("main.py: MySettingsWithTabbedPanel.on_close")137 def on_config_change(self, config, section, key, value):138 Logger.info(139 "main.py: MySettingsWithTabbedPanel.on_config_change: "140 "{0}, {1}, {2}, {3}".format(config, section, key, value))...
kivy_settings_explore.py
Source:kivy_settings_explore.py
...67 # We use the string defined above for our JSON, but it could also be68 # loaded from a file as follows:69 # settings.add_json_panel('My Label', self.config, 'settings.json')70 settings.add_json_panel('My Label', self.config, data=json)71 def on_config_change(self, config, section, key, value):72 """73 Respond to changes in the configuration.74 """75 Logger.info("main.py: App.on_config_change: {0}, {1}, {2}, {3}".format(76 config, section, key, value))77 if section == "My Label":78 if key == "text":79 self.root.ids.label.text = value80 elif key == 'font_size':81 self.root.ids.label.font_size = float(value)82 def close_settings(self, settings=None):83 """84 The settings panel has been closed.85 """86 Logger.info("main.py: App.close_settings: {0}".format(settings))87 super(MyApp, self).close_settings(settings)88class MySettingsWithTabbedPanel(SettingsWithTabbedPanel):89 """90 It is not usually necessary to create subclass of a settings panel. There91 are many built-in types that you can use out of the box92 (SettingsWithSidebar, SettingsWithSpinner etc.).93 You would only want to create a Settings subclass like this if you want to94 change the behavior or appearance of an existing Settings class.95 """96 def on_close(self):97 Logger.info("main.py: MySettingsWithTabbedPanel.on_close")98 def on_config_change(self, config, section, key, value):99 Logger.info(100 "main.py: MySettingsWithTabbedPanel.on_config_change: "101 "{0}, {1}, {2}, {3}".format(config, section, key, value))...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!