Пример #1
0
    def batch_create (self, src_sl, src_dbid, items, op='create'):
        """See the documentation in folder.Folder"""

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

        src_tag = c.make_sync_label(pname, src_dbid)
        dst_tag = c.make_sync_label(pname, my_dbid)

        if len(items) > 0:
            self.set_dirty()

        for item in items:
            try:
                bbc = BBContact(self, con=item)
                bbc.update_sync_tags(src_tag, item.get_itemid())
                bbc.set_updated(pimdb_bb.BBPIMDB.get_bbdb_time())
                self.add_contact(bbc)

                item.update_sync_tags(dst_tag, bbc.get_itemid())
                logging.info('Successfully %sd BBDB entry for %30s (%s)',
                             op, bbc.get_name(), bbc.get_itemid())
            except BBDBParseError, e:
                logging.error('Could not instantiate BBDBContact object: %s',
                              str(e))
Пример #2
0
    def batch_create(self, src_sl, src_dbid, items, op='create'):
        """See the documentation in folder.Folder"""

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

        src_tag = c.make_sync_label(pname, src_dbid)
        dst_tag = c.make_sync_label(pname, my_dbid)

        if len(items) > 0:
            self.set_dirty()

        for item in items:
            try:
                bbc = BBContact(self, con=item)
                bbc.update_sync_tags(src_tag, item.get_itemid())
                bbc.set_updated(pimdb_bb.BBPIMDB.get_bbdb_time())
                self.add_contact(bbc)

                item.update_sync_tags(dst_tag, bbc.get_itemid())
                logging.info('Successfully %sd BBDB entry for %30s (%s)', op,
                             bbc.get_name(), bbc.get_itemid())
            except BBDBParseError, e:
                logging.error('Could not instantiate BBDBContact object: %s',
                              str(e))