libs.bootstrap.section module¶
libs/bootstrap/section.py
- class libs.bootstrap.section.AliasSection¶
Bases:
BaseSectionaliasセクション処理
- __init__(section='alias', results=<factory>, graph=<factory>, ranking=<factory>, report=<factory>, download=<factory>, member=<factory>, add=<factory>, delete=<factory>, team_create=<factory>, team_del=<factory>, team_add=<factory>, team_remove=<factory>, team_list=<factory>, team_clear=<factory>)¶
- Parameters:
section (str)
results (list[str])
graph (list[str])
ranking (list[str])
report (list[str])
download (list[str])
member (list[str])
add (list[str])
delete (list[str])
team_create (list[str])
team_del (list[str])
team_add (list[str])
team_remove (list[str])
team_list (list[str])
team_clear (list[str])
- Return type:
None
- add: list[str]¶
メンバー追加コマンド
- delete: list[str]¶
メンバー削除コマンド
- download: list[str]¶
DBダウンロードコマンド
- graph: list[str]¶
成績グラフ出力コマンド
- member: list[str]¶
メンバーリスト表示コマンド
- ranking: list[str]¶
ランキング出力コマンド
- report: list[str]¶
レポート出力コマンド
- results: list[str]¶
成績サマリ出力コマンド
- section: str = 'alias'¶
セクション名
- team_add: list[str]¶
チーム所属コマンド
- team_clear: list[str]¶
全チーム情報削除コマンド
- team_create: list[str]¶
チーム作成コマンド
- team_del: list[str]¶
チーム削除コマンド
- team_list: list[str]¶
チームリスト出力コマンド
- team_remove: list[str]¶
チーム脱退コマンド
- class libs.bootstrap.section.BaseSection¶
Bases:
CommonMethodMixin基底クラス
- __init__(outer)¶
- Parameters:
outer (SettingClassType | SubCommands | ServiceClassType)
- Return type:
None
- config_load(section_proxy)¶
設定値取り込み
- Parameters:
section_proxy (SectionProxy) – 読み込み先(パーサー + セクション名)
- Return type:
None
- initialization(section_proxy)¶
設定ファイルから値の取り込み
- Parameters:
section_proxy (SectionProxy) – 読み込み先(パーサー + セクション名)
- Return type:
None
- main_parser: ConfigParser¶
設定パーサー
- section: str¶
セクション名
- section_proxy: SectionProxy¶
読み込み先(パーサー + セクション名)
- to_dict(drop_items=None)¶
必要なパラメータを辞書型で返す
- Parameters:
drop_items (list[str], optional) – 返却に含めないキーリスト. Defaults to None.
- Returns:
返却値
- Return type:
dict[str, str]
- class libs.bootstrap.section.CommonMethodMixin¶
Bases:
object共通メソッド
- get(key, fallback=None)¶
値の取得
- Parameters:
key (str)
fallback (Any)
- Return type:
Any
- getboolean(key, fallback=False)¶
真偽値の取得
- Parameters:
key (str)
fallback (bool)
- Return type:
bool
- getfloat(key, fallback=0.0)¶
数値の取得
- Parameters:
key (str)
fallback (float)
- Return type:
float
- getint(key, fallback=0)¶
整数値の取得
- Parameters:
key (str)
fallback (int)
- Return type:
int
- getlist(key, fallback='')¶
リストの取得
- Parameters:
key (str)
fallback (str)
- Return type:
list[str]
- items()¶
ItemsViewを返却
- Return type:
list[tuple[str, str]]
- keys()¶
キーリストの返却
- Return type:
list[str]
- section_proxy: SectionProxy¶
読み込み先(パーサー + セクション名)
- values()¶
値リストの返却
- Return type:
list[str]
- libs.bootstrap.section.ServiceClassType: TypeAlias = ForwardRef('SlackConfig') | ForwardRef('DiscordConfig') | ForwardRef('WebConfig') | ForwardRef('StdConfig')¶
連携サービスクラス
- libs.bootstrap.section.SettingClassType: TypeAlias = ForwardRef('SettingSection') | ForwardRef('MemberSection') | ForwardRef('TeamSection') | ForwardRef('AliasSection') | ForwardRef('BadgeDisplay')¶
設定関連クラス
- class libs.bootstrap.section.SettingSection¶
Bases:
BaseSectionsettingセクション処理
- __init__(section='setting', remarks_suffix=<factory>, rule_config=None, default_rule='', separate=False, channel_id=None, time_adjust=12, search_word='', group_length=0, guest_mark='※', database_file=PosixPath('mahjong.db'), backup_dir=None, font_file=PosixPath('ipaexg.ttf'), graph_style='ggplot', work_dir=PosixPath('work'))¶
- Parameters:
section (str)
remarks_suffix (list[str])
rule_config (Path | None)
default_rule (str)
separate (bool)
channel_id (str | None)
time_adjust (int)
search_word (str)
group_length (int)
guest_mark (str)
database_file (str | Path)
backup_dir (Path | None)
font_file (Path)
graph_style (str)
work_dir (Path)
- Return type:
None
- backup_dir: Path | None = None¶
バックアップ先ディレクトリ
- channel_id: str | None = None¶
チャンネルIDを上書きする
- database_file: str | Path = PosixPath('mahjong.db')¶
成績管理データベースファイル名
- default_rule: str = ''¶
ルール識別子未指定時に使用される識別子
- font_file: Path = PosixPath('ipaexg.ttf')¶
グラフ描写に使用するフォントファイル
- graph_style: str = 'ggplot'¶
グラフスタイル
- group_length: int = 0¶
コメント固定(検索時の集約文字数)
- guest_mark: str = '※'¶
ゲスト無効時に未登録メンバーに付与する印
- remarks_suffix: list[str]¶
メモ記録用キーワードサフィックス
- rule_config: Path | None = None¶
ルール設定ファイル
- search_word: str = ''¶
コメント固定(検索時の検索文字列)
- section: str = 'setting'¶
セクション名
- separate: bool = False¶
スコア入力元識別子別集計フラグ - True: 識別子別に集計 - False: すべて集計
- time_adjust: int = 12¶
日付変更後、集計範囲に含める追加時間
- work_dir: Path = PosixPath('work')¶
作業ディレクトリ
- class libs.bootstrap.section.SubCommands¶
Bases:
BaseSection,CommandAttrsサブコマンドセクション処理
- default_commandword: str¶
コマンドワードデフォルト値