Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys, arcpy, os
- class Toolbox(object):
- def __init__(self):
- """Define the toolbox (the name of the toolbox is the name of the
- .pyt file)."""
- self.label = "EGDB Data Steward Version"
- self.alias = ""
- # List of tool classes associated with this toolbox
- self.tools = [Prep]
- class Prep(object):
- def __init__(self):
- """Define the tool (tool name is the name of the class)."""
- self.label = "Prepare for Reconcile and Post"
- self.description = "Create grandfather version of editor for DS"
- self.canRunInBackground = False
- def getParameterInfo(self):
- #Define parameter definitions
- params = []
- # First parameter
- param0 = arcpy.Parameter(
- displayName="Editor's Version Name",
- name="editor_full_versionname",
- datatype="GPString",
- parameterType="Required",
- direction="Input")
- param0.filter.type = "ValueList"
- param0.filter.list = [v.name for v in arcpy.da.ListVersions(r"\inpyosegis05DatabaseConnectionFilesDataStewardsOnlyYOSEGIS_VectorYOSE_DS.sde")
- if v.name not in ["dbo.DEFAULT", "DS.Draft"]] #Take DEFAULT and Draft off the drop-down list as choices.
- # Second parameter
- param1 = arcpy.Parameter(
- displayName="Data Steward's Initials",
- name="DS_initials",
- datatype="GPString",
- parameterType="Required",
- direction="Input")
- params = [param0, param1]
- 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."""
- param0 = arcpy.Parameter(
- displayName="Editor's Version Name",
- name="editor_full_versionname",
- datatype="GPString",
- parameterType="Required",
- direction="Input")
- param0.filter.type = "ValueList"
- param0.filter.list = [v.name for v in arcpy.da.ListVersions(r"\inpyosegis05DatabaseConnectionFilesDataStewardsOnlyYOSEGIS_VectorYOSE_DS.sde")
- if v.name not in ["dbo.DEFAULT", "DS.Draft"]] #Take DEFAULT and Draft off the drop-down list as choices.
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement