Module as a wrapper for QgsComposition.
Contact : ole.moller.nielsen@gmail.com
Note
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Bases: object
Class for handling composition using specific template.
Load the template to composition.
To load template properly, you need to set the template and the map settings first (and template_substitution if you want to), e.g:
- template_composition = TemplateComposition(
- template_path=’/template/path’, map_settings=some_map_settings)
- substitution_map = {
- ‘impact-title’: title, ‘date’: date, ‘time’: time, ‘safe-version’: version, ‘disclaimer’: self.disclaimer
} template_composition.template_substitution = substitution_map template_composition.load_template()
or
template_composition = TemplateComposition() template_composition.template_path = ‘/template/path’ template_composition.map_settings = some_map_settings template_composition.load_template()
Raises: | LoadingTemplateError |
---|