Skip to main content
Released

Save personalised scripts PythonCaller

Related products:Transformers
  • August 31, 2016
  • 3 replies
  • 71 views

verdoodtdries
Enthusiast
Forum|alt.badge.img+23

I think it is useful to save personalised template scripts for the PythonCaller transformer.

Now, the template script looks like this:

import fme import fmeobjects # Template Function interface: def processFeature(feature):     pass # Template Class Interface: class FeatureProcessor(object):     def __inti__(self):         pass     def input(self, feature):         self.pyoutput(feature):     def close(self):         pass

Personally, I always add e.g. the line,

logfile = fmeobjects.FMELogFile()

and almost never use the template function.

Other FME-users might e.g. want to use by default:

import math

Therefore, I think it is usefull that any FME-user can save his own, personalised, template PythonCaller scripts.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

david_r
Celebrity
  • August 31, 2016

Great idea. I always start by erasing everything and copy-pasting my own template anyway.


verdoodtdries
Enthusiast
Forum|alt.badge.img+23
  • Author
  • Enthusiast
  • September 29, 2023

The PythonCaller transformer has a Presets option which allows to save your template Python script.


LizAtSafe
Safer
Forum|alt.badge.img+21
  • Safer
  • June 15, 2024
https://docs.safe.com/fme/html/FME-Form-Documentation/FME-Transformers/!Transformer_Parameters/Transformer_Defaults.htm