serve.py 文件源码

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

项目:earmark 作者: lowerquality 项目源码 文件源码
def onupload(self, upl):
        session_id = upl['path']

        # Start a session, if it seems to be a valid media file
        # XXX: this list is arbitrary; use MIME or smth
        if not session_id.split('.')[-1] in ['mp3', 'mp4', 'm4v', 'wav', 'aac', 'm4a', 'mkv', 'ogg', 'ogv', 'flac']:
            return

        self.db.onchange(None, {"type": "change",
                                "id": session_id,
                                "doc": {
                                    "_id": session_id,
                                    "type": "session",
                                    "peer": upl['filename'],
                                    "filename": upl['filename'],
                                    "s_time": time.time(),
                                    }})

        reactor.callInThread(self._process_upload, upl, session_id)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号