Example #1
0
                         self).__eq__(other) and self.notes == other.notes
        else:
            return NotImplemented

    def __repr__(self):
        return '%s(%r, %r)' % (self.__class__.__name__, self.value,
                               list(self.notes))

    def _parse_element(self, element):
        self.notes._parse_element(element)

    def _build_element(self):
        self.notes._build_element()


Service.register_extension('relationship', type=Relationship)


class ServiceClassRegistry(object, metaclass=XMLEmptyElementRegistryType):
    _xml_namespace = namespace
    _xml_document = PIDFDocument

    names = ('courier', 'electronic', 'freight', 'in-person', 'postal',
             'unknown')


class ServiceClass(XMLElement, ServiceExtension):
    _xml_tag = 'service-class'
    _xml_namespace = namespace
    _xml_document = PIDFDocument
Example #2
0
__all__ = [
    'namespace', 'Card', 'DisplayName', 'Homepage', 'Icon', 'Map', 'Sound'
]

namespace = "urn:ietf:params:xml:ns:pidf:cipid"
PIDFDocument.register_namespace(namespace, prefix='c', schema='cipid.xsd')


class Card(XMLAnyURIElement, PersonExtension, ServiceExtension):
    _xml_tag = 'card'
    _xml_namespace = namespace
    _xml_document = PIDFDocument


Person.register_extension('card', type=Card)
Service.register_extension('card', type=Card)


class DisplayName(XMLLocalizedStringElement, PersonExtension,
                  ServiceExtension):
    _xml_tag = 'display-name'
    _xml_namespace = namespace
    _xml_document = PIDFDocument


Person.register_extension('display_name', type=DisplayName)
Service.register_extension('display_name', type=DisplayName)


class Homepage(XMLAnyURIElement, PersonExtension, ServiceExtension):
    _xml_tag = 'homepage'
Example #3
0
        self.message = message
        self.mime_type = mime_type
        self.automata = automata
        self.communication_class = communication_class
        self.duplex = duplex
        self.event_packages = event_packages
        self.priority = priority
        self.methods = methods
        self.extensions = extensions
        self.schemes = schemes
        self.actor = actor
        self.is_focus = is_focus
        self.languages = languages
        self.update(descriptions)

Service.register_extension('capabilities', type=ServiceCapabilities)


class MobilityRegistry(object):
    __metaclass__ = XMLEmptyElementRegistryType

    _xml_namespace = namespace
    _xml_document = PIDFDocument

    names = ('fixed', 'mobile')


class MobilitySupported(XMLStringListElement):
    _xml_tag = 'supported'
    _xml_namespace = namespace
    _xml_document = PIDFDocument
Example #4
0
    def __eq__(self, other):
        if isinstance(other, Relationship):
            return super(Relationship, self).__eq__(other) and self.notes == other.notes
        else:
            return NotImplemented

    def __repr__(self):
        return '%s(%r, %r)' % (self.__class__.__name__, self.value, list(self.notes))

    def _parse_element(self, element):
        self.notes._parse_element(element)

    def _build_element(self):
        self.notes._build_element()

Service.register_extension('relationship', type=Relationship)


class ServiceClassRegistry(object):
    __metaclass__ = XMLEmptyElementRegistryType

    _xml_namespace = namespace
    _xml_document = PIDFDocument

    names = ('courier', 'electronic', 'freight', 'in-person', 'postal', 'unknown')


class ServiceClass(XMLElement, ServiceExtension):
    _xml_tag = 'service-class'
    _xml_namespace = namespace
    _xml_document = PIDFDocument
Example #5
0
from sipsimple.payloads.pidf import PIDFDocument, ServiceExtension, PersonExtension, Service, Person

__all__ = ["namespace", "Card", "DisplayName", "Homepage", "Icon", "Map", "Sound"]

namespace = "urn:ietf:params:xml:ns:pidf:cipid"
PIDFDocument.register_namespace(namespace, prefix="c", schema="cipid.xsd")


class Card(XMLAnyURIElement, PersonExtension, ServiceExtension):
    _xml_tag = "card"
    _xml_namespace = namespace
    _xml_document = PIDFDocument


Person.register_extension("card", type=Card)
Service.register_extension("card", type=Card)


class DisplayName(XMLLocalizedStringElement, PersonExtension, ServiceExtension):
    _xml_tag = "display-name"
    _xml_namespace = namespace
    _xml_document = PIDFDocument


Person.register_extension("display_name", type=DisplayName)
Service.register_extension("display_name", type=DisplayName)


class Homepage(XMLAnyURIElement, PersonExtension, ServiceExtension):
    _xml_tag = "homepage"
    _xml_namespace = namespace
Example #6
0
        self.mime_type = mime_type
        self.automata = automata
        self.communication_class = communication_class
        self.duplex = duplex
        self.event_packages = event_packages
        self.priority = priority
        self.methods = methods
        self.extensions = extensions
        self.schemes = schemes
        self.actor = actor
        self.is_focus = is_focus
        self.languages = languages
        self.update(descriptions)


Service.register_extension('capabilities', type=ServiceCapabilities)


class MobilityRegistry(object):
    __metaclass__ = XMLEmptyElementRegistryType

    _xml_namespace = namespace
    _xml_document = PIDFDocument

    names = ('fixed', 'mobile')


class MobilitySupported(XMLStringListElement):
    _xml_tag = 'supported'
    _xml_namespace = namespace
    _xml_document = PIDFDocument
Example #7
0
from sipsimple.payloads import XMLAnyURIElement, XMLLocalizedStringElement
from sipsimple.payloads.pidf import PIDFDocument, ServiceExtension, PersonExtension, Service, Person

__all__ = ['namespace', 'Card', 'DisplayName', 'Homepage', 'Icon', 'Map', 'Sound']

namespace = "urn:ietf:params:xml:ns:pidf:cipid"
PIDFDocument.register_namespace(namespace, prefix='c', schema='cipid.xsd')


class Card(XMLAnyURIElement, PersonExtension, ServiceExtension):
    _xml_tag = 'card'
    _xml_namespace = namespace
    _xml_document = PIDFDocument

Person.register_extension('card', type=Card)
Service.register_extension('card', type=Card)

class DisplayName(XMLLocalizedStringElement, PersonExtension, ServiceExtension):
    _xml_tag = 'display-name'
    _xml_namespace = namespace
    _xml_document = PIDFDocument

Person.register_extension('display_name', type=DisplayName)
Service.register_extension('display_name', type=DisplayName)

class Homepage(XMLAnyURIElement, PersonExtension, ServiceExtension):
    _xml_tag = 'homepage'
    _xml_namespace = namespace
    _xml_document = PIDFDocument

Person.register_extension('homepage', type=Homepage)