Skip to content

Commit

Permalink
Remove sync integration in db
Browse files Browse the repository at this point in the history
  • Loading branch information
agateau committed Oct 12, 2016
1 parent c9839f2 commit 4322b6c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
22 changes: 0 additions & 22 deletions yokadi/core/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from sqlalchemy.types import TypeDecorator, VARCHAR

from yokadi.core.recurrencerule import RecurrenceRule
from yokadi.core import basepaths
from yokadi.core.yokadiexception import YokadiException

# Yokadi database version needed for this code
Expand Down Expand Up @@ -255,21 +254,6 @@ def getSession():
return _database.session


def setupSync():
global _database
if not _database:
raise YokadiException("Cannot setup sync. db.connectDatabase has not been called")
_database.setupSync()


def getSyncManager():
global _database
if not _database:
raise YokadiException("Cannot get syncManager. db.connectDatabase has not been called")
if not _database.syncManager:
raise YokadiException("Cannot get syncManager. db.setupSync has not been called")


def connectDatabase(dbFileName, createIfNeeded=True, memoryDatabase=False):
global _database
_database = Database(dbFileName, createIfNeeded, memoryDatabase)
Expand Down Expand Up @@ -301,7 +285,6 @@ def __init__(self, dbFileName, createIfNeeded=True, memoryDatabase=False, update
self.engine = create_engine(connectionString)
Session = sessionmaker(bind=self.engine)
self.session = Session()
self.syncManager = None

if not os.path.exists(dbFileName) or memoryDatabase:
if not createIfNeeded:
Expand All @@ -317,11 +300,6 @@ def __init__(self, dbFileName, createIfNeeded=True, memoryDatabase=False, update
if not updateMode:
self.checkVersion()

def setupSync(self):
from yokadi.sync.syncmanager import SyncManager
dumpDir = os.path.join(basepaths.getCacheDir(), 'db')
self.syncManager = SyncManager(self.session, dumpDir)

def createTables(self):
"""Create all defined tables"""
Base.metadata.create_all(self.engine)
Expand Down
1 change: 0 additions & 1 deletion yokadi/ycli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ def main():
if args.createOnly:
return 0
db.setDefaultConfig() # Set default config parameters
db.setupSync()

if args.dump:
dump.dump(args.dump)
Expand Down

0 comments on commit 4322b6c

Please sign in to comment.