Lines Matching full:start
13 def __init__(self, start, end): argument
15 self.start = start
21 the given length, then return a (start, end) non-inclusive range
26 start, end = self.start, self.end
29 if start < 0:
30 start += length
31 if _is_content_range_valid(start, end, length):
33 return (start, stop)
53 s,e = self.start, self.end
64 self.start, self.end)
67 return iter((self.start, self.end))
77 start, end = m.groups()
78 if not start:
80 start = int(start)
82 return cls(start, None)
84 if start >= end:
86 return cls(start, end)
94 This header is ``start-stop/length``, where start-stop and length
98 def __init__(self, start, stop, length): argument
99 if not _is_content_range_valid(start, stop, length):
101 "Bad start:stop/length: %r-%r/%r" % (start, stop, length))
102 self.start = start
114 if self.start is None:
118 return 'bytes %s-%s/%s' % (self.start, stop, length)
124 start, stop, length = res.content_range
126 return iter([self.start, self.stop, self.length])
146 def _is_content_range_valid(start, stop, length, response=False): argument
147 if (start is None) != (stop is None):
149 elif start is None:
152 return 0 <= start < stop
153 elif start >= stop:
160 return 0 <= start < length