[Qgis-user] QGIS shutdown python script

Etienne Tourigny etourigny.dev at gmail.com
Tue Feb 4 08:32:34 PST 2014


You could place your code in your plugin's unload() method.  But I'm not
sure this would work, because some things might not be available at that
time (e.g. layers, etc.).

See this page for a simple example
http://www.qgis.org/en/docs/pyqgis_developer_cookbook/plugins.html


On Tue, Feb 4, 2014 at 7:41 AM, McDonaldR <McDonaldR at angus.gov.uk> wrote:

>    Hi List
>
>
>
> Is it possible for QGIS to run a (python) script on shutdown?  There is a
> feature on the QGIS issues list about startup scripts (
> http://hub.qgis.org/issues/6297) - can shutdown scripts be used in the
> same way?
>
>
>
> Say, for example, I have a project in which I am editing a dataset in a
> spatialite database. At the end of the edit session I save my work and
> shutdown QGIS. Before shutdown actually happens a python script/batch file
> runs which zips the spatialite database and copies it to a remote server
> location ready for processing by some other software.
>
>
>
> Thanks
>
>
>
> Ross
>
>
>
> *Ross McDonald *| GIS Data Coordinator | Resources Department, IT
> Division | Angus Council, Angus House, Orchardbank Business Park, Forfar,
> DD8 1AT
>
> T: *01307 476419* | F: 01307 476401 | E: mcdonaldr at angus.gov.uk | W: *Angus
> Maps <http://www.angus.gov.uk/maps/map_home.cfm>*
>
>
>
>
> This message is strictly confidential. If you have received this in error,
> please inform the sender and remove it from your system. If received in
> error you may not copy, print, forward or use it or any attachment in any
> way. This message is not capable of creating a legal contract or a binding
> representation and does not represent the views of Angus Council. Emails
> may be monitored for security and network management reasons.  Messages
> containing inappropriate content may be intercepted. Angus Council does not
> accept any liability for any harm that may be caused to the recipient
> system or data on it by this message or any attachment.
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20140204/d507c836/attachment.html>


More information about the Qgis-user mailing list