pktools 2.6.7
Processing Kernel for geospatial data
pktoolsAlgorithm.py
1# -*- coding: utf-8 -*-
2
3"""
4***************************************************************************
5 pktoolsAlgorithm.py
6 ---------------------
7 Date : April 2015
8 Copyright : (C) 2015 by Pieter Kempeneers
9 Email : kempenep at gmail dot com
10***************************************************************************
11* *
12* This program is free software; you can redistribute it and/or modify *
13* it under the terms of the GNU General Public License as published by *
14* the Free Software Foundation; either version 2 of the License, or *
15* (at your option) any later version. *
16* *
17***************************************************************************
18"""
19
20__author__ = 'Pieter Kempeneers'
21__date__ = 'April 2015'
22__copyright__ = '(C) 2015, Pieter Kempeneers'
23# This will get replaced with a git SHA1 when you do a git archive
24__revision__ = '$Format:%H$'
25
26from processing.core.GeoAlgorithm import GeoAlgorithm
27
28import os
29from PyQt4 import QtGui
30from pktools.pktoolsUtils import pktoolsUtils
31
32from processing.core.parameters import ParameterFile
33from processing.core.parameters import ParameterBoolean
34from processing.core.parameters import ParameterNumber
35from processing.core.parameters import ParameterString
36from processing.core.parameters import ParameterSelection
37from processing.core.outputs import OutputFile
38from processing.core.outputs import OutputRaster
39from processing.core.outputs import OutputVector
40
41class pktoolsAlgorithm(GeoAlgorithm):
42
43 def getIcon(self):
44 filepath = os.path.dirname(__file__) + "/logo.png"
45 return QtGui.QIcon(filepath)
46
47 def checkBeforeOpeningParametersDialog(self):
48 path = pktoolsUtils.pktoolsPath()
49 if path == "":
50 return "pktools folder is not configured.\nPlease configure it before running pktools algorithms."
51
52 def help(self):
53
54 #utilityName=self.__class__.__name__
55 helpUrl = 'http://pktools.nongnu.org/html/{}.html'.format(self.cliName())
56 return False, helpUrl