mirror of
https://github.com/ModOrganizer2/pystubs-generation.git
synced 2026-07-27 14:07:13 -07:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
33b7222b13 | ||
|
|
e083e0832e |
@@ -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.
|
||||
|
||||
|
||||
@@ -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
@@ -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
@@ -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
|
||||
|
||||
|
||||
@@ -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,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,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.
|
||||
|
||||
Reference in New Issue
Block a user