Пример #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))