Request.

Dorik1972

Active member
In theory, It should work on both Py2 and Py3 ... Your problem was with incorrect import of the urlopen module and errors in handling the ip-aip.com API response... but the text of the converter code is far away from «pithonical» ... the nonsense in code with popen and wget - I left it as it is -)


p.s. Download & rename to ****.py instead of .txt
 

Attachments

  • GREG_converter.txt
    5 KB · Views: 4

hiuman

Donating Member
Thank you very much. In the evening I will check if it will work and show me the external IP on the skin. I'll write in the evening.
 

hiuman

Donating Member
In theory, It should work on both Py2 and Py3 ... Your problem was with incorrect import of the urlopen module and errors in handling the ip-aip.com API response... but the text of the converter code is far away from «pithonical» ... the nonsense in code with popen and wget - I left it as it is -)


p.s. Download & rename to ****.py instead of .txt
Doesn't work. Does not show external IP.
The original version on OpenATV 6.4 py2 worked very well.
 

Dorik1972

Active member
Does not show external IP.
Not sure. The fact is that I modified the get_myipdata() function so that it would return data received from the ip-api.com API ... Just a minute, I'll add debugging information to the code and show you the output in py3
 

Dorik1972

Active member
On the screenshot is the result of the API request and the response that the function get_myipdata() returns ... Python3
 

Attachments

  • Снимок экрана 2024-02-24 в 20.09.03.png
    Снимок экрана 2024-02-24 в 20.09.03.png
    72.8 KB · Views: 8

Dorik1972

Active member
Therefore, it is not in the converter, perhaps not in the function of determining the IP address... add print to different places in this converter to determine where exactly and what does not work. It's not difficult. You use it in the skin.
I just edit the code I see. But it’s not a fact that the converter receives correct data “as input” .. or a piece of code with wget and popen processes correctly (it’s generally stupid written in orig), but I didn’t touch this part of the code and left it as is in the original
 

hiuman

Donating Member
I have it inserted in the skin.

skin.jpg

This is the text in skin.xml:

<widget source="session.CurrentService" render="GREG_renderer" position="380,1035" size="42,34" zPosition="6" alphatest="blend">
<convert type="GREG_converter">flag</convert>
</widget>
<widget source="session.CurrentService" render="Label" position="430,1035" size="300,30" backgroundColor="XTW_Background" font="Regular; 27" noWrap="1" halign="left" valign="center" foregroundColor="white" transparent="1" zPosition="6">
<convert type="GREG_converter">c+myip </convert>
</widget>

1_0_1_3391_3390_71_820000_0_0_0_20240224195928.jpg
 

Dorik1972

Active member
I have it inserted in the skin.
Do you understand what “add print” means in different places in your converter code? Do you understand how to look at the system operation log to see the output of information output by adding “print”? If the answer is no, then what should we talk about next?

Why and for what purpose are you posting screenshots of the skin and its xml structure? You need to deal with the data that is processed by the converter and look in 2-3 places at what it “gives” when it is called. What's so difficult about this? You should have written - fix the skin to work on Py3, and not correct the converter code for Py3 compatibility =)

Apparently, you have very little understanding of what it is and how it works, not to mention basic knowledge of python ... Send me the entire code of this skin and in 5 minutes I will make it work both on py2 and on py3-based images ... Thanks for understanding
 
Last edited:

Dorik1972

Active member
WTF! Now I understand the problem =) ...
What are these lines in the code?

import process
p = process.ProcessList()

There is no such module in python3. And I'm not sure that such a module exists in Py2 =) ... Do you have a process.py file? Judging by the logic of the converter code, this module is used to obtain a list of processes to determine whether the samba or openvpn services are running ... You can simply exclude this logic from the code altogether if you don't need it. Apparently this is why it doesn't work for you.
 
Last edited:

hiuman

Donating Member
You're right. I have zero knowledge of Python, which is why I wrote this post. I know where the logs are, but it doesn't throw any errors, so I don't know how to check what's wrong with this converter. As I wrote earlier, this file worked under py2, but not under py3. This code was written by someone else.
I put a screenshot to show you where it should be and it's not there. I've included a piece of code so you can see if I made a mistake.
I don't need to re-skin py2. She is under py3.
I tried to add print to the converter but I don't know where.
I'm sorry for my mistakes, but I don't know Python and I would like to modify the skin for myself.
 

Dorik1972

Active member
Without the process module and the logic to determine whether samba or openvpn is being used... This piece of code was returning True or False.. now it is gone
In this variant converter code supports only what you have in your skin
<convert type="GREG_converter">flag</convert>
<convert type="GREG_converter">c+myip </convert>
 

Attachments

  • GREG_converter.txt
    3.7 KB · Views: 2

hiuman

Donating Member
Doesn't work.
I turned on debugging and now I have logs:

<333194.7789> [Skin] Processing screen 'Screensaver', position=(0, 0), size=(1920 x 1080) for module 'Screensaver'.
<333194.7885> [Skin] Processing screen 'SecondInfoBar', position=(0, 0), size=(1920 x 1080) for module 'SecondInfoBar'.
<333194.9285> [Skin] Error in screen 'SecondInfoBar' widget 'widget' [Skin] {Beta_Pro_FHD/skin.xml}: Converter 'GREG_converter' not found! Please contact the skin's author!!
<333194.9317> Traceback (most recent call last):
<333194.9322> File "/usr/lib/enigma2/python/skin.py", line 1256, in processWidget
<333194.9323> File "/usr/lib/enigma2/python/Tools/Import.py", line 2, in my_import
<333194.9323> File "/usr/lib/enigma2/python/Components/Converter/GREG_converter.py", line 4, in <module>
from Poll import Poll
<333194.9324> ModuleNotFoundError: No module named 'Poll'
<333194.9326>
During handling of the above exception, another exception occurred:

<333194.9327> Traceback (most recent call last):
<333194.9328> File "/usr/lib/enigma2/python/skin.py", line 1338, in processScreen
<333194.9328> File "/usr/lib/enigma2/python/skin.py", line 1258, in processWidget
<333194.9329> skin.SkinError: [Skin] {Beta_Pro_FHD/skin.xml}: Converter 'GREG_converter' not found! Please contact the skin's author!
<333194.9351> [Skin] Error in screen 'SecondInfoBar' widget 'widget' [Skin] {Beta_Pro_FHD/skin.xml}: Converter 'GREG_converter' not found! Please contact the skin's author!!
<333194.9372> Traceback (most recent call last):
<333194.9376> File "/usr/lib/enigma2/python/skin.py", line 1256, in processWidget
<333194.9377> File "/usr/lib/enigma2/python/Tools/Import.py", line 2, in my_import
<333194.9377> File "/usr/lib/enigma2/python/Components/Converter/GREG_converter.py", line 4, in <module>
from Poll import Poll
<333194.9378> ModuleNotFoundError: No module named 'Poll'
<333194.9378>
During handling of the above exception, another exception occurred:

<333194.9379> Traceback (most recent call last):
<333194.9380> File "/usr/lib/enigma2/python/skin.py", line 1338, in processScreen
<333194.9380> File "/usr/lib/enigma2/python/skin.py", line 1258, in processWidget
<333194.9381> skin.SkinError: [Skin] {Beta_Pro_FHD/skin.xml}: Converter 'GREG_converter' not found! Please contact the skin's author!
<333194.9388> [Skin] Error: [Skin] {Beta_Pro_FHD/skin.xml}: Color 'transparent2' must be #aarrggbb or valid named color! Please contact the skin's author!
<333194.9392> [Skin] Error: [Skin] {Beta_Pro_FHD/skin.xml}: Color 'un0' must be #aarrggbb or valid named color! Please contact the skin's author!
<333194.9415> [Skin] Error: [Skin] {Beta_Pro_FHD/skin.xml}: Color 'un0' must be #aarrggbb or valid named color! Please contact the skin's author!
<333194.9417> [Skin] Error: [Skin] {Beta_Pro_FHD/skin.xml}: Color 'un0' must be #aarrggbb or valid named color! Please contact the skin's author!
<333194.9422> [Skin] Error: [Skin] {Beta_Pro_FHD/skin.xml}: Color 'un0' must be #aarrggbb or valid named color! Please contact the skin's author!
<333194.9428> [Skin] Error: [Skin] {Beta_Pro_FHD/skin.xml}: Color 'un0' must be #aarrggbb or valid named color! Please contact the skin's author!
<333194.9441> [Skin] Error: [Skin] {Beta_Pro_FHD/skin.xml}: Color 'uncc99' must be #aarrggbb or valid named color! Please contact the skin's author!
<333194.9442> [Skin] Error: [Skin] {Beta_Pro_FHD/skin.xml}: Color 'un0' must be #aarrggbb or valid named color! Please contact the skin's author!
<333194.9473> [Skin] Error: [Skin] {Beta_Pro_FHD/skin.xml}: Color 'un0' must be #aarrggbb or valid named color! Please contact the skin's author!
<333194.9499> [Skin] Error: [Skin] {Beta_Pro_FHD/skin.xml}: Color 'un0' must be #aarrggbb or valid named color! Please contact the skin's author!
<333194.9504> [Skin] Error: [Skin] {Beta_Pro_FHD/skin.xml}: Color 'un0' must be #aarrggbb or valid named color! Please contact the skin's author!
<333194.9511> [Skin] Error: Font 'regular' (in 'regular;32') is not defined! Using 'Body' font ('Regular') instead.
<333194.9515> [Skin] Error: Font 'regular' (in 'regular; 32') is not defined! Using 'Body' font ('Regular') instead.
<333194.9516> [Skin] Error: [Skin] {Beta_Pro_FHD/skin.xml}: Color 'un0' must be #aarrggbb or valid named color! Please contact the skin's author!
<333194.9519> [Skin] Error: Font 'regular' (in 'regular;32') is not defined! Using 'Body' font ('Regular') instead.
<333194.9520> [Skin] Error: [Skin] {Beta_Pro_FHD/skin.xml}: Color 'un0' must be #aarrggbb or valid named color! Please contact the skin's author!
<333194.9522> [Skin] Attribute 'halign' (with value of 'left') in object of type 'eSlider' is not implemented!
<333194.9523> [Skin] Error: [Skin] {Beta_Pro_FHD/skin.xml}: Color 'un0' must be #aarrggbb or valid named color! Please contact the skin's author!
<333194.9532> [Skin] Error: Font 'regular' (in 'regular;30') is not defined! Using 'Body' font ('Regular') instead.
<333194.9534> [Skin] Error: [Skin] {Beta_Pro_FHD/skin.xml}: Color 'un0' must be #aarrggbb or valid named color! Please contact the skin's author!
<333194.9537> [Skin] Error: [Skin] {Beta_Pro_FHD/skin.xml}: Color 'un0' must be #aarrggbb or valid named color! Please contact the skin's author!
<333194.9551> [Skin] Error: [Skin] {Beta_Pro_FHD/skin.xml}: Color 'un0' must be #aarrggbb or valid named color! Please contact the skin's author!
 

Dorik1972

Active member
ModuleNotFoundError: No module named 'Poll'
That's the problem why it doesn't work for you...This part of the code can be rewritten using eTimer ... I need to see if there is a Poll classin OBH ...
 
Last edited:
Top