本文整理汇总了Python中CPL.p_id方法的典型用法代码示例。如果您正苦于以下问题:Python CPL.p_id方法的具体用法?Python CPL.p_id怎么用?Python CPL.p_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPL
的用法示例。
在下文中一共展示了CPL.p_id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: str
# 需要导入模块: import CPL [as 别名]
# 或者: from CPL import p_id [as 别名]
fail2 = c.try_lookup_object(prefix, 'no-name', entity_type)
if fail2:
print 'Returned an object:' + str(fail2.id)
sys.exit(1)
print 'Look up non-existent object (prefix failure)'
fail3 = c.try_lookup_object('no-prefix', agent_name, agent_type)
if fail3:
print 'Returned an object:' + str(fail3.id)
sys.exit(1)
print 'Look up all objects with name:' + str(entity_name) + ' type:' + str(entity_type)
entity_all = c.lookup_all_objects(prefix, entity_name, entity_type, bundle)
i = 0
for t in entity_all:
CPL.p_id(t.id, with_newline = True)
i += 1
if i >= 10 and len(bundle_all) > 10:
print ' ... (' + str(len(entity_all)) + ' objects total)'
break
print 'All objects'
all_objects = c.get_all_objects(True)
i = 0
for t in all_objects:
CPL.p_id(t.object.id, with_newline = False)
i += 1
if i >= 10 and len(all_objects) > 10:
print ' ... (' + str(len(all_objects)) + ' objects total)'
break
示例2: print
# 需要导入模块: import CPL [as 别名]
# 或者: from CPL import p_id [as 别名]
print '----- Create tests -----'
print
obj1_name = "Process A"
obj1_type = 'proc'
print ('Create object name: ' +
obj1_name + ' type: ' + obj1_type + ' container: void')
o1 = c.create_object(originator, obj1_name, obj1_type)
CPL.p_object(o1, True)
CPL.p_object_version(o1.current_version(), True)
obj2_name = "File A"
obj2_type = 'file'
print ('Create object name: ' + obj2_name + ' type: ' + obj2_type +
' container: ')
CPL.p_id(o1.id, with_newline=True)
o2 = c.create_object(originator, obj2_name, obj2_type, o1)
CPL.p_object(o2)
obj3_name = "Process B"
obj3_type = 'proc'
print ('Create object name: ' +
obj3_name + ' type: ' + obj3_type + ' container: ')
CPL.p_id(o1.id, with_newline=True)
o3 = c.create_object(originator, obj3_name, obj3_type, o1)
CPL.p_object(o3)
obj4_name = "File B"
obj4_type = 'file'
print ('Create object name: ' +
obj4_name + ' type: ' + obj4_type + ' container: NONE')