Beispiel #1
0
    def batch_create (self, sync_list, src_dbid, items):
        """See the documentation in folder.Folder"""

        my_dbid = self.get_dbid()
        c       = self.get_config()
        pname   = sync_list.get_pname()

        src_sync_tag = c.make_sync_label(pname, src_dbid)
        dst_sync_tag = c.make_sync_label(pname, my_dbid)

        success = True
        for item in items:
            olc = OLContact(self, con=item)
            rid = item.get_itemid()
            olc.update_sync_tags(src_sync_tag, rid)

            ## FIXME: I strongly suspect this is not the most efficient way to
            ## do this. We should test by importing items in bulk into
            ## Outlook and measure performance, and fix this if needed.

            try:
                eid = olc.save()
                logging.info('Successfully created outlook entry for %30s (%s)',
                             olc.get_disp_name(), olc.get_itemid())
            except Exception, e:
                logging.error('Could not save contact (%s) due to: %s',
                              olc.get_disp_name(), str(e))
                logging.debug('Contact Entry: %s', olc)
                logging.debug(traceback.format_exc())
                success = False
                continue

            iid = olc.get_itemid()
            item.update_sync_tags(dst_sync_tag, iid)
Beispiel #2
0
    def batch_create(self, sync_list, src_dbid, items):
        """See the documentation in folder.Folder"""

        my_dbid = self.get_dbid()
        c = self.get_config()
        pname = sync_list.get_pname()

        src_sync_tag = c.make_sync_label(pname, src_dbid)
        dst_sync_tag = c.make_sync_label(pname, my_dbid)

        success = True
        for item in items:
            olc = OLContact(self, con=item)
            rid = item.get_itemid()
            olc.update_sync_tags(src_sync_tag, rid)

            ## FIXME: I strongly suspect this is not the most efficient way to
            ## do this. We should test by importing items in bulk into
            ## Outlook and measure performance, and fix this if needed.

            try:
                eid = olc.save()
                logging.info(
                    'Successfully created outlook entry for %30s (%s)',
                    olc.get_disp_name(), olc.get_itemid())
            except Exception, e:
                logging.error('Could not save contact (%s) due to: %s',
                              olc.get_disp_name(), str(e))
                logging.debug('Contact Entry: %s', olc)
                logging.debug(traceback.format_exc())
                success = False
                continue

            iid = olc.get_itemid()
            item.update_sync_tags(dst_sync_tag, iid)
Beispiel #3
0
 def test_new_contact(self):
     c = OLContact(self.deff)
     c.set_name('Supeman')
     c.set_gender('Male')
     c.set_notes('This is a second test contact')
     c.save()
Beispiel #4
0
 def test_new_contact (self):
     c = OLContact(self.deff)
     c.set_name('Supeman')
     c.set_gender('Male')
     c.set_notes('This is a second test contact')
     c.save()
 def test_new_contact(self):
     c = OLContact(self.deff)
     c.set_name("Supeman")
     c.set_gender("Male")
     c.set_notes("This is a second test contact")
     c.save()