Commit 92eee9b4 authored by Sriram Karra's avatar Sriram Karra

Heavy lifting to make CD-CD sync possible

parent 1db0bb9c
......@@ -547,18 +547,7 @@ class Asynk:
pass
def login_cd (self):
try:
from pimdb_cd import CDPIMDB
except ImportError, e:
raise AsynkError("%s: Cannot use any CardDAV accounts" % e)
try:
pimcd = CDPIMDB(self.get_config(), self.get_store_id('cd'),
self.get_cduser(), self.get_cdpw())
except BadAuthentication:
raise AsynkError('Invalid CardDAV auth credentials. Cannot proceed.')
return pimcd
pass
def login_ex (self):
from pimdb_ex import EXPIMDB
......
......@@ -245,7 +245,7 @@ class CDContactsFolder(Folder):
## warned.
con_old = cons[href]
con_itemid = item.get_itemid_from_synctags(pname, 'cd')
cd = CDContact(self, con=item, con_itemid=con_itemid)
con_new = CDContact(self, con=item, con_itemid=con_itemid)
con_new.set_uid(con_old.get_uid())
con_new.update_sync_tags(src_sync_tag, item.get_itemid())
......
......@@ -281,6 +281,20 @@ class CDCollection(Collection):
Collection.__init__(self, config=config, dbid='cd', stid=stid, fid=fid,
pname=pname, colln=colln)
def login (self):
try:
from pimdb_cd import CDPIMDB
except ImportError, e:
raise AsynkError("%s: Cannot use any CardDAV accounts" % e)
try:
pimcd = CDPIMDB(self.get_config(), self.get_stid(),
self.get_username(), self.get_pwd())
except BadAuthentication, e:
raise AsynkCollectionError('Invalid CardDAV credentials (%s).', e)
return self.set_db(pimcd)
def force_username (self):
return True
......@@ -322,9 +336,9 @@ class GCCollection(Collection):
class OLCollection(Collection):
def __init__ (self, config=None, stid=None, fid=None, pname=None):
def __init__ (self, config=None, stid=None, fid=None, pname=None, colln=1):
Collection.__init__(self, config=config, dbid='ol', stid=stid, fid=fid,
pname=pname)
pname=pname, colln=colln)
def login (self):
return OLPIMDB(self.get_config())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment