Skip to content

Instantly share code, notes, and snippets.

@ThomasG77
Created May 19, 2025 09:41
Show Gist options
  • Save ThomasG77/af8be0815f3cb3a6676169571dd84de2 to your computer and use it in GitHub Desktop.
Save ThomasG77/af8be0815f3cb3a6676169571dd84de2 to your computer and use it in GitHub Desktop.
plugin_file_to_patch = iface.userProfileManager().userProfile().folder() + '/python/plugins/' + 'cadastre' + '/dialogs/search_dialog.py'
# Read in the file
with open(plugin_file_to_patch, 'r') as file:
filedata = file.read()
# Replace the target string
filedata = filedata.replace("['ogc_fid', 'tex', 'idu', 'geo_section', 'geom', 'comptecommunal', 'geo_parcelle']", "['ogc_fid', 'tex', 'idu', 'geo_section', 'geom', 'geo_parcelle']")
# Write the file out again
with open(plugin_file_to_patch, 'w') as file:
file.write(filedata)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment