Returns all the occurrences of the rrule between after and before. The inc keyword defines what happens if after and/or before are themselves occurrences. With inc=True, they will be included in the list, if they are found in the recurrence set.
(self, after, before, inc=False, count=1)
| 284 | yield d |
| 285 | |
| 286 | def between(self, after, before, inc=False, count=1): |
| 287 | """ Returns all the occurrences of the rrule between after and before. |
| 288 | The inc keyword defines what happens if after and/or before are |
| 289 | themselves occurrences. With inc=True, they will be included in the |
| 290 | list, if they are found in the recurrence set. """ |
| 291 | if self._cache_complete: |
| 292 | gen = self._cache |
| 293 | else: |
| 294 | gen = self |
| 295 | started = False |
| 296 | l = [] |
| 297 | if inc: |
| 298 | for i in gen: |
| 299 | if i > before: |
| 300 | break |
| 301 | elif not started: |
| 302 | if i >= after: |
| 303 | started = True |
| 304 | l.append(i) |
| 305 | else: |
| 306 | l.append(i) |
| 307 | else: |
| 308 | for i in gen: |
| 309 | if i >= before: |
| 310 | break |
| 311 | elif not started: |
| 312 | if i > after: |
| 313 | started = True |
| 314 | l.append(i) |
| 315 | else: |
| 316 | l.append(i) |
| 317 | return l |
| 318 | |
| 319 | |
| 320 | class rrule(rrulebase): |