spaces2tabs

This commit is contained in:
mickael
2019-01-04 21:12:14 +00:00
parent d7f79708ca
commit 4926d6c383
3 changed files with 133 additions and 133 deletions

View File

@@ -3,31 +3,31 @@ import sqlite3 as lite
class mysqlite:
def execute(self, query, args = None, rmin = 1.5, rmax = 7.0):
def execute(self, query, args = None, rmin = 1.5, rmax = 7.0):
while True:
try: return self.cursor.execute(query,args) if args else self.cursor.execute(query)
except:
print '%s\nquery: %s\nargs: %s' % (str(sys.exc_info()), str(query), str(args))
time.sleep(random.uniform(rmin, rmax))
while True:
try: return self.cursor.execute(query,args) if args else self.cursor.execute(query)
except:
print '%s\nquery: %s\nargs: %s' % (str(sys.exc_info()), str(query), str(args))
time.sleep(random.uniform(rmin, rmax))
def executemany(self, query, args, rmin = 1.5, rmax = 7.0):
def executemany(self, query, args, rmin = 1.5, rmax = 7.0):
while True:
try: return self.cursor.executemany(query,args)
except:
print '%s\nquery: %s\nargs: %s' % (str(sys.exc_info()), str(query), str(args))
time.sleep(random.uniform(rmin, rmax))
while True:
try: return self.cursor.executemany(query,args)
except:
print '%s\nquery: %s\nargs: %s' % (str(sys.exc_info()), str(query), str(args))
time.sleep(random.uniform(rmin, rmax))
def commit(self, rmin = 1.5, rmax = 7.0):
while True:
try: return self.handle.commit()
except: time.sleep(random.uniform(rmin, rmax))
def commit(self, rmin = 1.5, rmax = 7.0):
while True:
try: return self.handle.commit()
except: time.sleep(random.uniform(rmin, rmax))
def close(self):
self.handle.close()
def close(self):
self.handle.close()
def __init__(self, database, factory = None):
self.handle = lite.connect(database)
if factory: self.handle.text_factory = factory
self.cursor = self.handle.cursor()
def __init__(self, database, factory = None):
self.handle = lite.connect(database)
if factory: self.handle.text_factory = factory
self.cursor = self.handle.cursor()