Esempio n. 1
0
def unregister_namespace(name):
    """Unregister a custom XMP namespace.

    A custom namespace is identified by its name, **not** by its prefix.

    Attempting to unregister an unknown namespace raises an error, as does
    attempting to unregister a builtin namespace.

    Args:
    name -- the name of the custom namespace (ending with a ``/``),
            typically a URL (e.g. http://purl.org/dc/elements/1.1/)

    Raise ValueError: if the name doesn’t end with a ``/``
    Raise KeyError: if the namespace is unknown or a builtin namespace
    """
    if not name.endswith('/'):
        raise ValueError('Name should end with a /')

    libexiv2python._unregisterXmpNs(name)
Esempio n. 2
0
def unregister_namespace(name):
    """
    Unregister a custom XMP namespace.

    A custom namespace is identified by its name, **not** by its prefix.

    Attempting to unregister an unknown namespace raises an error, as does
    attempting to unregister a builtin namespace.

    :param name: the name of the custom namespace (ending with a ``/``),
                 typically a URL (e.g. http://purl.org/dc/elements/1.1/)
    :type name: string

    :raise ValueError: if the name doesn’t end with a ``/``
    :raise KeyError: if the namespace is unknown or a builtin namespace
    """
    if not name.endswith('/'):
        raise ValueError('Name should end with a /')
    libexiv2python._unregisterXmpNs(name)