Skip to main content
Question

When I try to execute python caller, FME seems to read a '(single quote) at the import statement, tripping my script?


When I try to run a pythoncaller within FME, every time I hit run, it generates an error, where it inserts a single quote (') at the first line of code. the quote does not exist. please help,

screenshot included below of the error:

0684Q00000ArD45QAF.png

and here is the script: (clearly no single quote existing in it)

import fme
import fme
import fmeobjects
import arcpy
import os
import sys
# Template Function interface:
# When using this function, make sure its name is set as the value of
# the 'Class or Function to Process Features' transformer parameter
def processFeature(feature):
    logger = fmeobjects.FMELogFile()
    logger.logMessageString("It's lo-og, lo-og.  It's big, it's heavy, it's wood!")

5 replies

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • March 20, 2018

That quote is only part of the log file. In the pythonCaller have you changed the Class or Function to process feature parameter to processFeature (as opposed to FeatureProcessor)?


  • Author
  • March 20, 2018
jdh wrote:

That quote is only part of the log file. In the pythonCaller have you changed the Class or Function to process feature parameter to processFeature (as opposed to FeatureProcessor)?

yes I have indeed

 

 


bruceharold
Contributor
Forum|alt.badge.img+17
  • Contributor
  • March 20, 2018
jdh wrote:

That quote is only part of the log file. In the pythonCaller have you changed the Class or Function to process feature parameter to processFeature (as opposed to FeatureProcessor)?

That's my guess too, 'need to call the function not the class, but it's very interesting arcpy is in the picture, will you be working with JSON feature representations?

 

 


takashi
Influencer
  • March 21, 2018

Hi @skischkel, as @jdh mentioned, the log file just quotes the script that raised an error with single quotations. Some messages describing reason for the error also should have been logged there. We cannot even imagine what happened unless you post the error messages.


jneujens
Forum|alt.badge.img
  • March 21, 2018

With that script, only import the fme and fmeobjects package. That should work fine?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings