예제 #1
0
파일: pimdb_cd.py 프로젝트: Ekaptenn/ASynK
    def del_folder(self, itemid, store=None):
        """Get rid of the specified folder."""

        sess = self.session()
        path = URL(url=itemid)

        logging.info("Deleting all the contained items. Will not remove folder")

        items = sess.getPropertiesOnHierarchy(path, (davxml.getetag,))
        hrefs = [x for x in items.keys() if x != path.toString().strip()]

        for href in hrefs:
            sess.deleteResource(URL(url=href))
            logging.info("Deleted file %s...", href)
예제 #2
0
    def del_folder (self, itemid, store=None):
        """Get rid of the specified folder."""

        sess = self.session()
        path = URL(url=itemid)

        logging.info('Deleting all the contained items. Will not remove folder')

        items = sess.getPropertiesOnHierarchy(path, (davxml.getetag,))
        hrefs = [x for x in items.keys() if x != path.toString().strip()]

        for href in hrefs:
            sess.deleteResource(URL(url=href))
            logging.info('Deleted file %s...', href)
예제 #3
0
    def _refresh_contacts(self):
        logging.debug('Refreshing Contacts for folder %s...', self.get_name())
        self.reset_contacts()
        ## Now fetch from server

        sess = self.get_db().session()
        path = URL(url=self.get_itemid())
        props = (davxml.getetag, )
        items = sess.getPropertiesOnHierarchy(path, props)

        hrefs = [x for x in items.keys() if x != path.toString().strip()]
        etags = [items[x].get(davxml.getetag, "-") for x in items.keys()]

        cons = self.find_items(hrefs)

        for con in cons:
            self.add_contact(con)
            logging.debug('Successfully fetched and added contact: %s',
                          con.get_disp_name())

        logging.debug('Refreshing Contacts for folder %s..done.',
                      self.get_name())
예제 #4
0
    def _refresh_contacts (self):
        logging.debug('Refreshing Contacts for folder %s...',
                      self.get_name())
        self.reset_contacts()
        ## Now fetch from server

        sess  = self.get_db().session()
        path  = URL(url=self.get_itemid())
        props = (davxml.getetag,)
        items = sess.getPropertiesOnHierarchy(path, props)

        hrefs = [x for x in items.keys() if x != path.toString().strip()]
        etags = [items[x].get(davxml.getetag, "-") for x in items.keys()]

        cons  = self.find_items(hrefs)

        for con in cons:
            self.add_contact(con)
            logging.debug('Successfully fetched and added contact: %s',
                          con.get_disp_name())

        logging.debug('Refreshing Contacts for folder %s..done.',
                      self.get_name())