Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mdevaev committed Sep 30, 2020
1 parent eeedb60 commit 16946d1
Show file tree
Hide file tree
Showing 18 changed files with 62 additions and 21 deletions.
1 change: 0 additions & 1 deletion kvmd/apps/kvmd/api/atx.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from ....plugins.atx import BaseAtx

from ....validators.basic import valid_bool

from ....validators.kvm import valid_atx_power_action
from ....validators.kvm import valid_atx_button

Expand Down
1 change: 0 additions & 1 deletion kvmd/apps/kvmd/api/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
from .... import tools

from ....plugins.atx import BaseAtx

from ....plugins.ugpio import UserGpioModes

from ..info import InfoManager
Expand Down
4 changes: 0 additions & 4 deletions kvmd/apps/kvmd/api/hid.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,16 @@
from ....plugins.hid import BaseHid

from ....validators import raise_error

from ....validators.basic import valid_bool
from ....validators.basic import valid_int_f0

from ....validators.os import valid_printable_filename

from ....validators.kvm import valid_hid_key
from ....validators.kvm import valid_hid_mouse_move
from ....validators.kvm import valid_hid_mouse_button
from ....validators.kvm import valid_hid_mouse_wheel

from ....keyboard.keysym import SymmapWebKey
from ....keyboard.keysym import build_symmap

from ....keyboard.printer import text_to_web_keys

from ..http import exposed_http
Expand Down
1 change: 0 additions & 1 deletion kvmd/apps/kvmd/api/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from aiohttp.web import StreamResponse

from ....validators.basic import valid_bool

from ....validators.kvm import valid_log_seek

from ..logreader import LogReader
Expand Down
1 change: 0 additions & 1 deletion kvmd/apps/kvmd/api/msd.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from ....plugins.msd import BaseMsd

from ....validators.basic import valid_bool

from ....validators.kvm import valid_msd_image_name

from ..http import exposed_http
Expand Down
1 change: 0 additions & 1 deletion kvmd/apps/kvmd/api/streamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

from ....validators.basic import valid_bool
from ....validators.basic import valid_int_f0

from ....validators.kvm import valid_stream_quality

from .... import aiotools
Expand Down
1 change: 0 additions & 1 deletion kvmd/apps/kvmd/api/ugpio.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

from ....validators.basic import valid_bool
from ....validators.basic import valid_float_f0

from ....validators.kvm import valid_ugpio_channel

from ..ugpio import UserGpio
Expand Down
22 changes: 22 additions & 0 deletions kvmd/apps/kvmd/http.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# ========================================================================== #
# #
# KVMD - The main Pi-KVM daemon. #
# #
# Copyright (C) 2018 Maxim Devaev <[email protected]> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
# #
# ========================================================================== #


import os
import socket
import dataclasses
Expand Down
2 changes: 0 additions & 2 deletions kvmd/apps/kvmd/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@
from ...plugins.msd import BaseMsd

from ...validators import ValidatorError

from ...validators.basic import valid_bool

from ...validators.kvm import valid_stream_quality
from ...validators.kvm import valid_stream_fps
from ...validators.kvm import valid_stream_resolution
Expand Down
1 change: 0 additions & 1 deletion kvmd/apps/otgmsd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

from ...validators.basic import valid_bool
from ...validators.basic import valid_int_f0

from ...validators.os import valid_abs_file

from .. import init
Expand Down
20 changes: 20 additions & 0 deletions kvmd/helpers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# ========================================================================== #
# #
# KVMD - The main Pi-KVM daemon. #
# #
# Copyright (C) 2018 Maxim Devaev <[email protected]> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
# #
# ========================================================================== #
20 changes: 20 additions & 0 deletions kvmd/helpers/otgmsd/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# ========================================================================== #
# #
# KVMD - The main Pi-KVM daemon. #
# #
# Copyright (C) 2018 Maxim Devaev <[email protected]> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
# #
# ========================================================================== #
1 change: 0 additions & 1 deletion kvmd/plugins/atx/gpio.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
from ...validators.basic import valid_bool
from ...validators.basic import valid_float_f0
from ...validators.basic import valid_float_f01

from ...validators.hw import valid_gpio_pin

from . import AtxIsBusyError
Expand Down
1 change: 0 additions & 1 deletion kvmd/plugins/hid/otg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
from ....validators.basic import valid_bool
from ....validators.basic import valid_int_f1
from ....validators.basic import valid_float_f01

from ....validators.os import valid_abs_path

from .. import BaseHid
Expand Down
2 changes: 0 additions & 2 deletions kvmd/plugins/hid/serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@
from ...validators.basic import valid_int_f0
from ...validators.basic import valid_int_f1
from ...validators.basic import valid_float_f01

from ...validators.os import valid_abs_path

from ...validators.hw import valid_tty_speed
from ...validators.hw import valid_gpio_pin_optional

Expand Down
2 changes: 0 additions & 2 deletions kvmd/plugins/msd/relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@

from ...validators.basic import valid_int_f1
from ...validators.basic import valid_float_f01

from ...validators.os import valid_abs_path

from ...validators.hw import valid_gpio_pin

from . import MsdError
Expand Down
1 change: 0 additions & 1 deletion kvmd/plugins/ugpio/hidrelay.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
from ...yamlconf import Option

from ...validators.basic import valid_float_f01

from ...validators.os import valid_abs_path

from . import GpioDriverOfflineError
Expand Down
1 change: 0 additions & 1 deletion kvmd/validators/kvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
from .basic import valid_stripped_string_not_empty
from .basic import valid_number
from .basic import valid_string_list

from .os import valid_printable_filename


Expand Down

0 comments on commit 16946d1

Please sign in to comment.