integrations.web.adapter

integrations/web/adapter.py

 1"""
 2integrations/web/adapter.py
 3"""
 4
 5from typing import TYPE_CHECKING
 6
 7from integrations.base.interface import AdapterInterface
 8from integrations.web.api import AdapterAPI
 9from integrations.web.config import SvcConfig
10from integrations.web.functions import SvcFunctions
11from integrations.web.parser import MessageParser
12from libs.types import ServiceType
13
14if TYPE_CHECKING:
15    from configparser import ConfigParser
16
17
18class ServiceAdapter(AdapterInterface[SvcConfig, AdapterAPI, SvcFunctions, MessageParser]):
19    """web interface"""
20
21    interface_type = ServiceType.WEB
22
23    def __init__(self, parser: "ConfigParser"):
24        self.conf = SvcConfig(main_conf=parser)
25        self.api = AdapterAPI()
26        self.functions = SvcFunctions()
27        self.parser = MessageParser
19class ServiceAdapter(AdapterInterface[SvcConfig, AdapterAPI, SvcFunctions, MessageParser]):
20    """web interface"""
21
22    interface_type = ServiceType.WEB
23
24    def __init__(self, parser: "ConfigParser"):
25        self.conf = SvcConfig(main_conf=parser)
26        self.api = AdapterAPI()
27        self.functions = SvcFunctions()
28        self.parser = MessageParser

web interface

ServiceAdapter(parser: configparser.ConfigParser)
24    def __init__(self, parser: "ConfigParser"):
25        self.conf = SvcConfig(main_conf=parser)
26        self.api = AdapterAPI()
27        self.functions = SvcFunctions()
28        self.parser = MessageParser
interface_type = <ServiceType.WEB: 'web'>

サービス識別子

conf

個別設定データクラス

api

インターフェース操作APIインスタンス

functions

サービス専用関数インスタンス

parser

メッセージパーサクラス