公众授权版:normal · 1000 次 · 有效期至 2026-12-31
副本编号 LY-20261007-AC63(水印指纹已嵌入) 含 README、.gitignore;排除 .DS_Store / __pycache__ / .pytest_cache
This commit is contained in:
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
# -*- coding:utf-8 -*-
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import List, Union
|
||||
|
||||
from tyme4py import LoopTyme
|
||||
|
||||
|
||||
class SixStar(LoopTyme):
|
||||
"""六曜"""
|
||||
NAMES: List[str] = ['先胜', '友引', '先负', '佛灭', '大安', '赤口']
|
||||
"""名称"""
|
||||
|
||||
def __init__(self, index_or_name: Union[int, str]):
|
||||
super().__init__(self.NAMES, index_or_name)
|
||||
|
||||
@classmethod
|
||||
def from_name(cls, name: str) -> SixStar:
|
||||
return cls(name)
|
||||
|
||||
@classmethod
|
||||
def from_index(cls, index: int) -> SixStar:
|
||||
return cls(index)
|
||||
|
||||
def next(self, n: int) -> SixStar:
|
||||
return SixStar(self.next_index(n))
|
||||
Reference in New Issue
Block a user