예제 #1
0
파일: folder_ol.py 프로젝트: Ekaptenn/ASynK
    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)
예제 #2
0
파일: folder_ol.py 프로젝트: slaanesh/ASynK
    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)
예제 #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()
예제 #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()
예제 #5
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()