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


Python View.append_view_files方法代码示例

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


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

示例1: view

# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import append_view_files [as 别名]
 def view(self, header_names, lines, vertical_header=None, initial_sort=[], decimal_points=3):
   sub_views = []
   conv_lines = []
   # turn lines to html
   for line in lines:
     conv_line, sub_sub_views = convert_to_html(line)
     conv_lines.append(conv_line)
     sub_views += sub_sub_views
     
   conv_sort = []
   for s in initial_sort:
     dir = 0
     if s[1] == 'asc':
       dir = 0
     elif s[1] == 'desc':
       dir = 1
     else:
       raise Exception('Sort must either be asc or desc')
     conv_sort.append('[%d,%d]' % (header_names.index(s[0]), dir))
   conv_sort = ', '.join(conv_sort)
   conv_sort = '[%s]' % conv_sort
   data = OrderedDict()
   for i in xrange(len(header_names)):
     data[header_names[i]] = [l[i] for l in conv_lines]
   html = render('table.html', {
       'vertical_header' : vertical_header,
       'data' : data,
       'id' : self._get_unique_id(),
       'header_names': header_names,
       'lines': conv_lines,
       'sort': conv_sort})
   v = View(self, html, ['table.css'], ['jquery.tablesorter.js'])
   for sub in sub_views:
     v.append_view_files(sub)
   return v
开发者ID:ericjsolis,项目名称:danapeerlab,代码行数:37,代码来源:table.py

示例2: view

# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import append_view_files [as 别名]
 def view(self, center, left):
   html = render('leftpanel.html', {
     'id' : self._get_unique_id(),
     'center' : center.main_html,
     'left' : left.main_html})
   v = View(self, html, [], [])
   v.append_view_files(center)
   v.append_view_files(left)
   return v
开发者ID:ericjsolis,项目名称:danapeerlab,代码行数:11,代码来源:leftpanel.py

示例3: view

# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import append_view_files [as 别名]
 def view(self, collapsed_view, expanded_view):
   html = render('miniexpander.html', {
       'widget_id' : self.id,
       'id' : self._get_unique_id(),
       'collapsed' : collapsed_view.main_html,
       'expanded' : expanded_view.main_html,
       'shown' : self.values.shown == 'shown'})
   v = View(self, html, [], [])
   v.append_view_files(collapsed_view)
   v.append_view_files(expanded_view)
   return v
开发者ID:ericjsolis,项目名称:danapeerlab,代码行数:13,代码来源:miniexpander.py

示例4: view

# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import append_view_files [as 别名]
 def view(self, center, west=None, north=None, east=None, south=None):
   def convert_to_html_or_none(sub_item):
     if sub_item == None:
       return None, []
     html,views = convert_to_html([sub_item])
     html = ''.join(html)
     return html,views
   
   center_html, center_views  = convert_to_html_or_none(center)
   west_html, west_views  = convert_to_html_or_none(west)
   north_html, north_views  = convert_to_html_or_none(north)
   east_html, east_views  = convert_to_html_or_none(east)
   south_html, south_views = convert_to_html_or_none(south)
   html = render('layout.html', {
       'id' : self._get_unique_id(),
       'center_html' : center_html,
       'west_html' : west_html,
       'north_html' : north_html,
       'east_html' : east_html,
       'south_html' : south_html})
   v = View(self, html, ['layout-default-latest.css'], ['jquery.layout-latest.js'])
   for sub in sum([center_views, west_views, north_views, east_views, south_views], []):
     v.append_view_files(sub)
   return v
开发者ID:ericjsolis,项目名称:danapeerlab,代码行数:26,代码来源:layout.py


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