From d0ff8bac352feaa6568dab242b3d7e246615223b Mon Sep 17 00:00:00 2001 From: vzhd1701 Date: Mon, 22 Nov 2021 20:19:52 +0500 Subject: [PATCH] refactor: lint --- gridplayer/dialogs/about.py | 2 +- gridplayer/main/init_app.py | 2 +- gridplayer/player/managers/video_blocks.py | 2 +- gridplayer/widgets/video_frame_vlc_base.py | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/gridplayer/dialogs/about.py b/gridplayer/dialogs/about.py index 75e692b..b64676b 100644 --- a/gridplayer/dialogs/about.py +++ b/gridplayer/dialogs/about.py @@ -32,7 +32,7 @@ def generate_attributions(attributions): version = f" {a.version}" if a.version else "" attributions_txt.append( - f"

{a.title}{version}" + f"

{a.title}{version}" # noqa: WPS221 f' by {a.author}
' f"Licensed under {a.license}

" ) diff --git a/gridplayer/main/init_app.py b/gridplayer/main/init_app.py index e88adbf..1d2dbcc 100644 --- a/gridplayer/main/init_app.py +++ b/gridplayer/main/init_app.py @@ -80,5 +80,5 @@ def _init_resources(): fonts = QDirIterator(":/fonts", ("*.ttf",), QDir.Files) while fonts.hasNext(): - font = fonts.next() + font = fonts.next() # noqa: B305 QFontDatabase.addApplicationFont(font) diff --git a/gridplayer/player/managers/video_blocks.py b/gridplayer/player/managers/video_blocks.py index 944989a..e571024 100644 --- a/gridplayer/player/managers/video_blocks.py +++ b/gridplayer/player/managers/video_blocks.py @@ -67,7 +67,7 @@ class VideoBlocksManager(ManagerBase): def __init__(self, **kwargs): super().__init__(**kwargs) - self._ctx._is_seek_synced = Settings().get("playlist/seek_synced") + self._ctx.is_seek_synced = Settings().get("playlist/seek_synced") self._ctx.video_blocks = VideoBlocks() diff --git a/gridplayer/widgets/video_frame_vlc_base.py b/gridplayer/widgets/video_frame_vlc_base.py index c452d91..f865732 100644 --- a/gridplayer/widgets/video_frame_vlc_base.py +++ b/gridplayer/widgets/video_frame_vlc_base.py @@ -33,6 +33,7 @@ ) ONE_MOMENT = 0.01 +DEFAULT_FPS = 25 class VlcPlayerBase(object): @@ -272,7 +273,7 @@ def _extract_meta_parse(self): if video_track.frame_rate_num and video_track.frame_rate_den: self.fps = video_track.frame_rate_num / video_track.frame_rate_den else: - self.fps = 25 + self.fps = DEFAULT_FPS self._is_meta_loaded = True @@ -281,7 +282,7 @@ def _extract_meta_play(self): self.length = self._media.get_duration() self.video_dimensions = self._media_player.video_get_size() - self.fps = self._media_player.get_fps() or 25 + self.fps = self._media_player.get_fps() or DEFAULT_FPS self._is_meta_loaded = True