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


Python DBProxy.values方法代码示例

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


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

示例1: refresh_automsg

# 需要导入模块: from x84.bbs import DBProxy [as 别名]
# 或者: from x84.bbs.DBProxy import values [as 别名]
 def refresh_automsg(idx):
     """ Refresh automsg database, display automsg of idx, return idx. """
     session.flush_event('automsg')
     autodb = DBProxy('automsg')
     automsgs = sorted(autodb.values()) if len(autodb) else db_firstrecord
     dblen = len(automsgs)
     # bounds check
     if idx < 0:
         idx = dblen - 1
     elif idx > dblen - 1:
         idx = 0
     tm_ago, handle, msg = automsgs[idx]
     asc_ago = u'%s ago' % (timeago(time.time() - tm_ago))
     disp = (u''.join(('\r\n\r\n',
                       term.bold(handle.rjust(max_user)),
                       term.bold_blue(u'/'),
                       term.blue(u'%*d' % (len('%d' % (dblen,)), idx,)),
                       term.bold_blue(u':'),
                       term.blue_reverse(msg.ljust(automsg_len)),
                       term.bold(u'\\'),
                       term.blue(asc_ago),)))
     echo(u''.join((
         u'\r\n\r\n',
         Ansi(disp).wrap(term.width),
     )))
     return idx
开发者ID:jonny290,项目名称:yos-x84,代码行数:28,代码来源:logoff.py


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