(
self, std_abbr, std_offset, dst_abbr, dst_offset, start=None, end=None
)
| 434 | ) |
| 435 | |
| 436 | def __init__( |
| 437 | self, std_abbr, std_offset, dst_abbr, dst_offset, start=None, end=None |
| 438 | ): |
| 439 | self.dst_diff = dst_offset - std_offset |
| 440 | std_offset = _load_timedelta(std_offset) |
| 441 | self.std = _ttinfo( |
| 442 | utcoff=std_offset, dstoff=_load_timedelta(0), tzname=std_abbr |
| 443 | ) |
| 444 | |
| 445 | self.start = start |
| 446 | self.end = end |
| 447 | |
| 448 | dst_offset = _load_timedelta(dst_offset) |
| 449 | delta = _load_timedelta(self.dst_diff) |
| 450 | self.dst = _ttinfo(utcoff=dst_offset, dstoff=delta, tzname=dst_abbr) |
| 451 | |
| 452 | # These are assertions because the constructor should only be called |
| 453 | # by functions that would fail before passing start or end |
| 454 | assert start is not None, "No transition start specified" |
| 455 | assert end is not None, "No transition end specified" |
| 456 | |
| 457 | self.get_trans_info = self._get_trans_info |
| 458 | self.get_trans_info_fromutc = self._get_trans_info_fromutc |
| 459 | |
| 460 | def transitions(self, year): |
| 461 | start = self.start.year_to_epoch(year) |
nothing calls this directly
no test coverage detected