コード例 #1
0
def quarter_from(text):
    estimated = text.endswith('(E)')
    text = text[:-3] if estimated else text
    comp = text.split('/')
    return Quarter(year=int(comp[0]),
                   number=int(int(comp[1]) / 3),
                   estimated=estimated)
コード例 #2
0
ファイル: scrapper.py プロジェクト: teddylee777/snowball
def quarter_from(text: str) -> Quarter:
    if (not text) or ('/' not in text):
        return None
    estimated = text.endswith('(E)')
    text = text[:-3] if estimated else text
    comp = text.split('/')
    return Quarter(year=int(comp[0]), number=int(int(comp[1]) / 3), estimated=estimated)