# Path: schedule/periods.py
# class Period(object):
# class Year(Period):
# class Month(Period):
# class Week(Period):
# class Day(Period):
#     def __init__(self, events, start, end, parent_persisted_occurrences=None,
#                  occurrence_pool=None, tzinfo=pytz.utc):
#     def _normalize_timezone_to_utc(self, point_in_time, tzinfo):
#     def __eq__(self, period):
#     def __ne__(self, period):
#     def _get_tzinfo(self, tzinfo):
#     def _get_sorted_occurrences(self):
#     def cached_get_sorted_occurrences(self):
#     def get_persisted_occurrences(self):
#     def classify_occurrence(self, occurrence):
#     def get_occurrence_partials(self):
#     def get_occurrences(self):
#     def has_occurrences(self):
#     def get_time_slot(self, start, end):
#     def create_sub_period(self, cls, start=None, tzinfo=None):
#     def get_periods(self, cls, tzinfo=None):
#     def start(self):
#     def end(self):
#     def __init__(self, events, date=None, parent_persisted_occurrences=None, tzinfo=pytz.utc):
#     def get_months(self):
#     def next_year(self):
#     def prev_year(self):
#     def _get_year_range(self, year):
#     def __str__(self):
#     def __init__(self, events, date=None, parent_persisted_occurrences=None,
#                  occurrence_pool=None, tzinfo=pytz.utc):
#     def get_weeks(self):
#     def get_days(self):
#     def get_day(self, daynumber):
#     def next_month(self):
#     def prev_month(self):
#     def current_year(self):
#     def prev_year(self):
#     def next_year(self):
#     def _get_month_range(self, month):
#     def __str__(self):
#     def name(self):
#     def year(self):
#     def __init__(self, events, date=None, parent_persisted_occurrences=None,
#                  occurrence_pool=None, tzinfo=pytz.utc):
#     def prev_week(self):
#     def next_week(self):
#     def current_month(self):
#     def current_year(self):
#     def get_days(self):
#     def _get_week_range(self, week):
#     def __str__(self):
#     def __init__(self, events, date=None, parent_persisted_occurrences=None,
#                  occurrence_pool=None, tzinfo=pytz.utc):
#     def _get_day_range(self, date):
#     def __str__(self):
#     def prev_day(self):
#     def next_day(self):
#     def current_year(self):
#     def current_month(self):
#     def current_week(self):


from django.utils.six.moves.builtins import range
from django.conf import settings
from django import template
from django.core.urlresolvers import reverse
from django.utils.dateformat import format
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
from django.utils import timezone
from schedule.conf.settings import CHECK_EVENT_PERM_FUNC, CHECK_CALENDAR_PERM_FUNC, SCHEDULER_PREVNEXT_LIMIT_SECONDS
from schedule.models import Calendar
from schedule.periods import weekday_names, weekday_abbrs
import datetime
from __future__ import division


register = template.Library()


@register.inclusion_tag("schedule/_month_table.html", takes_context=True)
def month_table(context, calendar, month, size="regular", shift=None):
    if shift:
        if shift == -1:
            month = month.prev()
        if shift == 1:
            month = next(month)
    if size == "small":
        context['day_names'] = weekday_abbrs
    else:
        context['day_names'] = weekday_names
    context['calendar'] = calendar
    context['month'] = month
    context['size'] = size
    return context


@register.inclusion_tag("schedule/_day_cell.html", takes_context=True)
def day_cell(context, calendar, day, month, size="regular"):
    context.update({
        'calendar': calendar,
        'day': day,

# Path: schedule/periods.py
# class Period(object):
# class Year(Period):
# class Month(Period):
# class Week(Period):
# class Day(Period):
#     def __init__(self, events, start, end, parent_persisted_occurrences=None,
#                  occurrence_pool=None, tzinfo=pytz.utc):
#     def _normalize_timezone_to_utc(self, point_in_time, tzinfo):
#     def __eq__(self, period):
#     def __ne__(self, period):
#     def _get_tzinfo(self, tzinfo):
#     def _get_sorted_occurrences(self):
#     def cached_get_sorted_occurrences(self):
#     def get_persisted_occurrences(self):
#     def classify_occurrence(self, occurrence):
#     def get_occurrence_partials(self):
#     def get_occurrences(self):
#     def has_occurrences(self):
#     def get_time_slot(self, start, end):
#     def create_sub_period(self, cls, start=None, tzinfo=None):
#     def get_periods(self, cls, tzinfo=None):
#     def start(self):
#     def end(self):
#     def __init__(self, events, date=None, parent_persisted_occurrences=None, tzinfo=pytz.utc):
#     def get_months(self):
#     def next_year(self):
#     def prev_year(self):
#     def _get_year_range(self, year):
#     def __str__(self):
#     def __init__(self, events, date=None, parent_persisted_occurrences=None,
#                  occurrence_pool=None, tzinfo=pytz.utc):
#     def get_weeks(self):
#     def get_days(self):
#     def get_day(self, daynumber):
#     def next_month(self):
#     def prev_month(self):
#     def current_year(self):
#     def prev_year(self):
#     def next_year(self):
#     def _get_month_range(self, month):
#     def __str__(self):
#     def name(self):
#     def year(self):
#     def __init__(self, events, date=None, parent_persisted_occurrences=None,
#                  occurrence_pool=None, tzinfo=pytz.utc):
#     def prev_week(self):
#     def next_week(self):
#     def current_month(self):
#     def current_year(self):
#     def get_days(self):
#     def _get_week_range(self, week):
#     def __str__(self):
#     def __init__(self, events, date=None, parent_persisted_occurrences=None,
#                  occurrence_pool=None, tzinfo=pytz.utc):
#     def _get_day_range(self, date):
#     def __str__(self):
#     def prev_day(self):
#     def next_day(self):
#     def current_year(self):
#     def current_month(self):
#     def current_week(self):


# Path: schedule/templatetags/scheduletags.py
from django.utils.six.moves.builtins import range
from django.conf import settings
from django import template
from django.core.urlresolvers import reverse
from django.utils.dateformat import format
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
from django.utils import timezone
from schedule.conf.settings import CHECK_EVENT_PERM_FUNC, CHECK_CALENDAR_PERM_FUNC, SCHEDULER_PREVNEXT_LIMIT_SECONDS
from schedule.models import Calendar
from schedule.periods import weekday_names, weekday_abbrs
import datetime

from __future__ import division


register = template.Library()


@register.inclusion_tag("schedule/_month_table.html", takes_context=True)
def month_table(context, calendar, month, size="regular", shift=None):
    if shift:
        if shift == -1:
            month = month.prev()
        if shift == 1:
            month = next(month)
    if size == "small":
        context['day_names'] = weekday_abbrs
    else:
        context['day_names'] = weekday_names
    context['calendar'] = calendar
    context['month'] = month
    context['size'] = size
    return context


@register.inclusion_tag("schedule/_day_cell.html", takes_context=True)
def day_cell(context, calendar, day, month, size="regular"):
    context.update({
        'calendar': calendar,
        'day': day,

        'month': month,