Transform a string like ' ' into 'scheme://host/path'. The string is returned unchanged if it's not a wrapped URL.
(url)
| 1221 | |
| 1222 | |
| 1223 | def unwrap(url): |
| 1224 | """Transform a string like '<URL:scheme://host/path>' into 'scheme://host/path'. |
| 1225 | |
| 1226 | The string is returned unchanged if it's not a wrapped URL. |
| 1227 | """ |
| 1228 | url = str(url).strip() |
| 1229 | if url[:1] == '<' and url[-1:] == '>': |
| 1230 | url = url[1:-1].strip() |
| 1231 | if url[:4] == 'URL:': |
| 1232 | url = url[4:].strip() |
| 1233 | return url |
| 1234 | |
| 1235 | |
| 1236 | def splittype(url): |