Common crawl optimizes search by working back to front ("org.example.www") This is a utility function for swapping the order back to the expected value ("www.example.org")
(value)
| 100 | |
| 101 | |
| 102 | def swap_order(value): |
| 103 | """ |
| 104 | Common crawl optimizes search by working back to front ("org.example.www") |
| 105 | This is a utility function for swapping the order back to the expected value ("www.example.org") |
| 106 | """ |
| 107 | parts = value.split(".") |
| 108 | |
| 109 | new_value = "" |
| 110 | for part in parts: |
| 111 | new_value = part + "." + new_value |
| 112 | new_value = new_value[:-1] |
| 113 | |
| 114 | return new_value |
| 115 | |
| 116 | |
| 117 | def parse_file(logger, vertices_file, reversed_zones, dns_manager): |