Jump to content


Huevos

Member Since 14 Feb 2012
Offline Last Active Yesterday, 23:36
*****

Posts I've Made

In Topic: Crash log

Yesterday, 13:15

Plugin for testing notifiers:

https://github.com/H...ester/plugin.py


In Topic: Crash log

Yesterday, 13:05

Then in config.py for example ConfigSelection...

 

https://github.com/O...ig.py#L345-L351

	def setValue(self, value):
		if str(value) in map(str, self.choices):
			self._value = self.choices[self.choices.index(value)]
		else:
			self._value = self.default
		self._descr = None
		self.changed()

In that function PLi calls "self.changed()" which triggers all the notifiers, irrespective of whether or not there was actually a change to the value of the config item. So here you have another load of false positives.

 

In images that want to avoid this problem you have something like this:

	def setValue(self, value):
		prev = str(self._value) if hasattr(self, "_value") else None
		if str(value) in map(str, self.choices):
			self._value = self.choices[self.choices.index(value)]
		else:
			self._value = self.default
		self._descr = None
		if prev != str(self._value):
			self.changed()

 


In Topic: Crash log

Yesterday, 12:57

Yep indeed…the real issue is the plugin is poking. The only need for that is making it not compatible with openpli (lol).. And Instill totally do not see not experience any issues with the openpli config code….. as what we do we know when something is changed… when you do it really good then you do it when you leave the focus (up/down/next page/prev page/start/end/green button, leave config)on a specific config and that is not done with the fallback. So as far I can see it is exactly doing the same.

https://github.com/O...st.py#L235-L237

	def keyLeft(self):
		self["config"].handleKey(KEY_LEFT)
		self.__changed()

	def keyRight(self):
		self["config"].handleKey(KEY_RIGHT)
		self.__changed()

	def keyHome(self):
		self["config"].handleKey(KEY_HOME)
		self.__changed()

	def keyEnd(self):
		self["config"].handleKey(KEY_END)
		self.__changed()

	def keyDelete(self):
		self["config"].handleKey(KEY_DELETE)
		self.__changed()

	def keyBackspace(self):
		self["config"].handleKey(KEY_BACKSPACE)
		self.__changed()

	def keyToggleOW(self):
		self["config"].handleKey(KEY_TOGGLEOW)
		self.__changed()

	def keyGotAscii(self):
		self["config"].handleKey(KEY_ASCII)
		self.__changed()

	def keyNumberGlobal(self, number):
		self["config"].handleKey(KEY_0 + number)
		self.__changed()

As you can see in this code PLi calls "self.__changed()" on every key press irrespective of whether the config item actually change. That means in PLi there are false positives. The images that use the callback only call "self.__changed()" when there really is a change.


In Topic: Crash log

8 May 2024 - 17:26

By the way, the real problem is why is that plugin poking around in configlistscreen.

In Topic: Crash log

8 May 2024 - 17:15

You are looking at 2 different problems. One is the notifier. That is handled in config.py with many problems in PLi. The other is the button press is handled in configlistscreen without any knowledge of if the config item changed or not. That is what the callback fixes.