本文整理汇总了Python中gluon.restricted.TicketStorage.load方法的典型用法代码示例。如果您正苦于以下问题:Python TicketStorage.load方法的具体用法?Python TicketStorage.load怎么用?Python TicketStorage.load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gluon.restricted.TicketStorage
的用法示例。
在下文中一共展示了TicketStorage.load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: log_ticket
# 需要导入模块: from gluon.restricted import TicketStorage [as 别名]
# 或者: from gluon.restricted.TicketStorage import load [as 别名]
def log_ticket(ticket, logger=LOG):
"""Log a ticket."""
if not ticket:
return
# Ticket may have have the app prepended, for example:
# zcomx/108.162.141.78.2016-06-20.14-36-01.3ac605e2-5ff9-47f1-872f-ab291cdb
if '/' in ticket:
parts = ticket.split(os.sep)
ticket_id = parts[-1]
else:
ticket_id = ticket
if not ticket_id:
return
request = current.request
ticket_storage = TicketStorage()
app = None # 'app' is an errors sub directory, not used
contents = ticket_storage.load(request, app, ticket_id)
traceback = contents.get('traceback')
if not traceback:
return
for line in traceback.split("\n"):
logger.error(line)