Skip to content

Commit

Permalink
change GlossaryCommon to not inherit from PluginManager
Browse files Browse the repository at this point in the history
Two `Glossary` classes still inherit from it, not a breaking change
  • Loading branch information
ilius committed Dec 31, 2024
1 parent 6616ba2 commit b9818b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions pyglossary/glossary.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
from time import perf_counter as now
from typing import TYPE_CHECKING

from pyglossary.plugin_manager import PluginManager

from .core import log
from .glossary_v2 import ConvertArgs, Error, GlossaryCommon, ReadError, WriteError
from .sort_keys import lookupSortKey
Expand All @@ -39,7 +41,7 @@
__all__ = ["Glossary"]


class Glossary(GlossaryCommon):
class Glossary(GlossaryCommon, PluginManager):
GLOSSARY_API_VERSION = "1.0"

def __init__(
Expand Down Expand Up @@ -170,7 +172,7 @@ def detectInputFormat( # type: ignore # pyright: ignore[reportIncompatibleMetho
**kwargs,
) -> DetectedFormat | None:
try:
return GlossaryCommon.detectInputFormat(*args, **kwargs)
return PluginManager.detectInputFormat(*args, **kwargs)
except Error as e:
log.critical(str(e))
return None
Expand All @@ -182,7 +184,7 @@ def detectOutputFormat( # type: ignore # pyright: ignore[reportIncompatibleMeth
**kwargs,
) -> DetectedFormat | None:
try:
return GlossaryCommon.detectOutputFormat(*args, **kwargs)
return PluginManager.detectOutputFormat(*args, **kwargs)
except Error as e:
log.critical(str(e))
return None
Expand Down
4 changes: 2 additions & 2 deletions pyglossary/glossary_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class ConvertArgs:
infoOverride: dict[str, str] | None = None


class GlossaryCommon(GlossaryInfo, GlossaryProgress, PluginManager): # noqa: PLR0904
class GlossaryCommon(GlossaryInfo, GlossaryProgress): # noqa: PLR0904

"""
The signature of 'convert' method is different in glossary_v2.py
Expand Down Expand Up @@ -1230,7 +1230,7 @@ def convertV2(self, args: ConvertArgs) -> str:
# ________________________________________________________________________#


class Glossary(GlossaryCommon):
class Glossary(GlossaryCommon, PluginManager):

"""
init method is inherited from PluginManager
Expand Down

0 comments on commit b9818b1

Please sign in to comment.