MCPcopy Create free account
hub / github.com/pyload/pyload / reloadSection

Method reloadSection

module/gui/SettingsWidget.py:106–125  ·  view source on GitHub ↗
(self, sections, pdata)

Source from the content-addressed store, hash-verified

104 self.sections = {}
105
106 def reloadSection(self, sections, pdata):
107
108 for k, section in enumerate(pdata):
109 if k in sections:
110 widget = sections[k]
111 for item in section.items:
112 if item.name in widget.inputs:
113 i = widget.inputs[item.name]
114
115 if item.type == "int":
116 i.setValue(int(item.value))
117 elif not item.type.find(";") == -1:
118 i.setCurrentIndex(i.findText(item.value))
119 elif item.type == "bool":
120 if True if item.value.lower() in ("1","true", "on", "an","yes") else False:
121 i.setCurrentIndex(0)
122 else:
123 i.setCurrentIndex(1)
124 else:
125 i.setText(item.value)
126
127
128 def saveConfig(self):

Callers 1

loadConfigMethod · 0.95

Calls 1

findMethod · 0.45

Tested by

no test coverage detected