本文整理汇总了Python中OFS.SimpleItem.SimpleItem.__call__方法的典型用法代码示例。如果您正苦于以下问题:Python SimpleItem.__call__方法的具体用法?Python SimpleItem.__call__怎么用?Python SimpleItem.__call__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OFS.SimpleItem.SimpleItem
的用法示例。
在下文中一共展示了SimpleItem.__call__方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _setup_workflow
# 需要导入模块: from OFS.SimpleItem import SimpleItem [as 别名]
# 或者: from OFS.SimpleItem.SimpleItem import __call__ [as 别名]
def _setup_workflow(self):
args = {'id': 'collection',
'title': 'mock_collection',
'year': '2011',
'endyear': '2012',
'partofyear': 'wholeyear',
'country': 'http://rod.eionet.eu.int/spatial/2',
'locality': '',
'descr': '',
'dataflow_uris': ['http://rod.eionet.eu.int/obligations/8'],
'dataflow_uris': [],
'allow_collections': True,
'allow_envelopes': True}
col = Collection(**args)
self.app._setObject('collection', col)
self.app._setObject('Templates', Folder('Templates'))
template = SimpleItem()
template.id = 'StartActivity'
template.__call__ = Mock(return_value='Envelope Test Template')
self.app.Templates._setOb('StartActivity', template)
self.app.Templates.StartActivity.title_or_id = Mock(return_value='Start Activity Template')
self.create_process(self, 'process')
self.wf.addApplication('StartActivity', 'Templates/StartActivity')
self.wf.process.addActivity('AutoBegin',
split_mode='xor',
join_mode='xor',
start_mode=1,
application='StartActivity')
self.wf.process.begin = 'AutoBegin'
self.wf.setProcessMappings('process', '1', '1')
示例2: create_cepaa_set
# 需要导入模块: from OFS.SimpleItem import SimpleItem [as 别名]
# 或者: from OFS.SimpleItem.SimpleItem import __call__ [as 别名]
def create_cepaa_set(self, idx):
col_id = "col%s" %idx
env_id = "env%s" %idx
proc_id = "proc%s" %idx
act_id = "act%s" %idx
app_id = "act%s" %idx
country = 'http://spatial/%s' %idx
dataflow_uris = 'http://obligation/%idx' %idx
"create collection, envelope, process, activity, application"
col = Collection(col_id, country=country, dataflow_uris=dataflow_uris)
self.app._setOb(col_id, col)
self.app.Templates.StartActivity = Mock(return_value='Test Application')
self.app.Templates.StartActivity.title_or_id = Mock(return_value='Start Activity Template')
self.create_process(self, proc_id)
self.wf.addApplication(app_id, 'SomeFolder/%s' %app_id)
self.app.Applications._setOb(proc_id, Folder(proc_id))
proc = getattr(self.app.Applications, proc_id)
app = SimpleItem(app_id)
app.id = app_id
app.__call__ = Mock(return_value='Test Application')
proc._setOb(app_id, app)
getattr(self.wf, proc_id).addActivity(act_id,
split_mode='xor',
join_mode='xor',
start_mode=1)
getattr(self.wf, proc_id).begin = act_id
self.wf.setProcessMappings(proc_id, '1', '1')
env = Envelope(process=getattr(self.wf, proc_id),
title='FirstEnvelope',
authUser='TestUser',
year=2012,
endyear=2013,
partofyear='January',
country='http://spatial/1',
locality='TestLocality',
descr='TestDescription')
env._content_registry_ping = Mock()
env.id = env_id
getattr(self.app, col_id)._setOb(env_id, env)
setattr(self, col_id, getattr(self.app, col_id))
setattr(self, env_id, getattr(getattr(self.app, col_id), env_id))
getattr(self, env_id).startInstance(self.app.REQUEST)