Replace a URL in the configuration. Args: section: Section name option: Option name old_url: URL to replace new_url: New URL value Returns: True if replacement was made, False otherwise
(
self, section: str, option: str, old_url: str, new_url: str
)
| 1151 | return urls |
| 1152 | |
| 1153 | def replace_url( |
| 1154 | self, section: str, option: str, old_url: str, new_url: str |
| 1155 | ) -> bool: |
| 1156 | """ |
| 1157 | Replace a URL in the configuration. |
| 1158 | |
| 1159 | Args: |
| 1160 | section: Section name |
| 1161 | option: Option name |
| 1162 | old_url: URL to replace |
| 1163 | new_url: New URL value |
| 1164 | |
| 1165 | Returns: |
| 1166 | True if replacement was made, False otherwise |
| 1167 | """ |
| 1168 | replacement_made = False |
| 1169 | current_value = self.get_option(section, option) |
| 1170 | if current_value == old_url: |
| 1171 | self.set_option(section, option, new_url) |
| 1172 | replacement_made = True |
| 1173 | return replacement_made |
| 1174 | |
| 1175 | def validate_structure(self) -> list[str]: |
| 1176 | """ |