本文整理汇总了Python中pyasm.widget.ThumbWdg.set_options方法的典型用法代码示例。如果您正苦于以下问题:Python ThumbWdg.set_options方法的具体用法?Python ThumbWdg.set_options怎么用?Python ThumbWdg.set_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.widget.ThumbWdg
的用法示例。
在下文中一共展示了ThumbWdg.set_options方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GeneralPublishElementWdg
# 需要导入模块: from pyasm.widget import ThumbWdg [as 别名]
# 或者: from pyasm.widget.ThumbWdg import set_options [as 别名]
class GeneralPublishElementWdg(BaseTableElementWdg):
''' A general publish table element with the option of having a thumbnail '''
def get_arg_keys(self):
return {'view': 'a custom view other than publish'}
def preprocess(self):
if self.get_option('preview') != 'false':
self.thumb = ThumbWdg()
self.thumb.set_sobjects(self.sobjects)
self.thumb.set_icon_size(60)
# passing options from this to ThumbWdg, shouldn't have conflicts
options = self.options
self.thumb.set_options(options)
# for its own preprocess and data caching
def get_display(self):
self.view = self.kwargs.get('view')
if not self.view:
self.view = 'publish'
widget = Widget()
sobject = self.get_current_sobject()
search_type = sobject.get_search_type()
search_id = sobject.get_id()
if self.get_option('preview') != 'false':
self.thumb.set_current_index(self.get_current_index())
widget.add(self.thumb)
publish_link = PublishLinkWdg(search_type,search_id, config_base=self.view)
div = DivWdg(publish_link)
div.set_style('clear: left; padding-top: 6px')
widget.add(div)
# build a popup link to show publish browsing
browse_link = IconButtonWdg("Publish Browser", IconWdg.CONTENTS)
browse_link.add_behavior({'type': 'click_up',
'cbjs_action': 'spt.popup.get_widget(evt, bvr)',
'options': {'popup_id' : 'publish_browser',
'class_name' : 'pyasm.prod.web.PublishBrowserWdg' ,
'title': 'Publish Browser'},
'args' : { 'search_type': search_type,
'search_id' : search_id }
})
div.add(browse_link)
div.set_style('padding-top: 6px')
return widget