Skip to content

Commit

Permalink
Some code style updates
Browse files Browse the repository at this point in the history
Therefore, remove some style warnings from flake8 exceptions.

force-test skip-release
  • Loading branch information
Taapat committed Sep 6, 2023
1 parent da4b0bd commit 4b7f629
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,8 @@ jobs:
- name: Check code with flake8
run: |
flake8 --ignore=W191,W504,E126,E127,E128,E501 --show-source --exclude=./src/compat.py,./src/jsinterp.py,./test/enigmahelper.py,./test/try_plugin.py,./src/__init__.py
flake8 --ignore=W191,E501,F821 --show-source --filename=./test/try_plugin.py
flake8 --ignore=W191,F401,E128,E402,E501 --show-source --filename=./src/jsinterp.py,./test/enigmahelper.py,./src/__init__.py
flake8 --ignore=W191,F821,F401 --show-source --filename=./src/compat.py
flake8 --ignore=W191,E501 --show-source --filename=./src/jsinterp.py,./test/enigmahelper.py,./test/try_plugin.py,./src/__init__.py
flake8 --ignore=W191,F401 --show-source --filename=./src/compat.py
- name: Remove enigma2 imports and variables for test
run: |
echo "" > src/__init__.py
Expand Down
10 changes: 6 additions & 4 deletions src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ def locale_init():
environ["LANGUAGE"]
except KeyError: # On old images LANGUAGE environment is not set
environ["LANGUAGE"] = language.getLanguage()[:2]
gettext.bindtextdomain("YouTube", resolveFilename(SCOPE_PLUGINS,
"Extensions/YouTube/locale"))
gettext.bindtextdomain(
"YouTube",
resolveFilename(SCOPE_PLUGINS, "Extensions/YouTube/locale")
)


def _(txt):
Expand All @@ -35,8 +37,8 @@ def ngettext(singular, plural, n):

try:
# Check functions for full svg and scaling support
from enigma import loadSVG
from skin import applySkinFactor
from enigma import loadSVG # noqa: F401
from skin import applySkinFactor # noqa: F401
screenwidth = 'svg'
except ImportError:
from enigma import getDesktop
Expand Down
10 changes: 4 additions & 6 deletions test/enigmahelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ def start_callback(self, singleshot):
def start(self, msec, singleshot=False):
if int(msec) == 1000:
from threading import Thread
self.callback_thread = Thread(target=self.start_callback,
args=(singleshot,))
self.callback_thread = Thread(target=self.start_callback, args=(singleshot,))
self.callback_thread.start()
else:
self.start_callback(singleshot)
Expand Down Expand Up @@ -500,8 +499,7 @@ def openWithCallback(self, callback, screen, *arguments, **kwargs):
def open(self, screen, *arguments, **kwargs):
print('Session open ', screen)
self.pushCurrent()
dlg = self.current_dialog = self.instantiateDialog(screen,
*arguments, **kwargs)
dlg = self.current_dialog = self.instantiateDialog(screen, *arguments, **kwargs)

dlg.callback = None
self.execBegin()
Expand Down Expand Up @@ -541,7 +539,7 @@ def new_index(self, value):
return 0


from Screens.Screen import Screen
from Screens.Screen import Screen # noqa: E402


class new_movie_player(Screen):
Expand Down Expand Up @@ -594,7 +592,7 @@ def start_session():
from Screens import InfoBar
InfoBar.MoviePlayer = new_movie_player
try:
from Screens.SimpleSummary import SimpleSummary
from Screens.SimpleSummary import SimpleSummary # noqa: F401
except ImportError:
pass

Expand Down

0 comments on commit 4b7f629

Please sign in to comment.