Commit 5bc58b0e authored by Sriram Karra's avatar Sriram Karra

pychecker catch: unused, weird code about sorted dbids in profile

My memory is really failing me here. pychecker has flagged two
instances where there are fragments of code and comments that suggest
the dbids need to be in sorted order before being operated on.
pychecker caught these snippets because they are unused code
chunks. I am not able to find any other surviving code that
depends on this sorted order. I am really unable to remember why
I needed this stuff, and when we move away from this.

due to this confusion, I am just commenting out the unsued code
in question along with some comments so we can come abck to this
stuff if required.
parent c4baf547
##
## Created : Wed May 18 13:16:17 IST 2011
## Last Modified : Fri Jun 15 07:18:47 IST 2012
## Last Modified : Thu Aug 16 18:35:21 IST 2012
##
## Copyright (C) 2011, 2012 Sriram Karra <karra.etc@gmail.com>
##
......@@ -123,13 +123,21 @@ class GCContactsFolder(Folder):
logging.info('Querying Google for status of Contact Entries...')
stag = conf.make_sync_label(pname, destid)
## Sort the DBIds so dest1 has the 'lower' ID
db1 = self.get_db().get_dbid()
if db1 > destid:
db2 = db1
db1 = destid
else:
db2 = destid
## FIXME: The following commented out code appears very fishy. I am
## not able to recall why these two have to be used in sorted order. I
## am pretty sure there was some sense behind it, but as of now db1
## and db2 are not really being used; so the code works even without
## this "sorted" behaviour... Hm, this really should go, but I am
## being conservative here and leving the stuff commented out so we
## can come back to it later if required.
# ## Sort the DBIds so dest1 has the 'lower' ID
# db1 = self.get_db().get_dbid()
# if db1 > destid:
# db2 = db1
# db1 = destid
# else:
# db2 = destid
if not updated_min:
updated_min = conf.get_last_sync_stop(pname)
......
##
## Created : Tue Jul 19 15:04:46 IST 2011
## Last Modified : Wed Jul 25 16:05:55 IST 2012
## Last Modified : Thu Aug 16 18:29:01 IST 2012
##
## Copyright (C) 2011, 2012 Sriram Karra <karra.etc@gmail.com>
##
......@@ -191,9 +191,18 @@ class Sync:
db1id = self.get_db1id()
db2id = self.get_db2id()
# The two db ids need to be specified in sorted order
db1 = db1id if db1id < db2id else db2id
db2 = db2id if db1id < db2id else db1id
## FIXME: The following commented out code appears very fishy. I am
## not able to recall why these two have to be used in sorted order. I
## am pretty sure there was some sense behind it, but as of now db1
## and db2 are not really being used; so the code works even without
## this "sorted" behaviour... Hm, this really should go, but I am
## being conservative here and leving the stuff commented out so we
## can come back to it later if required.
# # The two db ids need to be specified in sorted order
# db1 = db1id if db1id < db2id else db2id
# db2 = db2id if db1id < db2id else db1id
cr = self.get_config().get_conflict_resolve(pname)
if cr == db2id:
......
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