How to use the vdirsyncer.utils.generate_href function in vdirsyncer

To help you get started, we’ve selected a few vdirsyncer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pimutils / vdirsyncer / vdirsyncer / storage / remotestorage.py View on Github external
def upload(self, item):
        href = utils.generate_href(item.ident) + self.fileext
        return self._put(href, item, None)
github pimutils / vdirsyncer / vdirsyncer / storage / filesystem.py View on Github external
def _get_href(self, ident):
        return generate_href(ident) + self.fileext
github pimutils / vdirsyncer / vdirsyncer / storage / dav.py View on Github external
def _get_href(self, item):
        href = utils.generate_href(item.ident)
        return self._normalize_href(href + self.fileext)
github pimutils / vdirsyncer / vdirsyncer / storage / olddav.py View on Github external
def _get_href(self, item):
        href = utils.generate_href(item.ident)
        return self._normalize_href(href + self.fileext)
github pimutils / vdirsyncer / vdirsyncer / repair.py View on Github external
def repair_item(href, item, seen_uids, repair_unsafe_uid):
    if item.parsed is None:
        raise IrreparableItem()

    new_item = item

    if not item.uid:
        logger.warning('No UID, assigning random UID.')
        new_item = item.with_uid(generate_href())
    elif item.uid in seen_uids:
        logger.warning('Duplicate UID, assigning random UID.')
        new_item = item.with_uid(generate_href())
    elif not href_safe(item.uid) or not href_safe(basename(href)):
        if not repair_unsafe_uid:
            logger.warning('UID may cause problems, add '
                           '--repair-unsafe-uid to repair.')
        else:
            logger.warning('UID or href is unsafe, assigning random UID.')
            new_item = item.with_uid(generate_href())

    if not new_item.uid:
        raise IrreparableItem()

    return new_item