Example #1
0
    def get_hourly_suffixes(self, now, start=None, stop=None):
        if not start:
            start = parse(now.strftime(DT_PATTERNS.CURRENT_DAY_START))
        if not stop:
            stop = parse((now - timedelta(hours=2)).strftime(DT_PATTERNS.PREVIOUS_HOUR_START))

        return (elem.strftime('%Y:%m:%d:%H') for elem in stop_excluding_rrset(HOURLY, start, stop))
Example #2
0
    def get_daily_suffixes(self, now, start=None, stop=None):
        if not start:
            start = parse(now.strftime(DT_PATTERNS.CURRENT_MONTH_START))
        if not stop:
            stop = parse((now - timedelta(days=1)).strftime(DT_PATTERNS.PREVIOUS_DAY_END))

        return (elem.strftime('%Y:%m:%d') for elem in stop_excluding_rrset(DAILY, start, stop))
Example #3
0
 def get_daily_suffixes(self, now, start=None, stop=None):
     if not start:
         start = parse(now.strftime(DT_PATTERNS.CURRENT_MONTH_START))
     if not stop:
         stop = parse((now - timedelta(days=1)).strftime(DT_PATTERNS.PREVIOUS_DAY_END))
     
     return (elem.strftime('%Y:%m:%d') for elem in stop_excluding_rrset(DAILY, start, stop))
Example #4
0
 def get_hourly_suffixes(self, now, start=None, stop=None):
     if not start:
         start = parse(now.strftime(DT_PATTERNS.CURRENT_DAY_START))
     if not stop:
         stop = parse((now - timedelta(hours=2)).strftime(DT_PATTERNS.PREVIOUS_HOUR_START))
     
     return (elem.strftime('%Y:%m:%d:%H') for elem in stop_excluding_rrset(HOURLY, start, stop))
Example #5
0
    def get_yearly_suffixes(self, now, start=None, stop=None):
        if not start:
            start = parse(now.strftime(DT_PATTERNS.CURRENT_YEAR_START))
        if not stop:
            delta = relativedelta(now, years=1)
            stop = parse((start - delta).strftime(DT_PATTERNS.PREVIOUS_YEAR_END))

        return (elem.strftime('%Y') for elem in stop_excluding_rrset(YEARLY, start, stop))
Example #6
0
 def get_yearly_suffixes(self, now, start=None, stop=None):
     if not start:
         start = parse(now.strftime(DT_PATTERNS.CURRENT_YEAR_START))
     if not stop:
         delta = relativedelta(now, years=1)
         stop = parse((start - delta).strftime(DT_PATTERNS.PREVIOUS_YEAR_END))
     
     return (elem.strftime('%Y') for elem in stop_excluding_rrset(YEARLY, start, stop))
Example #7
0
    def get_minutely_suffixes(self, now, start=None, stop=None):
        if not start:
            start = parse_datetime((now - timedelta(hours=1)).strftime(
                DT_PATTERNS.PREVIOUS_HOUR_START))
        if not stop:
            stop = parse_datetime(now.strftime(DT_PATTERNS.CURRENT_HOUR_END))

        return (elem.strftime('%Y:%m:%d:%H:%M')
                for elem in stop_excluding_rrset(MINUTELY, start, stop))
Example #8
0
    def get_monthly_suffixes(self, now, start=None, stop=None):
        if not start:
            start = parse_datetime(now.strftime(
                DT_PATTERNS.CURRENT_YEAR_START))
        if not stop:
            delta = relativedelta(now, months=1)
            stop = parse_datetime(
                (start - delta).strftime(DT_PATTERNS.PREVIOUS_MONTH_END))

        return (elem.strftime('%Y:%m')
                for elem in stop_excluding_rrset(MONTHLY, start, stop))