I have developed a python script to walk though directories picking dwg files that fit the pattern I want. I would like to add the script to a user parameter and pass/link the parameter to a reader source. For testing purposes I started with a simple script to return a single dwg, linked it to the reader source, and it failed with error...'Update Reader Failed'. My simple Python User Parameter scrips is as follows:
----
file = r'C:\\data\\dwgfoldertest\\Test1.dwg'
return file
-----
Any pointers would be appreciated. If I get the simple test working, I'll move onto the more complex Python oswalk script which will return a string of dwgs separated with commas, so if you have any tips on how FME will behave with that next step, that would be appreciated also.
Thank you,
Tyler
FME(R) 2020.1.2.0 (20200902 - Build 20620 - WIN64)




Python script: Simple hardcoded file raw filepath to be returned.
I am getting 'Undefined Macro, Update Reader failed' when updating the reader with this setup. I feel like the Python might not firing and therefore not returning the file path string. On the other hand, if it is firing, it is not clear to me that the Dataset field is accepting the returned file path string. Is there any way to test private parameter scripts? What data types and format does a reader dataset field accept from Python? Any recommended fixes or other pointers would be appreciated.