Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../lib64/python2..../sqlite3
File: dbapi2.py
# pysqlite2/dbapi2.py: the DB-API 2.0 interface
[0] Fix | Delete
#
[1] Fix | Delete
# Copyright (C) 2004-2005 Gerhard Haering <gh@ghaering.de>
[2] Fix | Delete
#
[3] Fix | Delete
# This file is part of pysqlite.
[4] Fix | Delete
#
[5] Fix | Delete
# This software is provided 'as-is', without any express or implied
[6] Fix | Delete
# warranty. In no event will the authors be held liable for any damages
[7] Fix | Delete
# arising from the use of this software.
[8] Fix | Delete
#
[9] Fix | Delete
# Permission is granted to anyone to use this software for any purpose,
[10] Fix | Delete
# including commercial applications, and to alter it and redistribute it
[11] Fix | Delete
# freely, subject to the following restrictions:
[12] Fix | Delete
#
[13] Fix | Delete
# 1. The origin of this software must not be misrepresented; you must not
[14] Fix | Delete
# claim that you wrote the original software. If you use this software
[15] Fix | Delete
# in a product, an acknowledgment in the product documentation would be
[16] Fix | Delete
# appreciated but is not required.
[17] Fix | Delete
# 2. Altered source versions must be plainly marked as such, and must not be
[18] Fix | Delete
# misrepresented as being the original software.
[19] Fix | Delete
# 3. This notice may not be removed or altered from any source distribution.
[20] Fix | Delete
[21] Fix | Delete
import collections
[22] Fix | Delete
import datetime
[23] Fix | Delete
import time
[24] Fix | Delete
[25] Fix | Delete
from _sqlite3 import *
[26] Fix | Delete
[27] Fix | Delete
paramstyle = "qmark"
[28] Fix | Delete
[29] Fix | Delete
threadsafety = 1
[30] Fix | Delete
[31] Fix | Delete
apilevel = "2.0"
[32] Fix | Delete
[33] Fix | Delete
Date = datetime.date
[34] Fix | Delete
[35] Fix | Delete
Time = datetime.time
[36] Fix | Delete
[37] Fix | Delete
Timestamp = datetime.datetime
[38] Fix | Delete
[39] Fix | Delete
def DateFromTicks(ticks):
[40] Fix | Delete
return Date(*time.localtime(ticks)[:3])
[41] Fix | Delete
[42] Fix | Delete
def TimeFromTicks(ticks):
[43] Fix | Delete
return Time(*time.localtime(ticks)[3:6])
[44] Fix | Delete
[45] Fix | Delete
def TimestampFromTicks(ticks):
[46] Fix | Delete
return Timestamp(*time.localtime(ticks)[:6])
[47] Fix | Delete
[48] Fix | Delete
version_info = tuple([int(x) for x in version.split(".")])
[49] Fix | Delete
sqlite_version_info = tuple([int(x) for x in sqlite_version.split(".")])
[50] Fix | Delete
[51] Fix | Delete
Binary = buffer
[52] Fix | Delete
collections.Sequence.register(Row)
[53] Fix | Delete
[54] Fix | Delete
def register_adapters_and_converters():
[55] Fix | Delete
def adapt_date(val):
[56] Fix | Delete
return val.isoformat()
[57] Fix | Delete
[58] Fix | Delete
def adapt_datetime(val):
[59] Fix | Delete
return val.isoformat(" ")
[60] Fix | Delete
[61] Fix | Delete
def convert_date(val):
[62] Fix | Delete
return datetime.date(*map(int, val.split("-")))
[63] Fix | Delete
[64] Fix | Delete
def convert_timestamp(val):
[65] Fix | Delete
datepart, timepart = val.split(" ")
[66] Fix | Delete
year, month, day = map(int, datepart.split("-"))
[67] Fix | Delete
timepart_full = timepart.split(".")
[68] Fix | Delete
hours, minutes, seconds = map(int, timepart_full[0].split(":"))
[69] Fix | Delete
if len(timepart_full) == 2:
[70] Fix | Delete
microseconds = int('{:0<6.6}'.format(timepart_full[1].decode()))
[71] Fix | Delete
else:
[72] Fix | Delete
microseconds = 0
[73] Fix | Delete
[74] Fix | Delete
val = datetime.datetime(year, month, day, hours, minutes, seconds, microseconds)
[75] Fix | Delete
return val
[76] Fix | Delete
[77] Fix | Delete
[78] Fix | Delete
register_adapter(datetime.date, adapt_date)
[79] Fix | Delete
register_adapter(datetime.datetime, adapt_datetime)
[80] Fix | Delete
register_converter("date", convert_date)
[81] Fix | Delete
register_converter("timestamp", convert_timestamp)
[82] Fix | Delete
[83] Fix | Delete
register_adapters_and_converters()
[84] Fix | Delete
[85] Fix | Delete
# Clean up namespace
[86] Fix | Delete
[87] Fix | Delete
del(register_adapters_and_converters)
[88] Fix | Delete
[89] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function