def as_xml(self):
xml_result = Element(self.plugin_command, title=self.COMMAND_TITLE)
resumption_rate_xml = Element(
'sessionResumptionWithSessionIDs',
attrib={'totalAttempts': str(self.attempted_resumptions_nb),
'errors': str(len(self.errored_resumptions_list)),
'isSupported': str(self.attempted_resumptions_nb == self.successful_resumptions_nb),
'successfulAttempts': str(self.successful_resumptions_nb),
'failedAttempts': str(self.failed_resumptions_nb)}
)
# Add error messages if there was any
for error_msg in self.errored_resumptions_list:
resumption_error_xml = Element('error')
resumption_error_xml.text = error_msg
resumption_rate_xml.append(resumption_error_xml)
xml_result.append(resumption_rate_xml)
return xml_result
session_resumption_plugin.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录