コード例 #1
0
def get_all_reviews_xml(
        params: Dict[str, str]) -> List[Tuple[str, Type[Element]]]:
    xml = get_index_xml(params=params)
    root = xml.find('INDEX') or xml
    sources: List[Tuple[str, str]] = [(source.text,
                                       REVIEW_SOURCES.get(source.tag, ''))
                                      for source in root.iter()
                                      if source.tag in REVIEW_SOURCES]

    return [
        (name,
         parse_xml(get_raw_response_for_source(source=file, params=params)))
        for (file, name) in sources
    ]  # FIXME: needs more type annotations   ?
コード例 #2
0
def make_large_cover_image_url(params: Dict[str, str]) -> Element:
    return parse_xml(make_request_for_source(source=LARGE_COVER,
                                             params=params))
コード例 #3
0
def make_medium_cover_image_url(params: Dict[str, str]) -> Element:
    return parse_xml(
        make_request_for_source(source=MEDIUM_COVER, params=params))
コード例 #4
0
def make_small_cover_image_url(params: Dict[str, str]) -> Element:
    return parse_xml(make_request_for_source(source=SMALL_COVER,
                                             params=params))
コード例 #5
0
def get_fiction_xml(params: Dict[str, str]) -> Element:
    return parse_xml(get_raw_response_for_source(source=FICTION,
                                                 params=params))
コード例 #6
0
def get_excerpt_xml(params: Dict[str, str]) -> Element:
    return parse_xml(get_raw_response_for_source(source=EXCERPT,
                                                 params=params))
コード例 #7
0
def get_av_summary_xml(params: Dict[str, str]) -> Element:
    return parse_xml(
        get_raw_response_for_source(source=AV_SUMMARY, params=params))
コード例 #8
0
def get_author_notes_xml(params: Dict[str, str]) -> Element:
    return parse_xml(
        get_raw_response_for_source(source=AUTHOR_NOTES, params=params))
コード例 #9
0
def get_index_xml(params: Dict[str, str]) -> Element:
    return parse_xml(get_raw_response_for_source(source=INDEX, params=params))