Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:catch nonetype biblio in ifiction
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:4786f6c6301e2c98b4f5b6670a6e13752674aa0a
User & Date: brandon 2015-05-05 22:15:33
Context
2017-12-24
22:54
support repeated elements when building node dicts check-in: 87b48d4651 user: brandon tags: trunk
2015-05-05
22:15
catch nonetype biblio in ifiction check-in: 4786f6c630 user: brandon tags: trunk
22:12
catch unsupported cover images in blorbs check-in: 006876d44a user: brandon tags: trunk
Changes

Changes to treatyofbabel/ifiction.py.

412
413
414
415
416
417
418

419


420
421
422
423
424
425
426

    """
    info = dict(zip(BIBLIO_ATTR, [None for x in range(len(BIBLIO_ATTR))]))
    biblio = story_node.getElementsByTagName("bibliographic")[0]
    for node in biblio.childNodes:
        if node.nodeName not in info:
            continue

        info[node.nodeName] = node.firstChild.nodeValue.strip()


    return info


def check_bibliographic(ifiction_dom):
    pass









>
|
>
>







412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429

    """
    info = dict(zip(BIBLIO_ATTR, [None for x in range(len(BIBLIO_ATTR))]))
    biblio = story_node.getElementsByTagName("bibliographic")[0]
    for node in biblio.childNodes:
        if node.nodeName not in info:
            continue
        if node.firstChild is not None:
            info[node.nodeName] = node.firstChild.nodeValue.strip()
        else:
            info[node.nodeName] = None
    return info


def check_bibliographic(ifiction_dom):
    pass