(text_with_extractable_segment)
| 147 | |
| 148 | |
| 149 | def extract_segment(text_with_extractable_segment): |
| 150 | from wal_e.storage import BASE_BACKUP_REGEXP |
| 151 | from wal_e.storage.base import SegmentNumber |
| 152 | |
| 153 | match = re.match(BASE_BACKUP_REGEXP, text_with_extractable_segment) |
| 154 | if match is None: |
| 155 | return None |
| 156 | else: |
| 157 | groupdict = match.groupdict() |
| 158 | return SegmentNumber(log=groupdict['log'], seg=groupdict['seg']) |
| 159 | |
| 160 | |
| 161 | def parse_boolean_envvar(val): |