本文整理汇总了Python中pyasm.search.SObject.get_sobject_dict方法的典型用法代码示例。如果您正苦于以下问题:Python SObject.get_sobject_dict方法的具体用法?Python SObject.get_sobject_dict怎么用?Python SObject.get_sobject_dict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.search.SObject
的用法示例。
在下文中一共展示了SObject.get_sobject_dict方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_behavior
# 需要导入模块: from pyasm.search import SObject [as 别名]
# 或者: from pyasm.search.SObject import get_sobject_dict [as 别名]
def get_behavior(cls, sobject):
'''it takes sobject as an argument and turn it into a dictionary to pass to
NotificationTestCmd'''
pal = WebContainer.get_web().get_palette()
bg_color = pal.color('background')
sobj_dict = SObject.get_sobject_dict(sobject)
sobj_json = jsondumps(sobj_dict)
bvr = {'type': 'click_up',
'cbjs_action': '''
var server = TacticServerStub.get();
var rtn = {};
var msg = '';
try
{
spt.app_busy.show( 'Email Test', 'Waiting for email server response...' );
rtn = server.execute_cmd('tactic.command.NotificationTestCmd', args={'sobject_dict': %s});
msg = rtn.description;
msg += '\\nYou can also review the notification in the Notification Log.'
}
catch(e) {
msg = 'Error found in this notification:\\n\\n' + spt.exception.handler(e);
}
//console.log(msg)
spt.app_busy.hide();
var popup_id = 'Notification test result';
var class_name = 'tactic.ui.panel.CustomLayoutWdg';
msg= msg.replace(/\\n/g, '<br/>');
var options = { 'html': '<div><div style="background:%s; padding: 5px">' + msg + '</div></div>'};
var kwargs = {'width':'600px'};
spt.panel.load_popup(popup_id, class_name, options, kwargs);
''' %(sobj_json, bg_color)}
return bvr