Compare commits

..
Author SHA1 Message Date
Mikaël Capelle 33b7222b13 Fix enabledByDefault(). 2022-04-22 12:19:47 +02:00
Mikaël Capelle e083e0832e Linting. 2022-04-21 22:03:21 +02:00
7 changed files with 42 additions and 14 deletions
+2 -1
View File
@@ -17,7 +17,7 @@ ignores:
mobase:
# Version of the stubs.
__version__: 2.5.0.dev1
__version__: 2.5.0.dev2
getFileVersion:
__doc__: Retrieve the file version of the given executable.
@@ -1814,6 +1814,7 @@ mobase:
returns: True if the plugin was initialized correctly, False otherwise.
enabledByDefault:
abstract: false
__doc__: Check whether this plugin should be enabled by default.
returns: True if this plugin should be enabled by default, False otherwise.
+1
View File
@@ -15,6 +15,7 @@ def load_module(name: str, path: Path):
# Extract the spec:
spec = importlib.util.spec_from_loader(name, loader)
assert spec is not None
# Create the module and execute it?
module = importlib.util.module_from_spec(spec)
+15 -4
View File
@@ -6,8 +6,19 @@ from collections import OrderedDict, defaultdict
from typing import Dict, List, Optional, Tuple, Union
from . import logger
from .mtypes import (Arg, Class, Constant, CType, Enum, Function, Method,
Property, PyClass, Ret, Type)
from .mtypes import (
Arg,
Class,
Constant,
CType,
Enum,
Function,
Method,
Property,
PyClass,
Ret,
Type,
)
from .register import MobaseRegister
@@ -193,9 +204,9 @@ def parse_psig(s: str, name: str) -> Tuple[Type, List[Arg]]:
n: str = pa.strip()
d: Optional[str] = None
if pa.find("=") != -1:
n, d = pa.split("=")
n, ds = pa.split("=")
n = n.strip()
d = d.strip()
d = ds.strip()
elif i > len(args) - c - 1:
d = Arg.DEFAULT_NONE
pargs.append(Arg(n, Type(t), d))
+12 -2
View File
@@ -1,8 +1,18 @@
# -*- encoding: utf-8 -*-
from collections import OrderedDict, defaultdict
from typing import (TYPE_CHECKING, Any, Dict, List, NamedTuple, Optional, Set,
TextIO, Tuple, Union)
from typing import (
TYPE_CHECKING,
Any,
Dict,
List,
NamedTuple,
Optional,
Set,
TextIO,
Tuple,
Union,
)
import yaml
+10 -3
View File
@@ -15,19 +15,26 @@ warn_return_any = True
warn_unused_configs = True
namespace_packages = True
[isort]
profile = black
multi_line_output = 3
[tox:tox]
skipsdist = true
envlist = py38-lint
envlist = py310-lint
[testenv:py38-lint]
[testenv:py310-lint]
skip_install = true
deps =
black
mypy
flake8
flake8-black
PyQt5-stubs
git+https://github.com/TilmanK/PyQt6-stubs.git
types-PyYAML
isort
commands =
black generator main.py --check --diff
flake8 generator main.py
mypy generator main.py
isort -c generator main.py
+1 -2
View File
@@ -1,4 +1,4 @@
__version__ = "2.5.0.dev1"
__version__ = "2.5.0.dev2"
import abc
from enum import Enum
@@ -2294,7 +2294,6 @@ class IPlugin(abc.ABC):
The description for this plugin.
"""
...
@abc.abstractmethod
def enabledByDefault(self) -> bool:
"""
Check whether this plugin should be enabled by default.
+1 -2
View File
@@ -1,4 +1,4 @@
__version__ = "2.5.0.dev1"
__version__ = "2.5.0.dev2"
import abc
from enum import Enum
@@ -2294,7 +2294,6 @@ class IPlugin(abc.ABC):
The description for this plugin.
"""
...
@abc.abstractmethod
def enabledByDefault(self) -> bool:
"""
Check whether this plugin should be enabled by default.