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 argparse
|
||||
import logging
|
||||
import logging.config
|
||||
import time
|
||||
|
||||
from typing import List
|
||||
@ -14,7 +12,7 @@ from RPi import GPIO
|
||||
|
||||
import aiohttp
|
||||
|
||||
import yaml
|
||||
from .application import init
|
||||
|
||||
from .atx import Atx
|
||||
from .streamer import Streamer
|
||||
@ -191,13 +189,4 @@ class _Application:
|
||||
|
||||
|
||||
def main() -> None:
|
||||
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"])
|
||||
|
||||
_Application(config["kvmd"]).run()
|
||||
_Application(init()).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
|
||||
|
||||
[testenv:flake8]
|
||||
commands = flake8 kvmd wscli.py
|
||||
commands = flake8 kvmd
|
||||
deps =
|
||||
flake8
|
||||
flake8-double-quotes
|
||||
-rdev_requirements.txt
|
||||
|
||||
[testenv:pylint]
|
||||
commands = pylint --output-format=colorized --reports=no kvmd wscli.py
|
||||
commands = pylint --output-format=colorized --reports=no kvmd
|
||||
deps =
|
||||
pylint
|
||||
-rdev_requirements.txt
|
||||
|
||||
[testenv:mypy]
|
||||
commands = mypy kvmd wscli.py
|
||||
commands = mypy kvmd
|
||||
deps =
|
||||
mypy
|
||||
-rdev_requirements.txt
|
||||
|
||||
[testenv:vulture]
|
||||
commands = vulture kvmd wscli.py
|
||||
commands = vulture kvmd
|
||||
deps =
|
||||
vulture
|
||||
-rdev_requirements.txt
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user