# Path: WeCron/wxhook/todo_parser/exceptions.py
# class ParseError(ValueError):
#     pass


import os
import re
import logging
import jieba
import jieba.posseg as pseg
from dateutil.relativedelta import relativedelta
from django.utils import timezone
from remind.models import Remind
from remind.models.remind import REPEAT_KEY_YEAR, REPEAT_KEY_MONTH, \
    REPEAT_KEY_DAY, REPEAT_KEY_WEEK, REPEAT_KEY_HOUR, REPEAT_KEY_MINUTE
from .exceptions import ParseError
            self.consume_repeat()

            self.consume_year_period() \
                or self.consume_month_period() \
                or self.consume_day_period()

            self.consume_weekday_period() \
                or self.consume_hour_period() \
                or self.consume_minute_period() \
                or self.consume_second_period()

            self.consume_year() \
                or self.consume_month() \
                or self.consume_day()

            self.consume_hour()

            if self.get_index() != self.parse_beginning:
                # Time found
                self.consume_word(u'准时')
                self.consume_word(u'是')
                if self.consume_word(u'提醒'):
                    self.consume_word(u'我')
                if self.current_tag() == 'v' and self.peek_next_word() == u'我':
                    self.advance(2)
                self.consume_to_end()
                try:
                    self.now += relativedelta(**self.time_delta_fields)
                    self.now = self.now.replace(**self.time_fields)
                except ValueError:

# Path: WeCron/wxhook/todo_parser/exceptions.py
# class ParseError(ValueError):
#     pass


# Path: WeCron/wxhook/todo_parser/local_parser.py
import os
import re
import logging
import jieba
import jieba.posseg as pseg
from dateutil.relativedelta import relativedelta
from django.utils import timezone
from remind.models import Remind
from remind.models.remind import REPEAT_KEY_YEAR, REPEAT_KEY_MONTH, \
    REPEAT_KEY_DAY, REPEAT_KEY_WEEK, REPEAT_KEY_HOUR, REPEAT_KEY_MINUTE
from .exceptions import ParseError

            self.consume_repeat()

            self.consume_year_period() \
                or self.consume_month_period() \
                or self.consume_day_period()

            self.consume_weekday_period() \
                or self.consume_hour_period() \
                or self.consume_minute_period() \
                or self.consume_second_period()

            self.consume_year() \
                or self.consume_month() \
                or self.consume_day()

            self.consume_hour()

            if self.get_index() != self.parse_beginning:
                # Time found
                self.consume_word(u'准时')
                self.consume_word(u'是')
                if self.consume_word(u'提醒'):
                    self.consume_word(u'我')
                if self.current_tag() == 'v' and self.peek_next_word() == u'我':
                    self.advance(2)
                self.consume_to_end()
                try:
                    self.now += relativedelta(**self.time_delta_fields)
                    self.now = self.now.replace(**self.time_fields)
                except ValueError:

                    raise ParseError(u'/:no亲，时间或者日期超范围了')