def draw_lines(start, total_duration, minute_scale, scale):
 result = u''
 next_line = 220
 next_time = start
 num_lines = (((total_duration // 60) // minute_scale) + 2)
 for line in range(num_lines):
  new_line = (u"<hr class='line' width='98%%' style='top:%dpx;'>" % next_line)
  result += new_line
  time = (u"<p class='time' style='top:%dpx;'> %02d:%02d </p>" % ((next_line - 20), next_time.hour, next_time.minute))
  result += time
  next_line += (minute_scale * scale)
  next_time += datetime.timedelta(minutes=minute_scale)
 return result

def draw_lines ( start , total_duration , minute_scale , scale ) : result = u'' next_line = 220 next_time = start num_lines = ( ( ( total_duration // 60 ) // minute_scale ) + 2 ) for line in range ( num_lines ) : new_line = ( u"<hr class='line' width='98%%' style='top:%dpx;'>" % next_line ) result += new_line time = ( u"<p class='time' style='top:%dpx;'> %02d:%02d </p>" % ( ( next_line - 20 ) , next_time . hour , next_time . minute ) ) result += time next_line += ( minute_scale * scale ) next_time += datetime . timedelta ( minutes = minute_scale ) return result
function to draw the minute line markers and timestamps parameters start : datetime .