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 mysqlclient
paramiko paramiko
sshtunnel sshtunnel
git+https://kumig.it/kumisystems/pyadonis.git

View file

@ -35,6 +35,10 @@ class MonsterConfig:
try: try:
self.pyadonis = Path(parser["MONSTER"]["PyAdonis"]) self.pyadonis = Path(parser["MONSTER"]["PyAdonis"])
except KeyError: except KeyError:
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.") print(f"PyAdonis is not defined in the MONSTER section of {path}, some features may be missing.")