db_transfer.py 文件源码

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

项目:shadowsocksR-b 作者: hao35954514 项目源码 文件源码
def pull_db_all_user(self):
        import cymysql
        #?????????
        if self.cfg["ssl_enable"] == 1:
            conn = cymysql.connect(host=self.cfg["host"], port=self.cfg["port"],
                    user=self.cfg["user"], passwd=self.cfg["password"],
                    db=self.cfg["db"], charset='utf8',
                    ssl={'ca':self.cfg["ssl_ca"],'cert':self.cfg["ssl_cert"],'key':self.cfg["ssl_key"]})
        else:
            conn = cymysql.connect(host=self.cfg["host"], port=self.cfg["port"],
                    user=self.cfg["user"], passwd=self.cfg["password"],
                    db=self.cfg["db"], charset='utf8')

        try:
            rows = self.pull_db_users(conn)
        finally:
            conn.close()

        if not rows:
            logging.warn('no user in db')
        return rows
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号