Beispiel #1
0
 def __init__(self, db_path, personal_client=None, business_client=None):
     self._conn = sqlite3.connect(db_path, isolation_level=None)
     self._cursor = self._conn.cursor()
     self._cursor.execute(get_content('onedrive_accounts.sql'))
     self._conn.commit()
     self.personal_client = personal_client
     self.business_client = business_client
     self._all_accounts = {}
     atexit.register(self.close)
Beispiel #2
0
 def __init__(self, db_path, personal_client=None, business_client=None):
     self._conn = sqlite3.connect(db_path, isolation_level=None)
     self._cursor = self._conn.cursor()
     self._cursor.execute(get_content('onedrive_accounts.sql'))
     self._conn.commit()
     self.personal_client = personal_client
     self.business_client = business_client
     self._all_accounts = {}
     atexit.register(self.close)
Beispiel #3
0
 def __init__(self, db_path, account_store):
     """
     :param str db_path: Path to Drive database.
     :param onedrive_d.store.account_db.AccountStorage account_store:
     """
     self._conn = sqlite3.connect(db_path, isolation_level=None)
     self._cursor = self._conn.cursor()
     self._cursor.execute(get_content('onedrive_drives.sql'))
     self._conn.commit()
     self._all_drives = {}
     self._drive_roots = {}
     self.account_store = account_store
     atexit.register(self.close)
Beispiel #4
0
 def __init__(self, db_path, account_store):
     """
     :param str db_path: Path to Drive database.
     :param onedrive_d.store.account_db.AccountStorage account_store:
     """
     self._conn = sqlite3.connect(db_path, isolation_level=None)
     self._cursor = self._conn.cursor()
     self._cursor.execute(get_content('onedrive_drives.sql'))
     self._conn.commit()
     self._all_drives = {}
     self._drive_roots = {}
     self.account_store = account_store
     atexit.register(self.close)
Beispiel #5
0
 def __init__(self, db_path, drive):
     """
     :param str db_path: A unique path for the database to store items for the target drive.
     :param onedrive_d.api.drives.DriveObject drive: The underlying drive object.
     """
     if not hasattr(drive, 'storage_lock'):
         drive.storage_lock = rwlock.RWLock()
     self.lock = drive.storage_lock
     self._conn = sqlite3.connect(db_path, isolation_level=None, check_same_thread=False)
     self.drive = drive
     self._cursor = self._conn.cursor()
     self._cursor.execute(get_content('onedrive_items.sql'))
     self._conn.commit()
     atexit.register(self.close)
Beispiel #6
0
 def __init__(self, db_path, drive):
     """
     :param str db_path: A unique path for the database to store items for the target drive.
     :param onedrive_d.api.drives.DriveObject drive: The underlying drive object.
     """
     if not hasattr(drive, 'storage_lock'):
         drive.storage_lock = rwlock.RWLock()
     self.lock = drive.storage_lock
     self._conn = sqlite3.connect(db_path, isolation_level=None, check_same_thread=False)
     self.drive = drive
     self._cursor = self._conn.cursor()
     self._cursor.execute(get_content('onedrive_items.sql'))
     self._conn.commit()
     atexit.register(self.close)