dirtyebay/utils.py
def version_from_schema(schema_el):
    """
    returns: API version number <str>
    raises: <VersionNotFound>

    NOTE:
    relies on presence of comment tags in the XSD, which are currently present
    for both ebaySvc.xsd (TradingAPI) and ShoppingService.xsd (ShoppingAPI)
    """
    vc_el = schema_el
    while True:
        vc_el = vc_el.getprevious()
        if vc_el is None:
            break
        if vc_el.tag is etree.Comment:
            match = VERSION_COMMENT.search(vc_el.text)
            if match:
                try:
                    return match.group(1)
                except IndexError:
                    pass
    raise VersionNotFound('Version comment not found preceeding schema node')
def version_from_schema(schema_el):
    """
    returns: API version number <str>
    raises: <VersionNotFound>

    NOTE:
    relies on presence of comment tags in the XSD, which are currently present
    for both ebaySvc.xsd (TradingAPI) and ShoppingService.xsd (ShoppingAPI)
    """
    vc_el = schema_el
    while True:
        vc_el = vc_el.getprevious()
        if vc_el is None:
            break
        if vc_el.tag is etree.Comment:
            match = VERSION_COMMENT.search(vc_el.text)
            if match:
                try:
                    return match.group(1)
                except IndexError:
                    pass
    raise VersionNotFound('Version comment not found preceeding schema node')
returns: API version number <str>
    raises: <VersionNotFound>

    NOTE:
    relies on presence of comment tags in the XSD, which are currently present
    for both ebaySvc.xsd (TradingAPI) and ShoppingService.xsd (ShoppingAPI)