[Qgis-user] edit QGIS3.ini with startup.py

Thomas Schüttenberg thomas at qgis.de
Mon Dec 5 04:40:41 PST 2022


Hi there!
Because our servers have moved, the search paths for SVGs have changed. Unfortunately what we didn't think about before is that these old, wrong paths are (still) in the QGIS3.ini of the local user profiles and now cause eternal delays at startup because of their unreachability.

We already use a startup.py to add file paths in centralized manner, like this 

gdi_global_svg = 'L:/Daten/geoservice/config/qgis_global_settings/svg'
svg_paths = QgsSettings().value('svg/searchPathsForSVG')
if gdi_global_svg in svg_paths:
    pass
else:
    svg_paths.append(gdi_global_svg)
    QgsSettings().setValue('svg/searchPathsForSVG', svg_paths)

Despite my still lacking Python knowledge, I thought one could easily include a corresponding fix (e.g. search and replace) in the startup.py script... 
I am still googling but maybe someone could help me with this, please? That would save my day!

Best regards
Thomas


More information about the Qgis-user mailing list