Skip to main content

Hello,

I am trying to use Python caller to check if a folder exist. Here is the code:

But it doesnt geve back outcome to attribute "van". Where is my mistake?

import fme
import fmeobjects
import os

def processFeature(feature):
    van = os.path.isdir(feature.getAttribute('_LAS_eleresiutvonal'))
    print van
    feature.setAttribute('_van', van)
class FeatureProcessor(object):
    def __init__(self):
        pass
    def input(self,feature):   
        self.pyoutput(feature)
    def close(self):
        pass

What version of python are you using? That code won't work for python 3

Have you enterd _van in the Attributes to Expose parameter


What version of python are you using? That code won't work for python 3

Have you enterd _van in the Attributes to Expose parameter

I tried it but it gives back missing values :


Is your class or function to process features set to processFeature (good) or FeatureProcessor (bad in this case)?


I tried it but it gives back missing values :

Is everything else set up exactly as the screenshot?


Is everything else set up exactly as the screenshot?

everything is okay, only python output is missing


In the above code, the lines 9-15 are not (should not be) used. Try deleting these lines and see if you get a different error message.


In the above code, the lines 9-15 are not (should not be) used. Try deleting these lines and see if you get a different error message.

I deleted, now it says:

 

 

PythonFactory failed to load python symbol `FeatureProcessor'
Factory proxy not initialized
PythonCaller(PythonFactory): PythonFactory failed to process feature

everything is okay, only python output is missing

If you look at the screenshot, you will see that class or Function to process feature is set to processFeature, and the additional unwanted code is deleted. If you set up your pythoncaller exactly as posted it will work

The bit in yellow needs to be set to match the bit in red so processFeature

You are calling a class that doesn't exist


If you look at the screenshot, you will see that class or Function to process feature is set to processFeature, and the additional unwanted code is deleted. If you set up your pythoncaller exactly as posted it will work

I got it, it works well ;)


I deleted, now it says:

 

 

PythonFactory failed to load python symbol `FeatureProcessor'
Factory proxy not initialized
PythonCaller(PythonFactory): PythonFactory failed to process feature

Thanks, now we see the real error. Do as suggested by @ebygomm and it should work.


Reply