Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
radiopanik
panikweb
Commits
be84fc46
Commit
be84fc46
authored
Aug 21, 2013
by
fred
Browse files
use new get_duration() function to get real slot duration
parent
586ce67e
Changes
1
Hide whitespace changes
Inline
Side-by-side
panikweb/views.py
View file @
be84fc46
...
...
@@ -39,7 +39,7 @@ class TimeCell:
def
add_schedule
(
self
,
schedule
):
end_time
=
schedule
.
datetime
+
timedelta
(
minutes
=
schedule
.
emission
.
duration
)
minutes
=
schedule
.
get_
duration
()
)
self
.
time_label
=
'%02d:%02d-%02d:%02d'
%
(
schedule
.
datetime
.
hour
,
schedule
.
datetime
.
minute
,
...
...
@@ -54,7 +54,7 @@ class TimeCell:
return
self
.
nonstop
def
__eq__
(
self
,
other
):
return
(
unicode
(
self
)
==
unicode
(
other
))
return
(
unicode
(
self
)
==
unicode
(
other
)
and
self
.
time_label
==
other
.
time_label
)
class
Grid
(
TemplateView
):
...
...
@@ -99,7 +99,7 @@ class Grid(TemplateView):
int
(
math
.
ceil
(
schedule
.
datetime
.
minute
/
30
))
day_no
=
schedule
.
get_weekday
()
for
step
in
range
(
int
(
math
.
ceil
(
schedule
.
emission
.
duration
/
30
))):
for
step
in
range
(
int
(
math
.
ceil
(
schedule
.
get_
duration
()
/
30
.
))):
if
grid
[(
row_start
+
step
)
%
nb_lines
][
day_no
]
is
None
:
grid
[(
row_start
+
step
)
%
nb_lines
][
day_no
]
=
TimeCell
()
grid
[(
row_start
+
step
)
%
nb_lines
][
day_no
].
add_schedule
(
schedule
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment