Skip to content

Commit 842fd6b

Browse files
committed
update github actions
1 parent aba9b6e commit 842fd6b

File tree

9 files changed

+63
-11
lines changed

9 files changed

+63
-11
lines changed

.github/workflows/auto-tag.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout code
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414

1515
- name: Set up Git
1616
run: |

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
cheetah compile -R plugin
3838
python testsuite/evil_eval.py
3939
40-
- uses: actions/setup-python@v4
40+
- uses: actions/setup-python@v5
4141
with:
4242
python-version: '3.11'
4343

@@ -48,7 +48,7 @@ jobs:
4848
cheetah compile -R plugin
4949
python testsuite/evil_eval.py
5050
51-
- uses: actions/setup-python@v4
51+
- uses: actions/setup-python@v5
5252
with:
5353
python-version: '3.10'
5454

.github/workflows/ruff.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Ruff Linter
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout Repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.12'
21+
22+
- name: Install Ruff
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install ruff
26+
27+
- name: Run Ruff
28+
run: |
29+
ruff check .

plugin/controllers/defaults.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def getATSearchtypes():
233233

234234
def getTextInputSupport():
235235
try:
236-
from enigma import setPrevAsciiCode
236+
from enigma import setPrevAsciiCode # noqa: F401
237237
return True
238238
except ImportError:
239239
return False

plugin/controllers/models/info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ def getStatusInfo(self):
783783
# Get recording state
784784
try:
785785
recs = NavigationInstance.instance.getAnyRecordingsCount()
786-
except:
786+
except: # nosec # noqa: E722
787787
recs = NavigationInstance.instance.getRecordings()
788788
if recs:
789789
statusinfo["isRecording"] = "true"

plugin/controllers/models/movies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ def setMovieResumePoint(sref, resumepoint):
693693
try:
694694
from Screens.InfoBarGenerics import resumePointCache
695695
resumePointCache[service.ref.toString()] = (int(time()), resumepoint, length * 90000)
696-
except:
696+
except: # nosec # noqa: E722
697697
pass
698698

699699
fullpath = service.ref.getPath()

plugin/controllers/views/responsive/ajax/renderevtblock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from time import localtime, strftime
44
from urllib.parse import quote
5-
from Plugins.Extensions.OpenWebif.controllers.i18n import tstrings
5+
# from Plugins.Extensions.OpenWebif.controllers.i18n import tstrings
66

77

88
class renderEvtBlock:

plugin/httpserver.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ def noShell(self, user):
336336
return False
337337

338338
def render(self, request):
339-
host = request.getHost().host
339+
# host = request.getHost().host
340340
peer = request.getClientAddress().host
341341
if peer is None:
342342
peer = request.transport.socket.getpeername()[0]
@@ -348,7 +348,7 @@ def render(self, request):
348348
peer = peer.split("%")[0]
349349

350350
if self.login(request.getUser(), request.getPassword(), peer) is False:
351-
request.setHeader('WWW-authenticate', f'Basic realm="OpenWebif"')
351+
request.setHeader('WWW-authenticate', 'Basic realm="OpenWebif"')
352352
errpage = resource.ErrorPage(http.UNAUTHORIZED, "Unauthorized", "401 Authentication required")
353353
return errpage.render(request)
354354
else:
@@ -425,7 +425,7 @@ def getChildWithDefault(self, path, request):
425425
return self.resource.getChildWithDefault(path, request)
426426

427427
if self.login(ruser, rpw, peer) is False:
428-
request.setHeader('WWW-authenticate', f'Basic realm="OpenWebif"')
428+
request.setHeader('WWW-authenticate', 'Basic realm="OpenWebif"')
429429
return resource.ErrorPage(http.UNAUTHORIZED, "Unauthorized", "401 Authentication required")
430430
else:
431431
session["logged"] = True
@@ -493,7 +493,7 @@ def installCertificates(session):
493493
certgenerator = SSLCertificateGenerator()
494494
try:
495495
certgenerator.installCertificates()
496-
except OSError as e:
496+
except OSError:
497497
# Disable https
498498
config.OpenWebif.https_enabled.value = False
499499
config.OpenWebif.https_enabled.save()

pyproject.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[tool.ruff]
2+
builtins = ["_"]
3+
line-length = 400
4+
select = ["E","F","W"]
5+
ignore = [
6+
"W191" # Indentation contains tabs
7+
]
8+
9+
[tool.isort]
10+
profile = "black"
11+
line_length = 1000
12+
force_sort_within_sections = true
13+
combine_as_imports = true
14+
lines_between_types = 1
15+
include_trailing_comma = true
16+
multi_line_output = 3
17+
force_single_line = false
18+
default_section = "THIRDPARTY"
19+
sections = ["STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
20+
known_third_party = ["Components", "Screens", "Tools"]
21+
known_first_party = ["Plugins"]
22+
no_lines_before = ["STDLIB"]
23+
order_by_type = false

0 commit comments

Comments
 (0)