From 68f294fa3bf78ff57ef38dee41dffbdb019b6476 Mon Sep 17 00:00:00 2001 From: Richard Tibbles Date: Tue, 27 Jun 2023 23:27:07 -0700 Subject: [PATCH] Attempt to fix linting. --- .github/workflows/pre-commit.yml | 8 +++++++- .pre-commit-config.yaml | 1 + src/kolibri_app/__init__.py | 3 +-- src/kolibri_app/application.py | 6 +++--- src/kolibri_app/logger.py | 4 ++-- src/kolibri_app/view.py | 3 ++- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index c672767..672f028 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -1,6 +1,12 @@ name: Linting -on: [push, pull_request] +on: + push: + branches: + - main + pull_request: + branches: + - main jobs: pre_job: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 27e29ad..e05d4be 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,6 +15,7 @@ repos: hooks: - id: reorder-python-imports language_version: python3.11 + args: [--application-directories=.:src] - repo: https://github.com/python/black rev: 22.3.0 hooks: diff --git a/src/kolibri_app/__init__.py b/src/kolibri_app/__init__.py index be7abf6..70c54fe 100644 --- a/src/kolibri_app/__init__.py +++ b/src/kolibri_app/__init__.py @@ -1,8 +1,7 @@ import os -from kolibri_app.constants import MAC - from kolibri.main import enable_plugin +from kolibri_app.constants import MAC __version__ = "0.3.0" diff --git a/src/kolibri_app/application.py b/src/kolibri_app/application.py index bc4d357..21c464d 100644 --- a/src/kolibri_app/application.py +++ b/src/kolibri_app/application.py @@ -4,9 +4,6 @@ from threading import Thread import wx -from kolibri_app.constants import APP_NAME -from kolibri_app.logger import logging -from kolibri_app.view import KolibriView from magicbus.plugins import SimplePlugin from kolibri.main import initialize @@ -14,6 +11,9 @@ from kolibri.plugins.app.utils import SHARE_FILE from kolibri.utils.conf import KOLIBRI_HOME from kolibri.utils.server import KolibriProcessBus +from kolibri_app.constants import APP_NAME +from kolibri_app.logger import logging +from kolibri_app.view import KolibriView share_file = None diff --git a/src/kolibri_app/logger.py b/src/kolibri_app/logger.py index 3968eba..6dd65a5 100644 --- a/src/kolibri_app/logger.py +++ b/src/kolibri_app/logger.py @@ -21,10 +21,10 @@ class LoggerWriter(io.IOBase): def __init__(self, writer): self._writer = writer self._msg = "" - + def readable(self): return False - + def writable(self): return True diff --git a/src/kolibri_app/view.py b/src/kolibri_app/view.py index ad56695..3424864 100644 --- a/src/kolibri_app/view.py +++ b/src/kolibri_app/view.py @@ -5,13 +5,14 @@ from io import BytesIO import wx +from wx import html2 + from kolibri_app.constants import APP_NAME from kolibri_app.constants import LINUX from kolibri_app.constants import MAC from kolibri_app.constants import WINDOWS from kolibri_app.i18n import _ from kolibri_app.i18n import locale_info -from wx import html2 html2.WebView.MSWSetEmulationLevel(html2.WEBVIEWIE_EMU_IE11)