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


Python text.print_table函数代码示例

本文整理汇总了Python中trac.util.text.print_table函数的典型用法代码示例。如果您正苦于以下问题:Python print_table函数的具体用法?Python print_table怎么用?Python print_table使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: _do_list

 def _do_list(self):
     print_table([(m.name, m.due and
                     format_date(m.due, console_date_format),
                   m.completed and
                     format_datetime(m.completed, console_datetime_format))
                  for m in model.Milestone.select(self.env)],
                 [_("Name"), _("Due"), _("Completed")])
开发者ID:Stackato-Apps,项目名称:bloodhound,代码行数:7,代码来源:admin.py

示例2: _do_list

 def _do_list(self):
     print_table(
         [(title, int(edits), format_datetime(from_utimestamp(modified),
                                              console_datetime_format))
          for title, edits, modified in self.env.db_query("""
                 SELECT name, max(version), max(time)
                 FROM wiki GROUP BY name ORDER BY name""")
          ], [_("Title"), _("Edits"), _("Modified")])
开发者ID:pkdevbox,项目名称:trac,代码行数:8,代码来源:admin.py

示例3: _do_list

 def _do_list(self, realm=None):
     fts = FullTextSearch(self.env)
     realms = realm and [realm] or fts.index_realms
     fields = ['realm', 'id']
     query, response = fts._do_search('*', realms, sort_by=fields,
                                      field_limit=fields)
     rows = ((doc['realm'], doc['id']) for doc in fts._docs(query))
     print_table(rows, (_("Realm"), _("Id")))
开发者ID:CGI-define-and-primeportal,项目名称:trac-plugin-solr,代码行数:8,代码来源:admin.py

示例4: _list_expired

    def _list_expired(self, when=None):
        # Parse optional date argument
        when = when if when is None else datetime.strptime(when, '%Y-%m-%d')

        userstore = get_userstore()
        users = [(user.username, user.expires) for user in userstore.get_expired_users(when=when)]

        print_table(users, ('User', 'Expires'))
开发者ID:alvabai,项目名称:trac-multiproject,代码行数:8,代码来源:console.py

示例5: _do_list

 def _do_list(self):
     rm = RepositoryManager(self.env)
     values = []
     for (reponame, info) in sorted(rm.get_all_repositories().iteritems()):
         alias = ""
         if "alias" in info:
             alias = info["alias"] or "(default)"
         values.append((reponame or "(default)", info.get("type", ""), alias, info.get("dir", "")))
     print_table(values, [_("Name"), _("Type"), _("Alias"), _("Directory")])
开发者ID:moreati,项目名称:trac-gitsvn,代码行数:9,代码来源:admin.py

示例6: _do_list

 def _do_list(self, *sids):
     if not sids:
         sids = ['*']
     print_table([(r[0], r[1], format_date(to_datetime(r[2]),
                                           console_date_format),
                   r[3], r[4])
                  for r in self._get_list(sids)],
                 [_('SID'), _('Auth'), _('Last Visit'), _('Name'),
                  _('Email')])
开发者ID:trac-ja,项目名称:trac-ja,代码行数:9,代码来源:session.py

示例7: _do_list

 def _do_list(self):
     rm = RepositoryManager(self.env)
     values = []
     for (reponame, info) in sorted(rm.get_all_repositories().iteritems()):
         alias = ''
         if 'alias' in info:
             alias = info['alias'] or '(default)'
         values.append((reponame or '(default)', info.get('type', ''),
                        alias, info.get('dir', '')))
     print_table(values, [_('Name'), _('Type'), _('Alias'), _('Directory')])
开发者ID:zjj,项目名称:trac_hack,代码行数:10,代码来源:admin.py

示例8: _do_list

 def _do_list(self):
     db = self.env.get_db_cnx()
     cursor = db.cursor()
     cursor.execute("SELECT name, max(version), max(time) "
                    "FROM wiki GROUP BY name ORDER BY name")
     print_table([(r[0], int(r[1]),
                   format_datetime(from_utimestamp(r[2]),
                                   console_datetime_format))
                  for r in cursor],
                 [_('Title'), _('Edits'), _('Modified')])
开发者ID:wiraqutra,项目名称:photrackjp,代码行数:10,代码来源:admin.py

示例9: do_transaction

 def do_transaction(db):
     if name.endswith('*'):
         pages = list(WikiSystem(self.env).get_pages(name.rstrip('*')
                                                     or None))
         for p in pages:
             page = model.WikiPage(self.env, p, db=db)
             page.delete()
         print_table(((p,) for p in pages), [_('Deleted pages')])
     else:
         page = model.WikiPage(self.env, name, db=db)
         page.delete()
开发者ID:wiraqutra,项目名称:photrackjp,代码行数:11,代码来源:admin.py

示例10: _do_remove

 def _do_remove(self, name):
     with self.env.db_transaction:
         if name.endswith('*'):
             pages = list(WikiSystem(self.env).get_pages(name.rstrip('*')
                                                         or None))
             for p in pages:
                 page = model.WikiPage(self.env, p)
                 page.delete()
             print_table(((p,) for p in pages), [_('Deleted pages')])
         else:
             page = model.WikiPage(self.env, name)
             page.delete()
开发者ID:pkdevbox,项目名称:trac,代码行数:12,代码来源:admin.py

示例11: _do_list

    def _do_list(self):
        # Get downloads API component.
        api = self.env[DownloadsApi]

        # Create context.
        context = Context('downloads-consoleadmin')
        db = self.env.get_db_cnx()
        context.cursor = db.cursor()

        # Print uploded download
        downloads = api.get_downloads(context)
        print_table([(download['id'], download['file'], pretty_size(
          download['size']), format_datetime(download['time']), download['component'], download['version'],
          download['platform']['name'], download['type']['name']) for download in downloads], ['ID',
          'Filename', 'Size', 'Uploaded', 'Component', 'Version', 'Platform', 'Type'])
开发者ID:nagyistoce,项目名称:trac-downloads,代码行数:15,代码来源:consoleadmin.py

示例12: _do_list

 def _do_list(self, user=None):
     permsys = PermissionSystem(self.env)
     if user:
         rows = []
         perms = permsys.get_user_permissions(user)
         for action in perms:
             if perms[action]:
                 rows.append((user, action))
     else:
         rows = permsys.get_all_permissions()
     rows.sort()
     print_table(rows, [_('User'), _('Action')])
     print
     printout(_("Available actions:"))
     actions = permsys.get_actions()
     actions.sort()
     text = ', '.join(actions)
     printout(wrap(text, initial_indent=' ', subsequent_indent=' ', 
                   linesep='\n'))
     print
开发者ID:zjj,项目名称:trac_hack,代码行数:20,代码来源:perm.py

示例13: _validate_print_table

 def _validate_print_table(self, expected, data, **kwargs):
     out = StringIO()
     kwargs["out"] = out
     print_table(data, **kwargs)
     self.assertEqual(expected.encode("utf-8"), strip_line_ws(out.getvalue(), leading=False))
开发者ID:rvelezc,项目名称:rafaelvelez.us-backup,代码行数:5,代码来源:text.py

示例14: cli_report

 def cli_report(self):
     infos_dic = self._getTracVolume()
     infos = [(n, infos_dic[n]) for n in infos_dic]
     infos.sort
     print_table(infos, (_("type"), _("volume")))
开发者ID:nyuhuhuu,项目名称:trachacks,代码行数:5,代码来源:PlanetForgeExport.py

示例15: _display_status

 def _display_status(self):
     print "Env is " + self.env
     print_table([self.greetings])
开发者ID:ITAttractor,项目名称:trac-digest-reporter,代码行数:3,代码来源:main.py


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