forked from kartoza/otf-project
-
Notifications
You must be signed in to change notification settings - Fork 1
/
otf_project.py
executable file
·45 lines (38 loc) · 1.79 KB
/
otf_project.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# -*- coding: utf-8 -*-
"""
***************************************************************************
OTF QGIS Project
---------------------
Date : June 2016
Copyright : (C) 2016 by Etienne Trimaille
Email : etienne at kartoza dot com
***************************************************************************
* *
* 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. *
* *
***************************************************************************
"""
from qgis.core import QgsMessageLog, QgsLogger
# from filters.create_project import CreateProject
from filters.map_composition import MapComposition
__author__ = 'Etienne Trimaille'
__date__ = '25/05/2016'
class OtfProjectServer(object):
"""Test plugin for QGIS server
this plugin loads all filters from the 'filters' directory and logs
errors"""
def __init__(self, server_iface):
QgsMessageLog.logMessage(
'SUCCESS - OTF Project init', 'plugin', QgsMessageLog.INFO)
filters = [MapComposition]
for i, f in enumerate(filters):
name = f.__name__
try:
server_iface.registerFilter(f(server_iface), i)
QgsMessageLog.logMessage('OTF Project - loading %s' % name)
except Exception, e:
QgsMessageLog.logMessage(
'OTF Project - Error loading %s : %s' % (name, e))