span8
span4
我想创建一个基类来继承python调用者类,以扩展或覆盖类行为,并避免在我的工作空间中重复一些python方法。
最多可使用10个附件(包括图像),每个附件的最大大小为4.0 MB,总大小为4.0 MB。
嗨@ediaze,有一些方法。
如果你在启动脚本中定义所有的类,例如
导入fme, fmeobjects类基(对象):def commonMethod(self, feature, attr, value): feature。setAttribute(attr, value) class Derived_A(Base): def input(self, feature): self.commonMethod(feature, '_a', 1) self.pyoutput(feature) class Derived_B(Base): def input(self, feature): self.commonMethod(feature, '_b', 2) self.pyoutput(feature)
您可以将各个PythonCaller的Python脚本字段留空,只需通过类或函数指定类名来处理Features参数。
如果你在一个外部脚本文件中定义了所有的类。”my_module.py),保存在与工作空间相同的文件夹中,可以直接从模块导入所需的类。
最多可使用10个附件(包括图像),每个附件的最大大小为4.0 MB,总大小为4.0 MB。
©2019安全亚搏在线软件公司法律