Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
pep8-check:
Expand Down Expand Up @@ -41,11 +43,13 @@ jobs:
git config --global user.name "GitHub Actions"

- name: Pull latest changes
if: github.event_name == 'push'
run: |
git pull origin main --no-rebase || echo "No remote changes to pull"
git pull origin ${{ github.ref_name }} --no-rebase || echo "No remote changes to pull"

- name: Commit and push if changes exist
if: github.event_name == 'push'
run: |
git add .
git diff --cached --quiet || git commit -m "Apply auto PEP8 aggressive fixes"
git push origin main || echo "Push failed (e.g. due to race condition)"
git push origin ${{ github.ref_name }} || echo "Push failed (e.g. due to race condition)"
4 changes: 2 additions & 2 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Python package

on:
push:
branches: [ "main" ]
branches: [ "main", "develop" ]
pull_request:
branches: [ "main" ]
branches: [ "main", "develop" ]

jobs:
build:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- develop
pull_request:

jobs:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update_translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Update Translations

on:
push:
branches: [ main ]
branches: [ main, develop ]
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -49,8 +49,8 @@ jobs:
if ! git diff --cached --quiet; then
git commit -m "Update translations via workflow"

git pull --rebase origin main
git push origin main
git pull --rebase origin ${{ github.ref_name }}
git push origin ${{ github.ref_name }}
else
echo "No changes to commit"
fi
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
usr/lib/enigma2/python/Plugins/Extensions/LinuxsatPanel/icons/link-.png
usr/lib/enigma2/python/Plugins/Extensions/LinuxsatPanel/icons2/link-.png
usr/lib/enigma2/python/Plugins/Extensions/LinuxsatPanel/plugin~.py
__pycache__/
*.pyc
*.pyo
2 changes: 1 addition & 1 deletion CONTROL/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: enigma2-plugin-extensions-linuxsat-panel
Version: 2.9.2
Version: 3.0.0
Description: addons panel
Section: extra
Priority: optional
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<p align="center">
<a href="https://github.com/Belfagor2005/LinuxsatPanel">
<img src="https://img.shields.io/badge/Version-2.9.2-blue.svg" alt="Version">
<img src="https://img.shields.io/badge/Version-3.0.0-blue.svg" alt="Version">
</a>

<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">
Expand Down
4 changes: 2 additions & 2 deletions installer.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

version='2.9.2'
changelog="\n--Add WQHD PANEL"
version='3.0.0'
changelog="\n--Search all addons with GREEN button\n--Installed addons shown in green\n--No more GUI freezes (async downloads, catalog cache)\n--Safe settings install with automatic backup\n--Update check on panel start\n--Big cleanup and many bugfixes"

TMPPATH=/tmp/LinuxsatPanel-install
FILEPATH=/tmp/LinuxsatPanel-main.tar.gz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,17 @@ def addInTVBouquets(self):
try:
with open('/etc/enigma2/bouquets.tv', 'r') as f:
ret = f.read().splitlines()
dttbouquet_str = Bouquet() # "FROM BOUQUET \"userbouquet.terrestrial_lcn.tv\""
dttbouquet = Bouquet()
# bouquets.tv references the bouquet by file name, not full path
name = os.path.basename(
dttbouquet) if dttbouquet else "userbouquet.terrestrial_lcn.tv"
for line in ret:
if dttbouquet_str in line:
if name in line:
return
with open('/etc/enigma2/bouquets.tv', 'w') as f:
f.write(ret[0] + "\n")
f.write(
'#SERVICE 1:7:1:0:0:0:0:0:0:0:FROM BOUQUET "userbouquet.terrestrial_lcn.tv" ORDER BY bouquet\n')
'#SERVICE 1:7:1:0:0:0:0:0:0:0:FROM BOUQUET "%s" ORDER BY bouquet\n' % name)
for line in ret[1:]:
f.write(line + "\n")
except Exception as e:
Expand Down Expand Up @@ -821,7 +824,7 @@ def find_terrestrial_bouquet():
if terrestrial_bouquet_path:
with open(terrestrial_bouquet_path, 'w') as bouquet_file:
for line in terrestrial_channel_list:
if '#NAME' in line.lower():
if '#name' in line.lower():
bouquet_file.write('#NAME Digitale Terrestre\n')
else:
bouquet_file.write(line)
Expand All @@ -830,5 +833,7 @@ def find_terrestrial_bouquet():
print("Errore durante il ripristino del bouquet:", e)
return False

return RestoreTerrestrial(TerChArch)


# ===== by lululla
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ def Plugins(**kwargs):

def __newfunc(self, *args, **kwargs):
if self["scan"].isDone() and "Terrestrial" in str(self.scanList):
from .LCNScanner.Terrestrial import TerrestrialBouquet
print(
"[TerrestrialBouquet] rebuilding terrestrial bouquet -",
TerrestrialBouquet().rebuild() or "was successful")
Expand Down
48 changes: 31 additions & 17 deletions usr/lib/enigma2/python/Plugins/Extensions/LinuxsatPanel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
__email__ = "ekekaz@gmail.com"
__copyright__ = 'Copyright (c) 2024 Lululla'
__license__ = "GPL-v2"
__version__ = "2.9.2"
__version__ = "3.0.0"


def check_and_install_requests():
try:
import requests
import requests # noqa: F401 (availability probe)
return
except ImportError:
pass
Expand Down Expand Up @@ -117,6 +117,17 @@ def setup_timer(callback_method):
return timer


def version_tuple(version):
"""'2.10.1' -> (2, 10, 1) for a numeric comparison"""
parts = []
for part in str(version).strip().split("."):
try:
parts.append(int(part))
except (TypeError, ValueError):
parts.append(0)
return tuple(parts) or (0,)


def check_version(currversion, installer_url, AgentRequest):
"""Controllo versione con gestione avanzata formato numerico"""
print("[Version Check] Starting...")
Expand Down Expand Up @@ -148,24 +159,26 @@ def check_version(currversion, installer_url, AgentRequest):
remote_changelog = "No changelog available"

for line in lines:
line = line.strip()
if line.startswith("version"):
parts = line.split("=")
if len(parts) > 1:
remote_version = parts[1].strip().strip("'")
if line.startswith("changelog"):
parts = line.split("=")
if len(parts) > 1:
try:
remote_changelog = parts[1].strip().strip(
"'")
except BaseException:
remote_changelog = "No changelog available"
break
remote_version = parts[1].strip().strip(
"'").strip('"')
elif line.startswith("changelog"):
parts = line.split("=")
if len(parts) > 1:
remote_changelog = parts[1].strip().strip(
"'").strip('"')
break

new_version = remote_version or "Unknown"
new_changelog = remote_changelog or "No changelog available"

return new_version, new_changelog, currversion < remote_version
return new_version, new_changelog, version_tuple(
currversion) < version_tuple(remote_version)

return None, None, False

except Exception as e:
print("Error while checking version:", e)
Expand Down Expand Up @@ -294,6 +307,7 @@ def fetch_url(url, retries=3, initial_timeout=5):
else:
from urllib2 import (urlopen)
from urllib2 import URLError
PY3 = False
timeout = initial_timeout
for i in range(retries):
try:
Expand Down Expand Up @@ -322,7 +336,7 @@ def fetch_url(url, retries=3, initial_timeout=5):

def checkGZIP(url):
url = url
from io import StringIO
from io import BytesIO
import gzip
import requests
import sys
Expand All @@ -337,7 +351,7 @@ def checkGZIP(url):
try:
response = urlopen(request, timeout=10)
if response.info().get('Content-Encoding') == 'gzip':
buffer = StringIO(response.read())
buffer = BytesIO(response.read())
deflatedContent = gzip.GzipFile(fileobj=buffer)
if sys.version_info[0] == 3:
return deflatedContent.read().decode('utf-8')
Expand Down Expand Up @@ -371,9 +385,9 @@ def b64decoder(s):
print('Invalid base64 string: {}'.format(s))
return ""
elif padding == 2:
s += b'=='
s += '=='
elif padding == 3:
s += b'='
s += '='
else:
return ""
output = base64.b64decode(s)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,68 +65,49 @@ def __init__(self):
self.is_vti_image = self._is_vti_image()
self.is_dmm_image = self._is_dmm_image()

self.has_internet = False
self.internetline = self.get_internet_status()
self.mountid = self.get_mount_info()
self.storhdd = self.get_storage_info()
self.memin = self.get_memory_info()
self.ipub = self.get_ip()
self.current_format = self.getResolution()
self.pip = self.get_public_ip()
# Skip the slow public IP lookups when there is no connection
self.pip = self.get_public_ip() if self.has_internet else None

def to_string(self):
def fmt(label, value):
return '%s: %s' % (label, value if value else 'Unknown')

lines = []
try:
lines.append(
'Data source: %s' %
('OpenWebif' if self.boxinfo else 'proc'))
lines.append('\n')
lines.append('HW Info:')
lines.append('Vendor: %s' %
str(self.hw_vendor) if self.hw_vendor else 'Unknown')
lines.append('Model: %s' %
str(self.hw_model) if self.hw_model else 'Unknown')
lines.append('Chipset: %s' % str(self.hw_chipset)
if self.hw_chipset else 'Unknown')
lines.append('Architecture: %s' %
str(self.hw_arch) if self.hw_arch else 'Unknown')
lines.append('Local Ip: %s' %
str(self.ipub) if self.ipub else 'Unknown')
lines.append('Public IP: %s' %
str(self.pip) if self.pip else 'Unknown')
lines.append('Internet: %s' % str(self.internetline)
if self.internetline else 'Unknown')
lines.append(fmt('Vendor', self.hw_vendor))
lines.append(fmt('Model', self.hw_model))
lines.append(fmt('Chipset', self.hw_chipset))
lines.append(fmt('Architecture', self.hw_arch))
lines.append(fmt('Local Ip', self.ipub))
lines.append(fmt('Public IP', self.pip))
lines.append(fmt('Internet', self.internetline))
lines.append('\n')
lines.append('SW Info:')
lines.append(
'Installation ID: %s' % str(
self.installation_id) if self.installation_id else 'Unknown')
lines.append(
'Python version: %s' % str(
self.python_version) if self.python_version else 'Unknown')
lines.append('Distro: %s' %
str(self.sw_distro) if self.sw_distro else 'Unknown')
lines.append(
'Distro version: %s' % str(
self.sw_distro_ver) if self.sw_distro_ver else 'Unknown')
lines.append(
'Enigma version: %s' % str(
self.sw_enigma_ver) if self.sw_enigma_ver else 'Unknown')
lines.append('OE version: %s' %
str(self.sw_oe_ver) if self.sw_oe_ver else 'Unknown')
lines.append(fmt('Installation ID', self.installation_id))
lines.append(fmt('Python version', self.python_version))
lines.append(fmt('Distro', self.sw_distro))
lines.append(fmt('Distro version', self.sw_distro_ver))
lines.append(fmt('Enigma version', self.sw_enigma_ver))
lines.append(fmt('OE version', self.sw_oe_ver))
lines.append('\n')
lines.append(
'Video Format: %s' % str(
self.current_format) if self.current_format else 'Unknown')
lines.append('Mount Info: %s' %
str(self.mountid) if self.mountid else 'Unknown')
lines.append('Storage Info: %s' %
str(self.storhdd) if self.storhdd else 'Unknown')
lines.append('Memory Info: %s' %
str(self.memin) if self.memin else 'Unknown')
lines.append('Is VTi image: %s' % str(self.is_vti_image)
if self.is_vti_image else 'Unknown')
lines.append('Is DMM image: %s' % str(self.is_dmm_image)
if self.is_dmm_image else 'Unknown')
lines.append(fmt('Video Format', self.current_format))
lines.append(fmt('Mount Info', self.mountid))
lines.append(fmt('Storage Info', self.storhdd))
lines.append(fmt('Memory Info', self.memin))
lines.append('Is VTi image: %s' % self.is_vti_image)
lines.append('Is DMM image: %s' % self.is_dmm_image)
except Exception as e:
print("Error formatting info:", e)
return '\n'.join(lines)
Expand Down Expand Up @@ -164,6 +145,7 @@ def get_internet_status(self):

# Test 1: Ping Google DNS
if system("ping -c 1 -W 2 8.8.8.8 >/dev/null 2>&1") == 0:
self.has_internet = True
return _("Internet: Connected")

# Test 2: TCP connection to port 80 (HTTP) of a reliable server
Expand All @@ -173,6 +155,7 @@ def get_internet_status(self):
sock.settimeout(3)
sock.connect(("www.google.com", 80))
sock.close()
self.has_internet = True
return _("Internet: Connected")
except BaseException:
pass
Expand Down Expand Up @@ -365,7 +348,7 @@ def get_public_ip(self):

for service in services:
try:
response = requests.get(service, timeout=5)
response = requests.get(service, timeout=3)
if response.status_code == 200:
ip = response.text.strip()
if ip and '.' in ip: # Validazione base IP
Expand Down
Loading
Loading