Dev Space

Customize and extend the power of Alteryx with SDKs, APIs, custom tools, and more.
SOLVED

Python SDK - Object has no attribute message

cam_w
11 - Bolide

Hi all!

 

I've tried to resolve this error, but I can't find it after looking a couple of times for at least 30 minutes ... so I'm reaching out. The second line of the code below seems to be throwing the error within the pi_init method:

 

root = Et.fromstring(str_xml)
self.str_file_path = root.find('browseFiles').text if root.find('browseFiles').text else ''

 

It wasn't hitting that error until I added the 'FileBrowse' 'alteryx-pluginwidget' from the 'Python - InputGui.html' sample posted to github. I was already using 'root' to pull other fields from the XML. The error message received is:

 

Error: FTPy - FTP with Python (3): Traceback (most recent call last):
  File "FTPyEngine.py", line 47, in pi_init
AttributeError: 'NoneType' object has no attribute 'text'

Any ideas what I'm doing wrong? It's almost as if ... the 'FileBrowse' widget isn't ready to return text because the tool hasn't displayed yet. When I install the tool and drag it onto the canvas, the configuration area is blank, whereas before (without the 'FileBrowse' widget) the other fields were showing up in that panel.

 

If no one has ideas, I'm going to build the sample 'Input' tool and see if that one also has the issue described. If it doesn't ... I'll chew my boot, and then try again. :)

10 REPLIES 10
cam_w
11 - Bolide

Bonus comment: I know it's not related to the original issue, but if anyone's searching for this particular issue, here's what I needed to put for 2018.2 and v2 html includes to get the password field to show the dots.

 

<ayx data-ui-props = "{type: 'TextBox', placeholder: 'Enter Password'}" data-item-props = "{dataName: 'dN_Password', password: true, encryptionMode: 'machine'}"></ayx>

 

See also the thread with @chrisha and @TashaA here -- https://community.alteryx.com/t5/Dev-Space/Decrypting-Passwords-using-Python-SDK/m-p/184177