Commit 14f12a1c authored by Sriram Karra's avatar Sriram Karra

Two default profiles in state.init.json

- Have a default gc-ol and a gc-bb profile set up in the
  initial state json. Just setting th stage for a 'default'
  sync profile for newbies or first time users

- helper routines to enable the folder and store ids to be
  written to the state.json; so far we did not need this
  support
parent d8f7f9e8
##
## Created : Tue Jul 19 13:54:53 IST 2011
## Last Modified : Sun Jul 01 11:51:02 IST 2012
## Last Modified : Mon Jul 02 22:46:37 IST 2012
##
## Copyright (C) 2011, 2012 Sriram Karra <karra.etc@gmail.com>
##
......@@ -295,15 +295,35 @@ class Config:
def get_stid1 (self, profile):
return self.get_coll_1(profile)['stid']
def set_stid1 (self, profile, stid, sync=True):
coll1 = self.get_coll_1(profile)
coll1.update({'stid' : stid})
return self.set_coll_1(profile, coll1, sync)
def get_stid2 (self, profile):
return self.get_coll_2(profile)['stid']
def set_stid2 (self, profile, stid, sync=True):
coll2 = self.get_coll_2(profile)
coll2.update({'stid' : stid})
return self.set_coll_2(profile, coll2, sync)
def get_fid1 (self, profile):
return self.get_coll_1(profile)['foid']
def set_fid1 (self, profile, fid, sync=True):
coll1 = self.get_coll_1(profile)
coll1.update({'foid' : fid})
return self.set_coll_1(profile, coll1, sync)
def get_fid2 (self, profile):
return self.get_coll_2(profile)['foid']
def set_fid2 (self, profile, fid, sync=True):
coll2 = self.get_coll_2(profile)
coll2.update({'foid' : fid})
return self.set_coll_2(profile, coll2, sync)
def get_last_sync_start (self, profile):
return self._get_profile_prop(profile, 'last_sync_start')
......
......@@ -22,7 +22,7 @@
// This absolutely has to be the same as the version of the
// config.json file. If they are different it will help us
// identify if any migration has to be performed - in the future.
'file_version' : 2,
'file_version' : 4,
// The default profile. It will contain the name of one of the
// profile keys once the user makes at a sync or at least sets up
......@@ -34,17 +34,17 @@
// The following is an example of what a profile could like. This
// sample profile will not be written to the state.json file
'sample' : {
'defgcol' : {
"coll_1" : {
"dbid" : "gc",
"stid" : "karra.etc@gmail.com",
"foid" : "http://www.google.com/m8/feeds/groups/karra.etc%40gmail.com/base/2fae451c0fe771d5",
"stid" : null,
"foid" : null,
},
"coll_2" : {
"dbid" : "bb",
"stid" : "/Users/sriramkarra/stuff/code/python/Gout/test/bbdb.utah.ver7",
"foid" : "default",
"dbid" : "ol",
"stid" : null,
"foid" : null,
},
'last_sync_start' : "1980-01-01T00:00:00.00+00:00",
......@@ -63,7 +63,37 @@
// The GID used to compute the custom property tag that is
// used to store the sync tag.
'olgid' : 0x9001,
}, // profiles['sample']
}, // profiles['defgcol']
'defgcbb' : {
"coll_1" : {
"dbid" : "gc",
"stid" : null,
"foid" : null,
},
"coll_2" : {
"dbid" : "bb",
"stid" : "~/.bbdb",
"foid" : "default",
},
'last_sync_start' : "1980-01-01T00:00:00.00+00:00",
'last_sync_stop' : "1980-01-01T00:00:00.00+00:00",
// Default direction in which to perform Sync. Values can
// be one of ['SYNC1WAY' or 'SYCN2WAY'].
'sync_dir' : "SYNC2WAY",
// Direction in which to resolve conflicts if the same
// entry is modified both locally and in the google
// cloud. Value should be one of the two dbids (in this
// instance, either 'gc' or 'bb')
'conflict_resolve' : 'gc',
// The GID used to compute the custom property tag that is
// used to store the sync tag.
'olgid' : null,
}, // profiles['defgcbb']
}, // 'profiles'
}
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