Support pyadonis as pip-installed package

This commit is contained in:
Kumi 2022-09-16 11:17:05 +00:00
parent 2203ecd69c
commit 57b8cf300d
Signed by: kumi
GPG key ID: ECBCC9082395383F
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,5 @@
mysqlclient
paramiko
sshtunnel
sshtunnel
git+https://kumig.it/kumisystems/pyadonis.git

View file

@ -35,7 +35,11 @@ class MonsterConfig:
try:
self.pyadonis = Path(parser["MONSTER"]["PyAdonis"])
except KeyError:
print(f"PyAdonis is not defined in the MONSTER section of {path}, some features may be missing.")
try:
import pyadonis
self.pyadonis = Path(pyadonis.__path__[0])
except ImportError:
print(f"PyAdonis is not defined in the MONSTER section of {path}, some features may be missing.")
def __init__(self, path: Union[str, Path]) -> None: