예제 #1
0
def run():
    """ 主运行入口 """
    conf = config.init()
    # conf = get_yaml()
    if not conf:  # 如果 conf,表示配置文件出错。
        print('程序中止...')
        return
    # 判断是否登录,如果没有登录则自动登录,返回 False 表示登录失败
    if not is_online(auto_login=True):
        return
예제 #2
0
    const_name = get_constellation_name(birthday_str)
    if not const_name:
        print('星座名填写错误')
        return
    return get_today_horoscope(const_name, is_tomorrow)


def get_calendar_info(calendar=True, is_tomorrow=False, _date=''):
    """ 获取万年历 """
    if not calendar:
        return None
    if not is_tomorrow:
        date = datetime.now().strftime('%Y%m%d')
    else:
        date = (datetime.now() + timedelta(days=1)).strftime('%Y%m%d')
    return get_rtcalendar(date)

    # else:
    #     time_now = datetime.now()
    #     week = WEEK_DICT[time_now.strftime('%A')]
    #     date = time_now.strftime('%Y-%m-%d')
    #     return '{} {}'.format(date, week)


if __name__ == '__main__':
    config.init()
    text = 'are you ok'
    reply_msg = get_bot_info(text)
    print(reply_msg)
    pass
예제 #3
0
 def setUp(self):
     config.init()