Skip to content

Commit

Permalink
flake8 import order
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonzorn committed Jul 5, 2024
1 parent c9f854c commit aaf5c3e
Show file tree
Hide file tree
Showing 40 changed files with 116 additions and 88 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
inline-quotes=double
import-order-style=google
max-line-length = 79
extend-ignore = R503,R502,F401,N802
extend-ignore = R503,R502,F401,N802,I100,I202
exclude =
.git,
__pycache__,
Expand Down
11 changes: 6 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@
from http.server import HTTPServer
from pathlib import Path
from threading import Thread as PyThread

import darkdetect
import platformdirs
from PySide6.QtCore import Qt, QTranslator, QLocale, QThreadPool
from PySide6.QtGui import QIcon, QPalette
from PySide6.QtCore import QLocale, Qt, QThreadPool, QTranslator
from PySide6.QtGui import QIcon
from PySide6.QtWidgets import QApplication
from qfluentwidgets import setTheme, Theme, InfoBar
from qfluentwidgets import InfoBar, setTheme, Theme

from nlightreader import ParentWindow
from nlightreader.consts.app import APP_VERSION, APP_NAME, APP_BRANCH
from nlightreader.consts.app import APP_BRANCH, APP_NAME, APP_VERSION
from nlightreader.consts.files import Icons
from nlightreader.consts.urls import GITHUB_REPO
from nlightreader.utils import get_locale, Thread, get_html, translate
from nlightreader.utils import get_html, get_locale, Thread, translate
from nlightreader.utils.kodik_server import KodikHTTPRequestHandler


Expand Down
2 changes: 1 addition & 1 deletion make_version_file.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pyinstaller_versionfile

from nlightreader.consts.app import APP_VERSION, APP_NAME
from nlightreader.consts.app import APP_NAME, APP_VERSION

pyinstaller_versionfile.create_versionfile(
output_file="pkg_res/version_info.txt",
Expand Down
2 changes: 1 addition & 1 deletion nlightreader/consts/files/files.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from enum import Enum

from qfluentwidgets import FluentIconBase, Theme, getIconColor
from qfluentwidgets import FluentIconBase, getIconColor, Theme

import nlight_res_rc

Expand Down
2 changes: 1 addition & 1 deletion nlightreader/contexts/HistoryNote.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from qfluentwidgets import RoundMenu, FluentIcon, Action
from qfluentwidgets import Action, FluentIcon, RoundMenu

from nlightreader.utils import translate

Expand Down
2 changes: 1 addition & 1 deletion nlightreader/contexts/LibraryManga.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from qfluentwidgets import RoundMenu, FluentIcon, Action
from qfluentwidgets import Action, FluentIcon, RoundMenu

from nlightreader.utils import translate

Expand Down
2 changes: 1 addition & 1 deletion nlightreader/contexts/ReadMark.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from qfluentwidgets import RoundMenu, FluentIcon, Action
from qfluentwidgets import Action, FluentIcon, RoundMenu

from nlightreader.utils import translate

Expand Down
4 changes: 2 additions & 2 deletions nlightreader/controlers/filter_controller.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from PySide6.QtWidgets import QLayout
from qfluentwidgets import RadioButton, CheckBox
from qfluentwidgets import CheckBox, RadioButton

from nlightreader.dialogs import FormGenres
from nlightreader.items import Order, Kind, Genre
from nlightreader.items import Genre, Kind, Order


class FilterController:
Expand Down
4 changes: 2 additions & 2 deletions nlightreader/dialogs/Auth.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import webbrowser

from qfluentwidgets import (
MessageBoxBase,
LineEdit,
MessageBoxBase,
PasswordLineEdit,
SubtitleLabel,
PushButton,
SubtitleLabel,
)

from nlightreader.utils import translate
Expand Down
2 changes: 1 addition & 1 deletion nlightreader/dialogs/Rate.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from qfluentwidgets import FluentIcon

from data.ui.dialogs.rate import Ui_Dialog
from nlightreader.consts.enums import Nl, LIB_LISTS
from nlightreader.consts.enums import LIB_LISTS, Nl
from nlightreader.items import Manga
from nlightreader.utils import translate
from nlightreader.utils.catalog_manager import get_catalog, get_lib_catalog
Expand Down
2 changes: 1 addition & 1 deletion nlightreader/items/RequestForm.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from nlightreader.consts.enums import Nl
from nlightreader.items.sort_items import Order, Genre, Kind
from nlightreader.items.sort_items import Genre, Kind, Order


class RequestForm:
Expand Down
2 changes: 1 addition & 1 deletion nlightreader/parsers/LocalLib.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from nlightreader.items import RequestForm, Manga
from nlightreader.items import Manga, RequestForm
from nlightreader.utils.database import Database


Expand Down
12 changes: 10 additions & 2 deletions nlightreader/parsers/catalog.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
from nlightreader.consts.urls import DEFAULT_HEADERS
from nlightreader.consts.items.parser_items import ParserItems
from nlightreader.items import (
Manga, Chapter, Image, RequestForm,
Genre, Kind, Order, Character, User, UserRate,
Chapter,
Character,
Genre,
Image,
Kind,
Manga,
Order,
RequestForm,
User,
UserRate,
)


Expand Down
2 changes: 1 addition & 1 deletion nlightreader/parsers/combined/lib/lib_anilib.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from nlightreader.consts.enums import Nl
from nlightreader.consts.items import AniLibItems
from nlightreader.consts.urls import URL_ANILIB
from nlightreader.items import Manga, Chapter
from nlightreader.items import Chapter, Manga
from nlightreader.parsers.catalogs_base import AbstractAnimeCatalog
from nlightreader.parsers.combined.lib.lib_base import LibBase
from nlightreader.utils.utils import get_html
Expand Down
2 changes: 1 addition & 1 deletion nlightreader/parsers/combined/lib/lib_base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from nlightreader.consts.enums import Nl
from nlightreader.consts.urls import URL_LIB_API
from nlightreader.items import Manga, RequestForm, Chapter
from nlightreader.items import Chapter, Manga, RequestForm
from nlightreader.parsers.catalog import AbstractCatalog
from nlightreader.utils.utils import get_html

Expand Down
2 changes: 1 addition & 1 deletion nlightreader/parsers/combined/lib/lib_mangalib.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from nlightreader.consts.items import MangaLibItems
from nlightreader.consts.urls import URL_MANGALIB
from nlightreader.items import Manga, Chapter, Image
from nlightreader.items import Chapter, Image, Manga
from nlightreader.parsers.catalogs_base import AbstractMangaCatalog
from nlightreader.parsers.combined.lib.lib_base import LibBase
from nlightreader.utils.utils import get_html
Expand Down
2 changes: 1 addition & 1 deletion nlightreader/parsers/combined/lib/lib_ranobelib.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from nlightreader.consts.enums import Nl
from nlightreader.consts.items import RanobeLibItems
from nlightreader.consts.urls import URL_RANOBELIB
from nlightreader.items import Manga, Chapter, Image
from nlightreader.items import Chapter, Image, Manga
from nlightreader.parsers.catalogs_base import AbstractRanobeCatalog
from nlightreader.parsers.combined.lib.lib_base import LibBase
from nlightreader.utils.utils import get_html
Expand Down
10 changes: 5 additions & 5 deletions nlightreader/parsers/combined/shikimori/shikimori_anime.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from nlightreader.consts.enums import Nl
from nlightreader.consts.items import ShikimoriAnimeItems
from nlightreader.consts.urls import (
URL_SHIKIMORI_API,
URL_SHIKIMORI,
SHIKIMORI_HEADERS,
URL_SHIKIMORI,
URL_SHIKIMORI_API,
)
from nlightreader.items import (
Manga,
Character,
RequestForm,
Chapter,
Character,
Genre,
Manga,
Order,
RequestForm,
)
from nlightreader.parsers.catalogs_base import AbstractAnimeCatalog
from nlightreader.parsers.service.kodik import Kodik
Expand Down
4 changes: 2 additions & 2 deletions nlightreader/parsers/combined/shikimori/shikimori_base.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from nlightreader.consts.enums import Nl
from nlightreader.consts.items import ShikimoriItems
from nlightreader.consts.urls import (
SHIKIMORI_HEADERS,
URL_SHIKIMORI,
URL_SHIKIMORI_API,
SHIKIMORI_HEADERS,
)
from nlightreader.items import Manga, Character, Genre, Order
from nlightreader.items import Character, Genre, Manga, Order
from nlightreader.parsers.catalog import AbstractCatalog
from nlightreader.utils.utils import get_html

Expand Down
6 changes: 4 additions & 2 deletions nlightreader/parsers/combined/shikimori/shikimori_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
from requests_oauthlib import OAuth2Session

from nlightreader.consts.urls import (
URL_SHIKIMORI_API, SHIKIMORI_HEADERS,
URL_SHIKIMORI, URL_SHIKIMORI_TOKEN,
SHIKIMORI_HEADERS,
URL_SHIKIMORI,
URL_SHIKIMORI_API,
URL_SHIKIMORI_TOKEN,
)
from nlightreader.consts.enums import Nl
from nlightreader.items import Manga, RequestForm, User, UserRate
Expand Down
2 changes: 1 addition & 1 deletion nlightreader/parsers/combined/shikimori/shikimori_manga.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from nlightreader.consts.items import ShikimoriItems
from nlightreader.items import RequestForm, Kind
from nlightreader.items import Kind, RequestForm
from nlightreader.parsers.catalogs_base import AbstractMangaCatalog
from nlightreader.parsers.combined.shikimori.shikimori_base import (
ShikimoriBase,
Expand Down
2 changes: 1 addition & 1 deletion nlightreader/parsers/hentai_manga/allhentai_hmanga.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from nlightreader.consts.urls import URL_ALLHENTAI, URL_ALLHENTAI_API
from nlightreader.consts.enums import Nl
from nlightreader.items import Manga, Chapter, Image
from nlightreader.items import Chapter, Image, Manga
from nlightreader.parsers.catalogs_base import AbstractHentaiMangaCatalog
from nlightreader.utils.utils import get_html, make_request

Expand Down
2 changes: 1 addition & 1 deletion nlightreader/parsers/hentai_manga/nhentai_hmanga.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from bs4 import BeautifulSoup

from nlightreader.consts.urls import URL_NHENTAI, URL_NHENTAI_API
from nlightreader.items import Manga, Chapter, Image
from nlightreader.items import Chapter, Image, Manga
from nlightreader.parsers.catalogs_base import AbstractHentaiMangaCatalog
from nlightreader.utils.utils import get_html

Expand Down
6 changes: 3 additions & 3 deletions nlightreader/parsers/manga/desu_manga.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from nlightreader.consts.urls import URL_DESU_API, DESU_HEADERS, URL_DESU
from nlightreader.consts.urls import DESU_HEADERS, URL_DESU, URL_DESU_API
from nlightreader.consts.enums import Nl
from nlightreader.consts.items import DesuItems
from nlightreader.items import Manga, Chapter, Image, Genre, RequestForm
from nlightreader.items import Chapter, Genre, Image, Manga, RequestForm
from nlightreader.parsers.catalogs_base import AbstractMangaCatalog
from nlightreader.utils.utils import get_html, get_data
from nlightreader.utils.utils import get_data, get_html


class Desu(AbstractMangaCatalog):
Expand Down
12 changes: 7 additions & 5 deletions nlightreader/parsers/manga/mangadex_manga.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import logging

from nlightreader.consts.urls import (
URL_MANGA_DEX_API, URL_MANGA_DEX,
MANGA_DEX_HEADERS, URL_MANGA_DEX_TOKEN,
MANGA_DEX_HEADERS,
URL_MANGA_DEX,
URL_MANGA_DEX_API,
URL_MANGA_DEX_TOKEN,
)
from nlightreader.consts.enums import Nl
from nlightreader.items import (
Manga,
Chapter,
Image,
Genre,
Image,
Kind,
Manga,
RequestForm,
User,
Kind,
)
from nlightreader.parsers.catalog import LibParser
from nlightreader.parsers.catalogs_base import AbstractMangaCatalog
Expand Down
6 changes: 3 additions & 3 deletions nlightreader/parsers/manga/remanga_manga.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from nlightreader.consts.urls import URL_REMANGA_API, URL_REMANGA
from nlightreader.consts.urls import URL_REMANGA, URL_REMANGA_API
from nlightreader.consts.enums import Nl
from nlightreader.consts.items import RemangaItems
from nlightreader.items import RequestForm, Manga, Chapter, Image
from nlightreader.items import Chapter, Image, Manga, RequestForm
from nlightreader.parsers.catalogs_base import AbstractMangaCatalog
from nlightreader.utils.utils import get_html, get_data
from nlightreader.utils.utils import get_data, get_html


class Remanga(AbstractMangaCatalog):
Expand Down
6 changes: 3 additions & 3 deletions nlightreader/parsers/ranobe/ranobehub_ranobe.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import bs4.element
from bs4 import BeautifulSoup

from nlightreader.consts.urls import URL_RANOBEHUB_API, URL_RANOBEHUB
from nlightreader.consts.urls import URL_RANOBEHUB, URL_RANOBEHUB_API
from nlightreader.consts.enums import Nl
from nlightreader.consts.items import RanobehubItems
from nlightreader.items import RequestForm, Manga, Chapter, Image
from nlightreader.items import Chapter, Image, Manga, RequestForm
from nlightreader.parsers.catalogs_base import AbstractRanobeCatalog
from nlightreader.utils.utils import get_html, get_data
from nlightreader.utils.utils import get_data, get_html


class Ranobehub(AbstractRanobeCatalog):
Expand Down
4 changes: 2 additions & 2 deletions nlightreader/parsers/ranobe/rulate_ranobe.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

from bs4 import BeautifulSoup

from nlightreader.consts.urls import URL_RULATE, URL_EROLATE
from nlightreader.consts.urls import URL_EROLATE, URL_RULATE
from nlightreader.consts.enums import Nl
from nlightreader.consts.items import RulateItems
from nlightreader.items import Manga, Chapter, Image, RequestForm
from nlightreader.items import Chapter, Image, Manga, RequestForm
from nlightreader.parsers.catalogs_base import AbstractRanobeCatalog
from nlightreader.utils.utils import get_html

Expand Down
20 changes: 14 additions & 6 deletions nlightreader/utils/catalog_manager.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
from nlightreader.parsers import (
AllHentai,
Desu,
MangaDex, MangaDexLib,
ShikimoriBase, ShikimoriRanobe, ShikimoriManga,
ShikimoriLib, ShikimoriAnime,
Rulate, Erolate,
Erolate,
LibAnilib,
LibMangalib,
LibRanobelib,
MangaDex,
MangaDexLib,
NHentai,
Ranobehub,
Remanga,
NHentai, AllHentai,
LibRanobelib, LibMangalib, LibAnilib,
Rulate,
ShikimoriAnime,
ShikimoriBase,
ShikimoriLib,
ShikimoriManga,
ShikimoriRanobe,
SlashLib,
)

Expand Down
2 changes: 1 addition & 1 deletion nlightreader/utils/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from nlightreader.consts.app import APP_NAME
from nlightreader.consts.enums import Nl
from nlightreader.items import Chapter, Manga, HistoryNote
from nlightreader.items import Chapter, HistoryNote, Manga
from nlightreader.utils.decorators import singleton


Expand Down
2 changes: 1 addition & 1 deletion nlightreader/utils/file_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from nlightreader.consts.app import APP_NAME
from nlightreader.consts.enums import Nl
from nlightreader.items import Manga, Chapter, Character, Image
from nlightreader.items import Chapter, Character, Image, Manga
from nlightreader.parsers.catalog import AbstractCatalog


Expand Down
6 changes: 3 additions & 3 deletions nlightreader/utils/threads.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from typing import Callable

from PySide6.QtCore import (
QThreadPool,
QRunnable,
QObject,
QRunnable,
QThread,
QThreadPool,
Signal,
Slot,
QThread,
)


Expand Down
2 changes: 1 addition & 1 deletion nlightreader/widgets/NlightContainers/image_area.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from PySide6.QtCore import Qt, QSize
from PySide6.QtCore import QSize, Qt
from PySide6.QtGui import QPixmap
from PySide6.QtWidgets import QWidget

Expand Down
2 changes: 1 addition & 1 deletion nlightreader/widgets/NlightContainers/manga_area.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from PySide6.QtCore import Qt, QThreadPool
from PySide6.QtWidgets import QWidget, QHBoxLayout, QGridLayout
from PySide6.QtWidgets import QGridLayout, QHBoxLayout, QWidget
from qfluentwidgets import ScrollArea

from nlightreader.utils import Thread
Expand Down
Loading

0 comments on commit aaf5c3e

Please sign in to comment.