Commits

Jason Scheirer committed dd3fbd1

Drill down to .value.value if needed

  • Participants
  • Parent commits 22c87b8

Comments (0)

Files changed (2)

File converttbx.pyt

     def isLicensed(self):
         return True
     def updateParameters(self, parameters):
+        if parameters[0].valueAsText and (not (parameters[1].valueAsText or parameters[1].altered)):
+            if os.path.isdir(os.path.dirname(parameters[0].valueAsText)):
+                newnamepart = os.path.splitext(parameters[0].valueAsText)[0]
+                newnamepart += u"_converted.pyt"
+                parameters[1].value = newnamepart
         pass
     def updateMessages(self, parameters):
         pass
         os.chdir(oldcwd)
 
 def set_parameter_as_text(params, index, val):
-    params[index].value = val
+    if (hasattr(params[index].value, 'value'):
+        params[index].value.value = val
+    else:
+        params[index].value = val
 """
 
 FUNCTION_REMAPPINGS = (