MCPcopy Create free account
hub / github.com/Syncplay/syncplay / StatsDBManager

Class StatsDBManager

syncplay/server.py:358–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356 pass
357
358class StatsDBManager(object):
359 def __init__(self, dbpath):
360 self._dbPath = dbpath
361 self._connection = None
362
363 def __del__(self):
364 if self._connection is not None:
365 self._connection.close()
366
367 def connect(self):
368 self._connection = adbapi.ConnectionPool("sqlite3", self._dbPath, check_same_thread=False)
369 self._createSchema()
370
371 def _createSchema(self):
372 initQuery = 'create table if not exists clients_snapshots (snapshot_time INTEGER, version STRING)'
373 return self._connection.runQuery(initQuery)
374
375 def addVersionLog(self, timestamp, version):
376 content = (timestamp, version, )
377 self._connection.runQuery("INSERT INTO clients_snapshots VALUES (?, ?)", content)
378
379class RoomDBManager(object):
380 def __init__(self, dbpath, loadroomscallback):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected