Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Updated] Simplify and fix weather plugin icons rendering #676

Merged
merged 2 commits into from
Aug 5, 2024

Conversation

DimitarCC
Copy link
Contributor

No description provided.

Copy link

sonarcloud bot commented Aug 5, 2024

@Huevos Huevos merged commit 75d83cd into oe-alliance:master Aug 5, 2024
7 checks passed
@jbleyel
Copy link
Contributor

jbleyel commented Aug 23, 2024

Crash:

15:15:10.2673 File "/usr/lib/enigma2/python/Screens/Screen.py", line 141, in hide
15:15:10.2677 File "/usr/lib/enigma2/python/Components/Renderer/Renderer.py", line 14, in onHide
15:15:10.2680 File "/usr/lib/enigma2/python/Components/Element.py", line 67, in setSuspend
15:15:10.2683 File "/usr/lib/enigma2/python/Components/Renderer/MSNWeatherPixmap.py", line 45, in doSuspend
15:15:10.2686 File "/usr/lib/enigma2/python/Components/Renderer/MSNWeatherPixmap.py", line 66, in changed
15:15:10.2689 File "/usr/lib/enigma2/python/Components/Renderer/MSNWeatherPixmap.py", line 53, in updateIcon
15:15:10.2692 File "/usr/lib/enigma2/python/Tools/LoadPixmap.py", line 8, in LoadPixmap
15:15:10.2696 TypeError: 'NoneType' object is not subscriptable
15:15:10.2696 [ePyObject] (PyObject_CallObject(<bound method ActionMap.action of <Components.ActionMap.ActionMap object at 0xada1ff60>>,('SetupActions', 'menu')) failed)

@Huevos
Copy link
Member

Huevos commented Aug 23, 2024

Is this crash in OpenATV?

@jbleyel
Copy link
Contributor

jbleyel commented Aug 23, 2024

Yes and in many other images.

@jbleyel
Copy link
Contributor

jbleyel commented Aug 23, 2024

LoadPixmap(None) -> Crash

@DimitarCC
Copy link
Contributor Author

DimitarCC commented Aug 23, 2024 via email

@jbleyel
Copy link
Contributor

jbleyel commented Aug 23, 2024

The question here is why it is None at first place. I guess incorrect path or missing icon...

ba57023

@Huevos
Copy link
Member

Huevos commented Aug 23, 2024

How will that work? Won't it just raise the exception?

https://github.com/openatv/enigma2/blob/master/lib/python/Tools/LoadPixmap.py#L28

@jbleyel
Copy link
Contributor

jbleyel commented Aug 23, 2024

It's only a workaround and quick fix to prevent the crash.
The whole code needs a review but i will not do that.

@Huevos
Copy link
Member

Huevos commented Aug 23, 2024

But it file name is empty it will crash.

@jbleyel
Copy link
Contributor

jbleyel commented Aug 23, 2024

But it file name is empty it will crash.

Then you need to stop calling LoadPixmap if empty.

@Huevos
Copy link
Member

Huevos commented Aug 23, 2024

The None call in the original code was to remove the icon.

@jbleyel
Copy link
Contributor

jbleyel commented Aug 23, 2024

The None call in the original code was to remove the icon.

LoadPixmap(None) ->

15:15:10.2692 File "/usr/lib/enigma2/python/Tools/LoadPixmap.py", line 8, in LoadPixmap
15:15:10.2696 TypeError: 'NoneType' object is not subscriptable

@jbleyel
Copy link
Contributor

jbleyel commented Aug 23, 2024

You need to do this:

self.instance.setPixmap(None)

@jbleyel
Copy link
Contributor

jbleyel commented Aug 23, 2024

	def updateIcon(self, filename):
		new_IconFileName = filename
		if (self.iconFileName != new_IconFileName):
			self.iconFileName = new_IconFileName
			if self.iconFileName:
				self.pix = LoadPixmap(self.iconFileName)
				try:
					self.instance.setPixmapScale(BT_SCALE | BT_KEEP_ASPECT_RATIO)
				except:
					self.instance.setScale(1)
				self.instance.setPixmap(self.pix)
			else:
				self.instance.setPixmap(None)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants