mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
kvmd extra package
This commit is contained in:
parent
ab87784b75
commit
0a3ab57639
@ -1,7 +1,5 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import argparse
|
|
||||||
import logging
|
import logging
|
||||||
import logging.config
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
@ -14,7 +12,7 @@ from RPi import GPIO
|
|||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
|
|
||||||
import yaml
|
from .application import init
|
||||||
|
|
||||||
from .atx import Atx
|
from .atx import Atx
|
||||||
from .streamer import Streamer
|
from .streamer import Streamer
|
||||||
@ -191,13 +189,4 @@ class _Application:
|
|||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
parser = argparse.ArgumentParser()
|
_Application(init()).run()
|
||||||
parser.add_argument("-c", "--config", default="kvmd.yaml", metavar="<path>")
|
|
||||||
options = parser.parse_args()
|
|
||||||
|
|
||||||
with open(options.config) as config_file:
|
|
||||||
config = yaml.load(config_file)
|
|
||||||
logging.captureWarnings(True)
|
|
||||||
logging.config.dictConfig(config["logging"])
|
|
||||||
|
|
||||||
_Application(config["kvmd"]).run()
|
|
||||||
|
|||||||
22
kvmd/kvmd/application.py
Normal file
22
kvmd/kvmd/application.py
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import argparse
|
||||||
|
import logging
|
||||||
|
import logging.config
|
||||||
|
|
||||||
|
from typing import Dict
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
|
||||||
|
# =====
|
||||||
|
def init() -> Dict:
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument("-c", "--config", default="kvmd.yaml", metavar="<path>")
|
||||||
|
options = parser.parse_args()
|
||||||
|
|
||||||
|
with open(options.config) as config_file:
|
||||||
|
config = yaml.load(config_file)
|
||||||
|
|
||||||
|
logging.captureWarnings(True)
|
||||||
|
logging.config.dictConfig(config["logging"])
|
||||||
|
|
||||||
|
return config["kvmd"]
|
||||||
0
kvmd/kvmd/extra/__init__.py
Normal file
0
kvmd/kvmd/extra/__init__.py
Normal file
0
kvmd/wscli.py → kvmd/kvmd/extra/wscli.py
Executable file → Normal file
0
kvmd/wscli.py → kvmd/kvmd/extra/wscli.py
Executable file → Normal file
@ -6,26 +6,26 @@ skipsdist = True
|
|||||||
basepython = python3.6
|
basepython = python3.6
|
||||||
|
|
||||||
[testenv:flake8]
|
[testenv:flake8]
|
||||||
commands = flake8 kvmd wscli.py
|
commands = flake8 kvmd
|
||||||
deps =
|
deps =
|
||||||
flake8
|
flake8
|
||||||
flake8-double-quotes
|
flake8-double-quotes
|
||||||
-rdev_requirements.txt
|
-rdev_requirements.txt
|
||||||
|
|
||||||
[testenv:pylint]
|
[testenv:pylint]
|
||||||
commands = pylint --output-format=colorized --reports=no kvmd wscli.py
|
commands = pylint --output-format=colorized --reports=no kvmd
|
||||||
deps =
|
deps =
|
||||||
pylint
|
pylint
|
||||||
-rdev_requirements.txt
|
-rdev_requirements.txt
|
||||||
|
|
||||||
[testenv:mypy]
|
[testenv:mypy]
|
||||||
commands = mypy kvmd wscli.py
|
commands = mypy kvmd
|
||||||
deps =
|
deps =
|
||||||
mypy
|
mypy
|
||||||
-rdev_requirements.txt
|
-rdev_requirements.txt
|
||||||
|
|
||||||
[testenv:vulture]
|
[testenv:vulture]
|
||||||
commands = vulture kvmd wscli.py
|
commands = vulture kvmd
|
||||||
deps =
|
deps =
|
||||||
vulture
|
vulture
|
||||||
-rdev_requirements.txt
|
-rdev_requirements.txt
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user