本文整理汇总了Python中trac.util.text.print_table函数的典型用法代码示例。如果您正苦于以下问题:Python print_table函数的具体用法?Python print_table怎么用?Python print_table使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_table函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: package_versions
def package_versions(packages, out=None):
name_version_pairs = []
for name, accessor in packages:
version = resolve_accessor(accessor)
name_version_pairs.append((name, version))
print_table(name_version_pairs, ("Package", "Version"), ' : ', out)
开发者ID:pkdevbox,项目名称:trac,代码行数:6,代码来源:make_status.py
示例17: _do_product_list
def _do_product_list(self):
if not isinstance(self.env, ProductEnvironment):
print_table([(p.prefix, p.owner, p.name)
for p in Product.select(self.env)],
[_('Prefix'), _('Owner'), _('Name')])
开发者ID:mohsadki,项目名称:dargest,代码行数:5,代码来源:product_admin.py
示例18: _do_list
def _do_list(self, *sids):
if not sids:
sids = ["*"]
headers = (_("SID"), _("Auth"), _("Last Visit"), _("Name"), _("Email"), _("Default Handler"))
print_table(self._get_list(sids), headers)
开发者ID:pkdevbox,项目名称:trac,代码行数:5,代码来源:session.py
注:本文中的trac.util.text.print_table函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论