(self, idx, tokens, info, hms_idx)
| 1103 | return (minute, second) |
| 1104 | |
| 1105 | def _parse_hms(self, idx, tokens, info, hms_idx): |
| 1106 | # TODO: Is this going to admit a lot of false-positives for when we |
| 1107 | # just happen to have digits and "h", "m" or "s" characters in non-date |
| 1108 | # text? I guess hex hashes won't have that problem, but there's plenty |
| 1109 | # of random junk out there. |
| 1110 | if hms_idx is None: |
| 1111 | hms = None |
| 1112 | new_idx = idx |
| 1113 | elif hms_idx > idx: |
| 1114 | hms = info.hms(tokens[hms_idx]) |
| 1115 | new_idx = hms_idx |
| 1116 | else: |
| 1117 | # Looking backwards, increment one. |
| 1118 | hms = info.hms(tokens[hms_idx]) + 1 |
| 1119 | new_idx = idx |
| 1120 | |
| 1121 | return (new_idx, hms) |
| 1122 | |
| 1123 | # ------------------------------------------------------------------ |
| 1124 | # Handling for individual tokens. These are kept as methods instead |
no test coverage detected