Python sqlite3 模块,PrepareProtocol() 实例源码

我们从Python开源项目中,提取了以下25个代码示例,用于说明如何使用sqlite3.PrepareProtocol()

项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def __conform__(self, protocol):
            if protocol is sqlite.PrepareProtocol:
                return self.val
            else:
                return None
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def tearDown(self):
        del sqlite.adapters[(int, sqlite.PrepareProtocol)]
        self.cur.close()
        self.con.close()
项目:vsphere-storage-for-docker    作者:vmware    | 项目源码 | 文件源码
def __conform__(self, protocol):
            if protocol is sqlite.PrepareProtocol:
                return self.val
            else:
                return None
项目:vsphere-storage-for-docker    作者:vmware    | 项目源码 | 文件源码
def tearDown(self):
        del sqlite.adapters[(int, sqlite.PrepareProtocol)]
        self.cur.close()
        self.con.close()
项目:OSPTF    作者:xSploited    | 项目源码 | 文件源码
def __conform__(self, protocol):
            if protocol is sqlite.PrepareProtocol:
                return self.val
            else:
                return None
项目:OSPTF    作者:xSploited    | 项目源码 | 文件源码
def tearDown(self):
        del sqlite.adapters[(int, sqlite.PrepareProtocol)]
        self.cur.close()
        self.con.close()
项目:pyrqlite    作者:rqlite    | 项目源码 | 文件源码
def register_adapter(type_, function):
    adapters[(type_, sqlite3.PrepareProtocol)] = function
项目:pyrqlite    作者:rqlite    | 项目源码 | 文件源码
def _adapt_from_python(value):
    if not isinstance(value, basestring):
        adapter_key = (type(value), sqlite3.PrepareProtocol)
        adapter = adapters.get(adapter_key)
        try:
            if adapter is None:
                # Fall back to _default_adapters, so that ObjectAdaptationTests
                # teardown will correctly restore the default state.
                adapter = _default_adapters[adapter_key]
        except KeyError as e:
            # No adapter registered. Let the object adapt itself via PEP-246.
            # It has been rejected by the BDFL, but is still implemented
            # on stdlib sqlite3 module even on Python 3 !!
            if hasattr(value, '__adapt__'):
                adapted = value.__adapt__(sqlite3.PrepareProtocol)
            elif hasattr(value, '__conform__'):
                adapted = value.__conform__(sqlite3.PrepareProtocol)
            else:
                raise InterfaceError(e)
        else:
            adapted = adapter(value)
    else:
        adapted = value

    # The adapter could had returned a string
    if isinstance(adapted, (bytes, unicode)):
        adapted = _escape_string(adapted)
    elif adapted is None:
        adapted = 'NULL'
    else:
        adapted = str(adapted)

    return adapted
项目:pupy    作者:ru-faraon    | 项目源码 | 文件源码
def __conform__(self, protocol):
            if protocol is sqlite.PrepareProtocol:
                return self.val
            else:
                return None
项目:pupy    作者:ru-faraon    | 项目源码 | 文件源码
def tearDown(self):
        del sqlite.adapters[(int, sqlite.PrepareProtocol)]
        self.cur.close()
        self.con.close()
项目:zippy    作者:securesystemslab    | 项目源码 | 文件源码
def __conform__(self, protocol):
            if protocol is sqlite.PrepareProtocol:
                return self.val
            else:
                return None
项目:zippy    作者:securesystemslab    | 项目源码 | 文件源码
def tearDown(self):
        del sqlite.adapters[(int, sqlite.PrepareProtocol)]
        self.cur.close()
        self.con.close()
项目:oil    作者:oilshell    | 项目源码 | 文件源码
def __conform__(self, protocol):
            if protocol is sqlite.PrepareProtocol:
                return self.val
            else:
                return None
项目:oil    作者:oilshell    | 项目源码 | 文件源码
def tearDown(self):
        del sqlite.adapters[(int, sqlite.PrepareProtocol)]
        self.cur.close()
        self.con.close()
项目:python2-tracer    作者:extremecoders-re    | 项目源码 | 文件源码
def __conform__(self, protocol):
            if protocol is sqlite.PrepareProtocol:
                return self.val
            else:
                return None
项目:python2-tracer    作者:extremecoders-re    | 项目源码 | 文件源码
def tearDown(self):
        del sqlite.adapters[(int, sqlite.PrepareProtocol)]
        self.cur.close()
        self.con.close()
项目:python2-tracer    作者:extremecoders-re    | 项目源码 | 文件源码
def __conform__(self, protocol):
        if protocol is sqlite3.PrepareProtocol:
            return "%f;%f" % (self.x, self.y)
项目:sslstrip-hsts-openwrt    作者:adde88    | 项目源码 | 文件源码
def __conform__(self, protocol):
            if protocol is sqlite.PrepareProtocol:
                return self.val
            else:
                return None
项目:sslstrip-hsts-openwrt    作者:adde88    | 项目源码 | 文件源码
def tearDown(self):
        del sqlite.adapters[(int, sqlite.PrepareProtocol)]
        self.cur.close()
        self.con.close()
项目:ouroboros    作者:pybee    | 项目源码 | 文件源码
def __conform__(self, protocol):
            if protocol is sqlite.PrepareProtocol:
                return self.val
            else:
                return None
项目:ouroboros    作者:pybee    | 项目源码 | 文件源码
def tearDown(self):
        del sqlite.adapters[(int, sqlite.PrepareProtocol)]
        self.cur.close()
        self.con.close()
项目:ndk-python    作者:gittor    | 项目源码 | 文件源码
def __conform__(self, protocol):
            if protocol is sqlite.PrepareProtocol:
                return self.val
            else:
                return None
项目:ndk-python    作者:gittor    | 项目源码 | 文件源码
def tearDown(self):
        del sqlite.adapters[(int, sqlite.PrepareProtocol)]
        self.cur.close()
        self.con.close()
项目:kbe_server    作者:xiaohaoppy    | 项目源码 | 文件源码
def __conform__(self, protocol):
            if protocol is sqlite.PrepareProtocol:
                return self.val
            else:
                return None
项目:kbe_server    作者:xiaohaoppy    | 项目源码 | 文件源码
def tearDown(self):
        del sqlite.adapters[(int, sqlite.PrepareProtocol)]
        self.cur.close()
        self.con.close()