Module graia.application.message.parser.pattern

Expand source code
from typing import Any, List, Optional
from dataclasses import dataclass


@dataclass(init=True, eq=True, repr=True)
class ParamPattern:
    longs: List[str]
    short: Optional[str] = None
    default: Any = None
    help_message: Optional[str] = None


@dataclass(init=True, eq=True, repr=True)
class SwitchParameter(ParamPattern):
    default: bool = False
    auto_reverse: bool = False


@dataclass(init=True, eq=True, repr=True)
class BoxParameter(ParamPattern):
    "可以被指定传入消息的参数, 但只有一个."

Classes

class BoxParameter (longs: List[str], short: Union[str, NoneType] = None, default: Any = None, help_message: Union[str, NoneType] = None)

可以被指定传入消息的参数, 但只有一个.

Expand source code
class BoxParameter(ParamPattern):
    "可以被指定传入消息的参数, 但只有一个."

Ancestors

Class variables

var default : Any
var help_message : Union[str, NoneType]
var longs : List[str]
var short : Union[str, NoneType]
class ParamPattern (longs: List[str], short: Union[str, NoneType] = None, default: Any = None, help_message: Union[str, NoneType] = None)

ParamPattern(longs: List[str], short: Union[str, NoneType] = None, default: Any = None, help_message: Union[str, NoneType] = None)

Expand source code
class ParamPattern:
    longs: List[str]
    short: Optional[str] = None
    default: Any = None
    help_message: Optional[str] = None

Subclasses

Class variables

var default : Any
var help_message : Union[str, NoneType]
var longs : List[str]
var short : Union[str, NoneType]
class SwitchParameter (longs: List[str], short: Union[str, NoneType] = None, default: bool = False, help_message: Union[str, NoneType] = None, auto_reverse: bool = False)

SwitchParameter(longs: List[str], short: Union[str, NoneType] = None, default: bool = False, help_message: Union[str, NoneType] = None, auto_reverse: bool = False)

Expand source code
class SwitchParameter(ParamPattern):
    default: bool = False
    auto_reverse: bool = False

Ancestors

Class variables

var auto_reverse : bool
var default : bool