当前位置: 首页>>代码示例>>Python>>正文


Python HtmlElement.h4方法代码示例

本文整理汇总了Python中pyasm.web.HtmlElement.h4方法的典型用法代码示例。如果您正苦于以下问题:Python HtmlElement.h4方法的具体用法?Python HtmlElement.h4怎么用?Python HtmlElement.h4使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyasm.web.HtmlElement的用法示例。


在下文中一共展示了HtmlElement.h4方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_next_tasks_div

# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import h4 [as 别名]
def get_next_tasks_div(task_sobject):
    div_wdg = DivWdg()

    div_wdg.add(HtmlElement.h4('Next Tasks'))

    pipeline_code = task_sobject.get_parent().get('pipeline_code')

    pipeline_xml = get_pipeline_xml(pipeline_code)

    next_task_processes = get_next_tasks_processes_from_xml(pipeline_xml, task_sobject.get('process'))

    if next_task_processes:
        for process in next_task_processes:
            div_wdg.add(process)

            next_task_sobject = get_task_sobject_from_xml_and_process(pipeline_xml, process,
                                                                          task_sobject.get('search_code'))

            if next_task_sobject:
                task_load_button = ButtonNewWdg(title='Load Order', icon='WORK')
                task_load_button.add_behavior(
                    obu.get_load_new_tab_behavior(
                        'task_{0}'.format(next_task_sobject.get_code()), process, 'widgets.TaskInspectWdg',
                        next_task_sobject.get_search_key()
                    )
                )
                task_load_button.add_style('display', 'inline-block')
                div_wdg.add(task_load_button)
    else:
        div_wdg.add('None')

    return div_wdg
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:34,代码来源:task_inspect_wdg.py

示例2: get_div_for_department_instructions

# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import h4 [as 别名]
    def get_div_for_department_instructions(self, department_instructions_sobject):
        department_instructions_div = DivWdg()

        department_instructions_div.add(HtmlElement.h4(department_instructions_sobject.get('name')))
        department_instructions_div.add(HtmlElement.p(department_instructions_sobject.get('instructions_text')))

        return department_instructions_div
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:9,代码来源:instructions_template_builder_wdg.py

示例3: get_display

# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import h4 [as 别名]
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('package_inspect_{0}'.format(self.package_sobject.get_code()))

        outer_div.add(get_page_header(self.package_sobject.get('name')))
        outer_div.add(HtmlElement.h4('Code: {0}'.format(self.package_sobject.get_code())))

        task_sobject = self.package_sobject.get_all_children('sthpw/task')[0]

        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')

        outer_div.add(HtmlElement.h4('Status: {0}'.format(task_sobject.get('status'))))
        outer_div.add(change_status_button)

        outer_div.add(HtmlElement.h4('<u>Files</u>'))
        outer_div.add(self.get_files_list())

        outer_div.add(HtmlElement.h4('<u>Instructions</u>'))

        instructions = self.package_sobject.get('delivery_instructions')

        if not instructions:
            instructions = 'Sorry, instructions have not been added yet.'

            outer_div.add(instructions.encode('utf-8'))

        outer_div.add(self.get_buttons_row())

        return outer_div
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:38,代码来源:package_inspect_wdg.py

示例4: get_display

# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import h4 [as 别名]
    def get_display(self):
        div_wdg = DivWdg()
        div_wdg.set_id('task_inspect_{0}'.format(self.task_sobject.get_code()))

        div_wdg.add(get_page_header(self.task_sobject.get('process')))
        div_wdg.add(HtmlElement.h4('Code: {0}'.format(self.task_sobject.get_code())))
        div_wdg.add(HtmlElement.h4('Package: {0} ({1})'.format(self.parent_component.get('name'),
                                                                 self.parent_component.get_code())))

        # Get the order that contains the parent component and display its information
        order_sobject = get_order_sobject_from_component_sobject(self.parent_component)
        div_wdg.add(HtmlElement.h4('Order: {0} ({1})'.format(order_sobject.get('name'), order_sobject.get_code())))

        div_wdg.add(HtmlElement.h4('<u>Status</u>'))
        div_wdg.add(get_task_status_select_wdg(self.task_sobject))

        div_wdg.add(HtmlElement.h4('<u>Estimated Hours: {0}</u>'.format(self.task_data.get('estimated_hours'))))

        change_estimated_hours_button = ButtonNewWdg(title='Change Estimated Hours', icon='TIME')
        change_estimated_hours_button.add_behavior(
            obu.get_load_popup_widget_with_reload_behavior(
                'Change Estimated Hours', 'widgets.ChangeEstimatedHoursForTaskWdg', self.task_sobject.get_search_key(),
                'Task', 'widgets.TaskInspectWdg', self.task_sobject.get_search_key()
            )
        )
        change_estimated_hours_button.add_style('display', 'inline-block')
        div_wdg.add(change_estimated_hours_button)

        add_input_file_button = ButtonNewWdg(title='Add Input Files', icon='INSERT_MULTI')
        add_input_file_button.add_behavior(
            obu.get_load_popup_widget_behavior('Add Input Files from Order',
                                               'widgets.AddInputFilesToTaskWdg',
                                               self.task_sobject.get_search_key())
        )
        add_input_file_button.add_style('display', 'inline-block')
        div_wdg.add(add_input_file_button)

        create_input_file_button = ButtonNewWdg(title='Create a new Input File', icon='ADD')
        create_input_file_button.add_behavior(
            obu.get_load_popup_widget_with_reload_behavior(
                'Create a new Input File', 'widgets.CreateNewInputFileForTaskWdg', self.task_sobject.get_search_key(),
                'Task', 'widgets.TaskInspectWdg', self.task_sobject.get_search_key()
            )
        )
        create_input_file_button.add_style('display', 'inline-block')
        div_wdg.add(create_input_file_button)

        move_input_file_to_output_button = ButtonNewWdg(title='Move Input File to Output', icon='RIGHT')
        move_input_file_to_output_button.add_behavior(
            obu.get_load_popup_widget_with_reload_behavior(
                'Move Input File to Output', 'widgets.MoveInputFileToOutputWdg', self.task_sobject.get_search_key(),
                'Task', 'widgets.TaskInspectWdg', self.task_sobject.get_search_key()
            )
        )
        move_input_file_to_output_button.add_style('display', 'inline-block')
        div_wdg.add(move_input_file_to_output_button)

        add_equipment_button = ButtonNewWdg(title='Add Equipment', icon='INSERT_MULTI')
        add_equipment_button.add_behavior(
            obu.get_load_popup_widget_with_reload_behavior('Add Equipment', 'widgets.EquipmentInTaskWdg',
                                                           self.task_sobject.get_search_key(), 'Task',
                                                           'widgets.TaskInspectWdg', self.task_sobject.get_search_key())
        )
        add_equipment_button.add_style('display', 'inline-block')
        div_wdg.add(add_equipment_button)

        if self.parent_component.get_search_type() == u'twog/component?project=twog':
            div_wdg.add(HtmlElement.h4('<u>Instructions</u>'))

            instructions_code = self.parent_component.get('instructions_code')
            instructions = get_task_instructions_text_from_instructions_code(instructions_code,
                                                                             self.task_sobject.get('process'))

            if not instructions:
                instructions = 'Sorry, instructions have not been added yet.'

            div_wdg.add(self.parse_instruction_text(instructions.encode('utf-8')))
        elif self.parent_component.get_search_type() == u'twog/package?project=twog':
            div_wdg.add(HtmlElement.h4('<u>Instructions</u>'))

            instructions = self.parent_component.get('delivery_instructions')

            if not instructions:
                instructions = 'Sorry, instructions have not been added yet.'

            div_wdg.add(self.parse_instruction_text(instructions.encode('utf-8')))

        div_wdg.add(self.get_buttons_row())

        submit_button = SubmitWdg('Submit Changes')
        submit_button.add_behavior(self.submit_button_behavior())
        submit_button.add_style('display', 'block')

        div_wdg.add(submit_button)

        return div_wdg
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:98,代码来源:delivery_task_inspect_wdg.py


注:本文中的pyasm.web.HtmlElement.h4方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。