Exemple #1
0
def __create_remind_dic_end_today():
    events = Event.create_today_end_event_list(TYPE_LIST_END_EVENT)
    format_dic = {
        "title": "今日納期/本番のイベント",
        "date_jpn": "今日",
        "date": TimeUtil.get_now_str(TimeUtil.TIME_FORMAT_YYMMDD),
        "count": len(events)
    }

    ret_dic = {
        DIC_KEY_EVENTS: events,
        DIC_KEY_EXIST_MESSAGE: MESSAGE_BASE_EXIST_END_EVENT.format(format_dic),
        DIC_KEY_NOT_EXIST_MESSAGE: ""
    }

    return ret_dic
Exemple #2
0
def __create_remind_dic_start_next_day():
    events = Event.create_next_day_start_event_list(TYPE_LIST_START_EVENT)
    format_dic = {
        "title": "明日のイベント",
        "date_jpn": "明日",
        "date": TimeUtil.get_next_day_str(TimeUtil.TIME_FORMAT_YYMMDD),
        "count": len(events)
    }

    ret_dic = {
        DIC_KEY_EVENTS: events,
        DIC_KEY_EXIST_MESSAGE: MESSAGE_BASE_EXIST_EVENT.format(format_dic),
        DIC_KEY_NOT_EXIST_MESSAGE:
        MESSAGE_BASE_NOT_EXIST_EVENT.format(format_dic)
    }

    return ret_dic
Exemple #3
0
Created on 2020/01/14

@author: m2(@m2cpa)
'''
import tjh_bot.notice.Notice as Notice
import tjh_bot.util.TweetUtil as TweetUtil
import tjh_bot.util.TimeUtil as TimeUtil

MESSAGE_BASE_EXIST_NOTICE = \
    "【実務補習所 通知確認】\n" + \
    " 前回確認時から{date}までに新しい通知が{count}件あります。"

MESSAGE_BASE_NOT_EXIST_EVENT = \
    "【実務補習所 通知確認】\n" + \
    " 前回確認時から{date}までに新しい通知はありません。"

################################################
# 更新された通知情報をツイートする
################################################
if __name__ == '__main__':
    # 更新された通知情報を取得する
    tweet_notices = Notice.create_notice_list()

    # ツイートする
    date_str = TimeUtil.get_now_str(TimeUtil.TIME_FORMAT_YYMMDDHHMM)
    TweetUtil.tweet(
        tweet_notices,
        MESSAGE_BASE_EXIST_NOTICE.format(date=date_str,
                                         count=len(tweet_notices)),
        MESSAGE_BASE_NOT_EXIST_EVENT.format(date=date_str))
Exemple #4
0
def create_next_week_end_event_list(type_list):
    next_week_str = TimeUtil.get_next_week_str(TimeUtil.TIME_FORMAT_YYMMDD)
    ret_list = __search_end_event_list(next_week_str, type_list)
    for event in ret_list:
        event.previous_week_flag = True
    return ret_list
Exemple #5
0
def create_today_end_event_list(type_list):
    today_str = TimeUtil.get_now_str(TimeUtil.TIME_FORMAT_YYMMDD)
    ret_list = __search_end_event_list(today_str, type_list)
    for event in ret_list:
        event.today_flag = True
    return ret_list
Exemple #6
0
def create_next_day_start_event_list(type_list):
    next_day_str = TimeUtil.get_next_day_str(TimeUtil.TIME_FORMAT_YYMMDD)
    return __search_start_event_list(next_day_str, type_list)
Exemple #7
0
 def end_date(self, end_date):
     self.__end_date = TimeUtil.to_eight_date(end_date.strip())
Exemple #8
0
 def start_date(self, start_date):
     self.__start_date = TimeUtil.to_eight_date(start_date.strip())