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


Python E.h2方法代码示例

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


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

示例1: weeklyNavigation

# 需要导入模块: from etgen.html import E [as 别名]
# 或者: from etgen.html.E import h2 [as 别名]
 def weeklyNavigation(cls, obj, ar):
     today = obj.date
     prev = cls.date2pk(DurationUnits.months.add_duration(today, -1))
     next = cls.date2pk(DurationUnits.months.add_duration(today, 1))
     elems = cls.calender_header(ar)
     header = [
         ar.goto_pk(prev, "<<"), " ",
         "{} {}".format(monthname(today.month), today.year),
         " ", ar.goto_pk(next, ">>")]
     elems.append(E.h2(*header, align="center"))
     rows = []
     for week in CALENDAR.monthdatescalendar(today.year, today.month):
         # each week is a list of seven datetime.date objects.
         cells = []
         current_week = week[0].isocalendar()[1]
         cells.append(E.td(str(current_week)))
         for day in week:
             pk = cls.date2pk(day)
             if day.isocalendar()[1] == today.isocalendar()[1]:
                 cells.append(E.td(str(day.day)))
             else:
                 cells.append(E.td(ar.goto_pk(pk, str(day.day))))
         rows.append(E.tr(*cells, align="center"))
     elems.append(E.table(*rows, align="center"))
     elems.append(E.p(ar.goto_pk(0, gettext("This week")), align="center"))
     # for o in range(-10, 10):
     #     elems.append(ar.goto_pk(o, str(o)))
     #     elems.append(" ")
     return E.div(*elems)
开发者ID:lino-framework,项目名称:xl,代码行数:31,代码来源:ui.py

示例2: render_request

# 需要导入模块: from etgen.html import E [as 别名]
# 或者: from etgen.html.E import h2 [as 别名]
    def render_request(self, ar, sar):
        """
        Render the given table action
        request. `ar` is the incoming request (the one which displays
        the dashboard), `sar` is the table we want to show (a child of
        `ar`).

        This is a helper function for shared use by :class:`ActorItem`
        and :class:`RequestItem`.
        """
        T = sar.actor
        if self.min_count is not None:
            if sar.get_total_count() < self.min_count:
                # print("20180212 render no rows in ", sar)
                return
        if self.header_level is not None:
            buttons = sar.plain_toolbar_buttons()
            buttons.append(
                ar.window_action_button(
                    T.default_action,
                    label="⏏", # 23CF
                    style="text-decoration:none;",
                    title=_("Show this table in own window")))
            
            elems = []
            for b in buttons:
                elems.append(b)
                elems.append(' ')
            
            yield E.h2(str(
                sar.actor.get_title_base(sar)), ' ', *elems)

        yield sar
开发者ID:lino-framework,项目名称:lino,代码行数:35,代码来源:dashboard.py

示例3: calender_header

# 需要导入模块: from etgen.html import E [as 别名]
# 或者: from etgen.html.E import h2 [as 别名]
 def calender_header(ar):
     header = "Calendar Type"
     elems = [E.h2(*header, align="center")]
     today_url = ar.renderer.js2url("""
             Lino.cal.DailyView.detail.run(null, {"record_id": 0})
             """)
     week_url = ar.renderer.js2url("""
                     Lino.cal.WeeklyView.detail.run(null, {"record_id": 0})
                     """)
     elems.append(E.p(ar.renderer.href(today_url, gettext("Day")), align="center"))
     elems.append(E.p(ar.renderer.href(week_url, gettext("Week")), align="center"))
     elems.append(E.p(ar.goto_pk(0, gettext("This month")), align="center"))
     return elems
开发者ID:lino-framework,项目名称:xl,代码行数:15,代码来源:ui.py

示例4: get_story

# 需要导入模块: from etgen.html import E [as 别名]
# 或者: from etgen.html.E import h2 [as 别名]
 def get_story(cls, self, ar):
     """
     Yield a sequence of story items. Every item can be (1) an
     ElementTree element or (2) a table or (3) an action request.
     """
     # cls.check_params(cls.param_values)
     if cls.report_items is None:
         raise Exception("{0} has no report_items".format(cls))
     for A in cls.report_items:
         yield E.h2(str(A.label))
         # if A.help_text:
         #     yield E.p(str(A.help_text))
         yield A
开发者ID:lino-framework,项目名称:lino,代码行数:15,代码来源:report.py


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