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

2022-12-05 Thread Thomas Schüttenberg via Qgis-user
Hi Stefan,

that's great! And even more simple/clean/save than I imagined.

Thanks very much, best regards
Thomas


> Stefan Giese (WhereGroup)  hat am 05.12.2022 
> 14:25 CET geschrieben:
> 
> 
> Hi Thomas,
> you can clear the section before adding the new values with:
> QgsSettings().remove('svg/searchPathsForSVG')
> and then add your values
> Best regards
> Stefan
> Mit freundlichen Grüßen
> Stefan Giese
> Projektleiter/Consultant
> -
> Aufwind durch Wissen!
> Jetzt neu: Web-Seminare und Online-Schulungen
> bei der www.foss-academy.com (http://www.foss-academy.com)
> -
> WhereGroup GmbH
> Schwimmbadstr. 2
> 79100 Freiburg
> Germany
> 
> Tel.: +49 (0)761 / 519 102 - 61
> Fax: +49 (0)761 / 519 102 - 11
> 
> stefan.gi...@wheregroup.com
> www.wheregroup.com (http://www.wheregroup.com)
> Geschäftsführer:
> Olaf Knopp, Peter Stamm
> Amtsgericht Bonn, HRB 9885
> 
> Am 05.12.2022 um 13:40 schrieb Thomas Schüttenberg via Qgis-user:
> 
> > 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
> > ___
> > Qgis-user mailing list
> > Qgis-user@lists.osgeo.org
> > List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
> > 
> -- 
> Mit freundlichen Grüßen
> Stefan Giese
> Projektleiter/Consultant
> -
> Aufwind durch Wissen!
> Jetzt neu: Web-Seminare und Online-Schulungen
> bei der www.foss-academy.com (http://www.foss-academy.com)
> -
> WhereGroup GmbH
> Schwimmbadstr. 2
> 79100 Freiburg
> Germany
> 
> Tel.: +49 (0)761 / 519 102 - 61
> Fax: +49 (0)761 / 519 102 - 11
> 
> stefan.gi...@wheregroup.com
> www.wheregroup.com (http://www.wheregroup.com)
> Geschäftsführer:
> Olaf Knopp, Peter Stamm
> Amtsgericht Bonn, HRB 9885
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


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

2022-12-05 Thread Stefan Giese (WhereGroup) via Qgis-user

Hi Thomas,

you can clear the section before adding the new values with:

/QgsSettings().remove('svg/searchPathsForSVG')/

and then add your values

Best regards

Stefan

Mit freundlichen Grüßen
Stefan Giese
Projektleiter/Consultant
-
Aufwind durch Wissen!
Jetzt neu: Web-Seminare und Online-Schulungen
bei derwww.foss-academy.com
-
WhereGroup GmbH
Schwimmbadstr. 2
79100 Freiburg
Germany

Tel.: +49 (0)761 / 519 102 - 61
Fax: +49 (0)761 / 519 102 - 11

stefan.gi...@wheregroup.com
www.wheregroup.com
Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885

Am 05.12.2022 um 13:40 schrieb Thomas Schüttenberg via Qgis-user:

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
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info:https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe:https://lists.osgeo.org/mailman/listinfo/qgis-user


--
Mit freundlichen Grüßen
Stefan Giese
Projektleiter/Consultant
-
Aufwind durch Wissen!
Jetzt neu: Web-Seminare und Online-Schulungen
bei derwww.foss-academy.com
-
WhereGroup GmbH
Schwimmbadstr. 2
79100 Freiburg
Germany

Tel.: +49 (0)761 / 519 102 - 61
Fax: +49 (0)761 / 519 102 - 11

stefan.gi...@wheregroup.com
www.wheregroup.com
Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user