Commit 46efc984 authored by Sriram Karra's avatar Sriram Karra

pychecker catch: unused variables gid and statfi

there were two typos, one harmless and the other that could have
caused some painful bugs with Outlook syncs.

statefi should really be statei. Now fixed.

The other is more subtle. The routine that is used to compute the
olgid to be used at time of new profile creation works by first
making a list of all used gids for that dbid, and then finding
one that is unused. The array that was being built, due to the
typo, was an array of strings of hte profile names, instead of the
olgids of those profiles.

This bug will hurt if there are a number of profiles created and the
deleted, and then some more new ones are created. When this happens
the buggy code will check a olgid with a profile name, find that the
number is "unused" and then apply that for the new profile, leaing
to mixing of the contacts from different profiles.

Phew, good catch, pychecker.
parent 43b88dcd
##
## Created : Tue Jul 19 13:54:53 IST 2011
## Last Modified : Mon Jul 02 22:46:37 IST 2012
## Last Modified : Thu Aug 16 18:05:57 IST 2012
##
## Copyright (C) 2011, 2012 Sriram Karra <karra.etc@gmail.com>
##
......@@ -28,9 +28,7 @@
## and we are continuing to use the same handling framework...
import iso8601, demjson
import logging, os, re, time, traceback
import utils
import logging, os, re, time
sync_dirs = ['SYNC1WAY', 'SYNC2WAY']
......@@ -46,7 +44,7 @@ class Config:
the user has to explicitly save to disk."""
confi = None
statefi = None
statei = None
self.confn = os.path.abspath(confn)
self.staten = os.path.abspath(staten)
......@@ -451,9 +449,9 @@ class Config:
gid = self.get_ol_gid(pname)
if destid in ret:
ret[destid].append(pname)
ret[destid].append(gid)
else:
ret.update({destid : [pname]})
ret.update({destid : [gid]})
return ret
......
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