server_api.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:electronic-blackboard 作者: SWLBot 项目源码 文件源码
def get_upload_text_data(handler):
    try:
        text_data = {}
        text_data['result'] = 'fail'

        text_data['con'] = tornado.escape.xhtml_escape(handler.get_argument('con')).replace('&amp;nbsp','&nbsp').replace('&lt;br&gt;','<br>')
        text_data['title1'] = tornado.escape.xhtml_escape(handler.get_argument('title1')).replace('&amp;nbsp','&nbsp').replace('&lt;br&gt;','<br>')
        text_data['title2'] = tornado.escape.xhtml_escape(handler.get_argument('title2')).replace('&amp;nbsp','&nbsp').replace('&lt;br&gt;','<br>')
        text_data['description'] = tornado.escape.xhtml_escape(handler.get_argument('description')).replace('&lt;br&gt;','<br>').replace('&amp;nbsp','&nbsp')
        text_data['year'] = tornado.escape.xhtml_escape(handler.get_argument('year'))
        text_data['month'] = tornado.escape.xhtml_escape(handler.get_argument('month'))
        text_data['background_color'] = tornado.escape.xhtml_escape(handler.get_argument('background_color'))

        text_data['result'] = 'success'
        return text_data
    except Exception as e:
        print(str(e))
        return text_data
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号