Skip to content

Commit 8ec2007

Browse files
[pre-commit.ci] Auto fixes from pre-commit.com hooks.
1 parent 66c3034 commit 8ec2007

8 files changed

Lines changed: 19 additions & 17 deletions

File tree

__init__.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import typing
1010

1111
from PyQt6.QtCore import qWarning
12+
1213
from mobase import IPlugin, IPluginTool
1314

1415
from .basic_game import BasicGame
@@ -67,16 +68,12 @@ def createPlugins():
6768
module_path = "." + os.path.relpath(path.parent, curpath).replace(os.sep, ".")
6869
try:
6970
module = importlib.import_module(module_path, __package__)
70-
if hasattr(module, "createPlugins") and callable(
71-
getattr(module, "createPlugins")
72-
):
73-
for p in getattr(module, "createPlugins")():
71+
if hasattr(module, "createPlugins") and callable(module.createPlugins):
72+
for p in module.createPlugins():
7473
if isinstance(p, IPluginTool):
7574
plugins.append(p)
76-
if hasattr(module, "createPlugin") and callable(
77-
getattr(module, "createPlugin")
78-
):
79-
p = getattr(module, "createPlugin")()
75+
if hasattr(module, "createPlugin") and callable(module.createPlugin):
76+
p = module.createPlugin()
8077
if isinstance(p, IPluginTool):
8178
plugins.append(p)
8279
except ImportError as e:

games/baldursgate3/bg3_data_checker.py

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

33
import mobase
44

5+
from ...basic_features import BasicModDataChecker, GlobPatterns, utils
56
from . import bg3_utils
6-
from ...basic_features import BasicModDataChecker, utils, GlobPatterns
77

88

99
class BG3ModDataChecker(BasicModDataChecker):

games/baldursgate3/bg3_file_mapper.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
from pathlib import Path
55
from typing import Callable, Optional
66

7-
import mobase
87
import yaml
9-
from PyQt6.QtCore import qInfo, qDebug, qWarning, QDir
8+
from PyQt6.QtCore import QDir, qDebug, qInfo, qWarning
109
from PyQt6.QtWidgets import QApplication
1110

11+
import mobase
12+
1213
from . import bg3_utils
1314

1415

games/baldursgate3/bg3_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import typing
44
from pathlib import Path
55

6-
import mobase
76
from PyQt6.QtCore import (
87
QCoreApplication,
98
QDir,
@@ -17,6 +16,8 @@
1716
)
1817
from PyQt6.QtWidgets import QApplication, QMainWindow, QProgressDialog
1918

19+
import mobase
20+
2021
loose_file_folders = {
2122
"Public",
2223
"Mods",

games/baldursgate3/pak_parser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
from xml.etree import ElementTree
1313
from xml.etree.ElementTree import Element
1414

15-
import mobase
1615
from PyQt6.QtCore import (
1716
qDebug,
1817
qInfo,
1918
qWarning,
2019
)
2120

21+
import mobase
22+
2223
from . import bg3_utils
2324

2425

games/baldursgate3/plugins/bg3_tool_plugin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from pathlib import Path
22

3-
import mobase
43
from PyQt6.QtCore import QCoreApplication
54
from PyQt6.QtGui import QIcon
65

6+
import mobase
7+
78

89
class BG3ToolPlugin(mobase.IPluginTool):
910
icon_file = desc = sub_name = ""

games/baldursgate3/plugins/convert_jsons_to_yaml_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
from pathlib import Path
44

5-
from PyQt6.QtCore import qWarning, qInfo
5+
from PyQt6.QtCore import qInfo, qWarning
66
from PyQt6.QtWidgets import QApplication
77

88
from .bg3_tool_plugin import BG3ToolPlugin

games/game_baldursgate3.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@
66
from pathlib import Path
77
from typing import Any
88

9-
import mobase
109
from PyQt6.QtCore import (
1110
qDebug,
1211
qInfo,
1312
)
1413

15-
from .baldursgate3 import bg3_file_mapper
14+
import mobase
15+
1616
from ..basic_features import (
1717
BasicGameSaveGameInfo,
1818
BasicLocalSavegames,
1919
)
2020
from ..basic_game import BasicGame
21+
from .baldursgate3 import bg3_file_mapper
2122

2223

2324
class BG3Game(BasicGame, bg3_file_mapper.BG3FileMapper):

0 commit comments

Comments
 (0)