本文整理汇总了Python中pyasm.web.HtmlElement.ul方法的典型用法代码示例。如果您正苦于以下问题:Python HtmlElement.ul方法的具体用法?Python HtmlElement.ul怎么用?Python HtmlElement.ul使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.web.HtmlElement
的用法示例。
在下文中一共展示了HtmlElement.ul方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_display
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import ul [as 别名]
def get_display(my):
top = my.top
content_div = top
top.add_class("web_menu_wdg")
ul = HtmlElement.ul()
top.add(ul)
ul.add_class("main_ul")
# add in a context smart menu for all links
show_context_menu = my.kwargs.get("show_context_menu")
if show_context_menu in ['true', True]:
my.add_link_context_menu(content_div)
for view_item in my.view:
is_personal = False
if view_item.startswith('my_view_'):
is_personal = True
info = { 'counter' : 10, 'view': view_item, 'level': 1 }
config = my.get_config(my.config_search_type, view_item, default=my.default, personal=is_personal)
if not config:
continue
ret_val = my.generate_section( config, ul, info, personal=is_personal)
if ret_val == 'empty':
pass
return top
示例2: get_out_files_list
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import ul [as 别名]
def get_out_files_list(task_data_code, task_sobject_search_key):
out_files_list = get_task_data_out_files(task_data_code)
div_wdg = DivWdg()
if out_files_list:
out_files_unordered_html_list = HtmlElement.ul()
for out_file in out_files_list:
file_li = HtmlElement.li()
file_li.add('{0} ({1})'.format(out_file.get('file_path'), out_file.get('classification').title()))
file_edit_button = ButtonNewWdg(title='Edit File', icon='EDIT')
file_edit_button.add_behavior(
obu.get_load_popup_widget_with_reload_behavior(
'Edit File', 'widgets.EditFileWdg', out_file.get_search_key(),
'Task', 'widgets.TaskInspectWdg', task_sobject_search_key
)
)
file_edit_button.add_style('display', 'inline-block')
file_li.add(file_edit_button)
out_files_unordered_html_list.add(file_li)
div_wdg.add(out_files_unordered_html_list)
else:
div_wdg.add('No output files exist for this task')
return div_wdg
示例3: get_folder_wdg
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import ul [as 别名]
def get_folder_wdg(my, element_name, config, options, base_path, current_path, info, personal, use_same_config):
li = HtmlElement.li()
li.add_class("spt_side_bar_link")
li.add_class("main_li")
title = my._get_title(config, element_name)
title_wdg = DivWdg()
title_wdg.add_class("menu_header")
li.add(title_wdg)
title_wdg.add(title)
ul = HtmlElement.ul()
li.add(ul)
ul.add_class("spt_side_bar_section")
ul.add_class("sub_ul")
# then get view name from options in order to read a new
# config and recurse ...
options_view_name = options.get('view')
if options_view_name:
if use_same_config:
xml = config.get_xml()
sub_config = WidgetConfig.get(xml=xml)
sub_config.set_view(options_view_name)
else:
sub_config = my.get_config( my.config_search_type, options_view_name, default=my.default, personal=personal)
info['level'] += 1
my.generate_section( sub_config, ul, info, base_path=current_path, personal=personal, use_same_config=use_same_config )
info['level'] -= 1
return li
示例4: get_files_list
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import ul [as 别名]
def get_files_list(self):
outer_div = DivWdg()
file_in_package_sobjects = get_file_in_package_sobjects_by_package_code(self.package_sobject.get_code())
file_sobjects = get_file_sobjects_from_file_in_package_sobjects(file_in_package_sobjects)
files_unordered_html_list = HtmlElement.ul()
for file_sobject, file_in_package_sobject in zip(file_sobjects, file_in_package_sobjects):
task_sobject = file_in_package_sobject.get_all_children('sthpw/task')[0]
file_li = HtmlElement.li()
file_li.add(file_sobject.get('file_path') + ' - ' + task_sobject.get('status'))
change_status_button = ButtonNewWdg(title='Change Status', icon='EDIT')
change_status_button.add_behavior(
obu.get_load_popup_widget_with_reload_behavior(
'Change Status', 'widgets.ChangeStatusWdg', task_sobject.get_search_key(),
'Package', 'widgets.PackageInspectWdg', self.package_sobject.get_search_key()
)
)
change_status_button.add_style('display', 'inline-block')
file_li.add(change_status_button)
files_unordered_html_list.add(file_li)
outer_div.add(files_unordered_html_list)
return outer_div
示例5: get_selected_department_instructions_section
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import ul [as 别名]
def get_selected_department_instructions_section(self):
department_instructions_list = HtmlElement.ul()
department_instructions_list.add_style('list-style-type', 'none')
department_instructions_sobjects = get_department_instructions_sobjects_for_instructions_template_code(
self.instructions_template_sobject.get_code())
for department_instructions_sobject in department_instructions_sobjects:
li = HtmlElement.li()
li.add(self.get_div_for_department_instructions(department_instructions_sobject))
department_instructions_list.add(li)
return department_instructions_list
示例6: get_equipment_list
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import ul [as 别名]
def get_equipment_list(task_data_code):
equipment_sobjects_list = get_task_data_equipment(task_data_code)
div_wdg = DivWdg()
if equipment_sobjects_list:
equipment_unordered_html_list = HtmlElement.ul()
for name in [equipment_sobject.get('name') for equipment_sobject in equipment_sobjects_list]:
equipment_li = HtmlElement.li()
equipment_li.add(name)
equipment_unordered_html_list.add(equipment_li)
div_wdg.add(equipment_unordered_html_list)
else:
div_wdg.add('No equipment is assigned to this task')
return div_wdg
示例7: get_folder_wdg
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import ul [as 别名]
def get_folder_wdg(self, element_name, config, options, base_path, current_path, info, personal, use_same_config):
attributes = config.get_element_attributes(element_name)
if attributes.get("is_visible") == "false":
return
li = HtmlElement.li()
li.add_class("spt_side_bar_link")
li.add_class("main_li unselectable")
title = self._get_title(config, element_name)
title_wdg = DivWdg()
title_wdg.add_class("menu_header")
li.add(title_wdg)
title_wdg.add(title)
ul = HtmlElement.ul()
li.add(ul)
ul.add_class("spt_side_bar_section")
ul.add_class("sub_ul unselectable")
ul.add_style('cursor','pointer')
# then get view name from options in order to read a new
# config and recurse ...
options_view_name = options.get('view')
if options_view_name:
if use_same_config:
xml = config.get_xml()
sub_config = WidgetConfig.get(xml=xml)
sub_config.set_view(options_view_name)
else:
sub_config = self.get_config( self.config_search_type, options_view_name, default=self.default, personal=personal)
info['level'] += 1
self.generate_section( sub_config, ul, info, base_path=current_path, personal=personal, use_same_config=use_same_config )
info['level'] -= 1
return li
示例8: get_unselected_department_instructions_section
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import ul [as 别名]
def get_unselected_department_instructions_section(self):
department_instructions_list = HtmlElement.ul()
department_instructions_list.add_style('list-style-type', 'none')