Commit 136beef6 authored by Sriram Karra's avatar Sriram Karra

Fix runtime error involve outlook times; also improve display name in outlook logs

parent 093910c0
......@@ -855,7 +855,7 @@ class OLContact(Contact):
## FIXME: Additional phone numbers should be put into the custom
## property for later use.
logging.error('Not so silently ignoring %d Home numbers for %s',
len(ph)-2, self.get_name())
len(ph)-2, self.get_disp_name())
ph = self.get_phone_work()
if len(ph) >= 1:
......@@ -868,7 +868,7 @@ class OLContact(Contact):
olprops.append((mt.PR_BUSINESS2_TELEPHONE_NUMBER, num))
if len(ph) >= 3:
logging.error('Not so silently ignoring %d Work numbers for %s',
len(ph)-2, self.get_name())
len(ph)-2, self.get_disp_name())
ph = self.get_phone_mob()
if len(ph) >= 1:
......@@ -877,7 +877,7 @@ class OLContact(Contact):
olprops.append((mt.PR_MOBILE_TELEPHONE_NUMBER, num))
if len(ph) >= 2:
logging.error('Not so silently ignoring %d Mobile numbers for %s',
len(ph)-1, self.get_name())
len(ph)-1, self.get_disp_name())
ph_prim = self.get_phone_prim()
if ph_prim:
......
......@@ -262,7 +262,7 @@ class OLFolder(Folder):
hr, ps = oli.DeleteProps(def_cols)
except Exception, e:
logging.error('%s: Could not clear our MAPI props for: %s (%s)',
'gc:batch_update()', item.get_name(), e)
'ol:batch_update()', item.get_name(), e)
logging.debug(traceback.format_exc())
success = False
continue
......@@ -272,10 +272,10 @@ class OLFolder(Folder):
hr, ps = oli.SetProps(olprops)
oli.SaveChanges(mapi.KEEP_OPEN_READWRITE)
logging.info('Successfully updated changes to Outlook for %s',
item.get_name())
item.get_disp_name())
except Exception, e:
logging.error('%s: Could not set new props set for: %s (%s)',
'gc:batch_update()', item.get_name(), e)
'ol:batch_update()', item.get_disp_name(), e)
success = False
continue
......
......@@ -24,6 +24,9 @@ def yyyy_mm_dd_to_pytime (date_str):
## FIXME: Temporary hack to ensure we have a yyyy-mm-dd format. Google
## allows the year to be skipped. Outlook crates a problem. We bridge the
## gap by inserting '1887' (birth year of Srinivasa Ramanujan)
import pywintypes
res = re.search('--(\d\d)-(\d\d)', date_str)
if res:
date_str = '1887-%s-%s' % (res.group(1), res.group(2))
......
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