from django.views.generic.base import TemplateView
from django.views.generic.dates import MonthArchiveView, _date_from_string
from django.views.generic.detail import DetailView
+from emissions.app_settings import app_settings as emissions_app_settings
from emissions.models import (
Category,
Diffusion,
times = ['%02d:%02d' % (x / 2, x % 2 * 30) for x in range(nb_lines)]
# start grid after the night programs
times = (
- times[2 * Schedule.DAY_HOUR_START + (1 if Schedule.DAY_MINUTE_START else 0) :]
- + times[: 2 * Schedule.DAY_HOUR_START + (1 if Schedule.DAY_MINUTE_START else 0)]
+ times[
+ 2 * emissions_app_settings.DAY_HOUR_START
+ + (1 if emissions_app_settings.DAY_MINUTE_START else 0) :
+ ]
+ + times[
+ : 2 * emissions_app_settings.DAY_HOUR_START
+ + (1 if emissions_app_settings.DAY_MINUTE_START else 0)
+ ]
)
nonstops = []
time_cell.nonstop = nonstop[2]
time_cell.nonstop_slug = nonstop[3]
time_cell.redirect_path = nonstop[4].redirect_path if nonstop[4] else None
- if nonstop[1] == Schedule.DAY_HOUR_START + Schedule.DAY_MINUTE_START / 60:
- # the one ending at 4:30am will be cut down, so we inscribe
+ if (
+ nonstop[1]
+ == emissions_app_settings.DAY_HOUR_START + emissions_app_settings.DAY_MINUTE_START / 60
+ ):
+ # the one ending at dawn will be cut down, so we inscribe
# its duration manually
time_cell.time_label = '%02d:00-%02d:%02d' % (
nonstop[0],
nonstop[1],
- Schedule.DAY_MINUTE_START,
+ emissions_app_settings.DAY_MINUTE_START,
)
for schedule in (
# start grid after the night programs
grid = (
- grid[2 * Schedule.DAY_HOUR_START + (1 if Schedule.DAY_MINUTE_START else 0) :]
- + grid[: 2 * Schedule.DAY_HOUR_START + (1 if Schedule.DAY_MINUTE_START else 0)]
+ grid[
+ 2 * emissions_app_settings.DAY_HOUR_START
+ + (1 if emissions_app_settings.DAY_MINUTE_START else 0) :
+ ]
+ + grid[
+ : 2 * emissions_app_settings.DAY_HOUR_START
+ + (1 if emissions_app_settings.DAY_MINUTE_START else 0)
+ ]
)
# look for the case where the same emission has different schedules for