-
Notifications
You must be signed in to change notification settings - Fork 3
/
SampleToolbox.pyt
100 lines (67 loc) · 2.74 KB
/
SampleToolbox.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import arcpy
import write_docs
import importlib
importlib.reload(write_docs)
class Toolbox(object):
def __init__(self):
self.label = "ProjectASTRAPythonToolbox"
self.alias = "ProjectASTRAPythonToolbox"
# custom attributes.. wasn't here originally:
self.purpose = "A nice multiline description, with some *bold* and _italic_ text just " + \
"to show how its done."
self.abstract = "*More* information on [https://github.com/ratnanil/PythonToolboxDocumentation](Github)" + \
self.credit = "Authors: Nils Ratnaweera"
self.tags = ["Some","nice","tags"]
self.limits = "No limits"
self.minScale = ""
self.maxScale = ""
# List of tool classes associated with this toolbox
self.tools = [sampletool]
##################################################################################################
# Sampletool ####################################################################################
##################################################################################################
class sampletool(object):
def __init__(self):
self.label = "00 Sampletool"
self.description = "A nice multiline description " + \
"to show how its done "
self.canRunInBackground = False
self.category = "A Category"
param1 = arcpy.Parameter(
displayName="param1",
name="param1",
datatype="GPFeatureLayer"
)
param1.dialogref = "Dialog reference"
self.parameters = [param1]
## Some Additional Metadata than can be stored for documentation
self.tags = ["tag1", "tag2", "tag3"]
self.limits = "Describe the limits of this tool"
self.credit = "Give credit to Authors, Papers etc."
self.minScale = ""
self.maxScale = ""
self.codeexamples = [
[
"The Title of my First Example",
"This is the description of my first exmple",
"def some_nice_pythoncode(text):"
" print(text) # notice the twoliner without backslash"
],
[
"The Title of my Second Example",
"This is the description of my second exmple",
"def more_pythoncode(text):"
" print(text)"
],
]
def getParameterInfo(self):
return self.parameters
def isLicensed(self):
return True
def updateParameters(self, parameters):
return
def updateMessages(self, parameters):
return
def execute(self, parameters, messages):
return
write_docs.main(Toolbox, "ASTRA_ArcpyToolbox")