forked from NatureServe-Canada/EBARTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestListTool.pyt
56 lines (45 loc) · 1.97 KB
/
TestListTool.pyt
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
46
47
48
49
50
51
52
53
54
55
56
# import python packages
import arcpy
import ListElementNationalIDsTool
class Toolbox(object):
def __init__(self):
"""Define the toolbox (the name of the toolbox is the name of the .pyt file)."""
self.label = 'Test List Tool'
self.alias = 'TestListTool'
# List of tool classes associated with this toolbox
self.tools = [ListElementNationalIDs]
class ListElementNationalIDs(object):
def __init__(self):
"""Define the tool (tool name is the name of the class)."""
self.label = 'List Element National IDs'
self.description = 'Generate a comma-separated list of ELEMENT_NATIONAL_ID values from existing ' + \
'BIOTICS_ELEMENT_NATIONAL table'
self.canRunInBackground = True
def getParameterInfo(self):
"""Define parameter definitions"""
# Geodatabase
param_geodatabase = arcpy.Parameter(
displayName='Geodatabase',
name='geodatabase',
datatype='DEWorkspace',
parameterType='Required',
direction='Input')
param_geodatabase.filter.list = ['Local Database', 'Remote Database']
params = [param_geodatabase]
return params
def isLicensed(self):
"""Set whether tool is licensed to execute."""
return True
def updateParameters(self, parameters):
"""Modify the values and properties of parameters before internal validation is performed. This method is
called whenever a parameter has been changed."""
return
def updateMessages(self, parameters):
"""Modify the messages created by internal validation for each tool parameter. This method is called
after internal validation."""
return
def execute(self, parameters, messages):
"""The source code of the tool."""
leni = ListElementNationalIDsTool.ListElementNationalIDsTool()
leni.runListElementNationalIDsTool(parameters, messages)
return