Ejemplo n.º 1
0
def author_from_data(loc, data):
    edition = read_edition(loc, data)
    assert 'authors' in edition
    east = east_in_by_statement(edition)
    assert len(edition['authors']) == 1
    print `edition['authors'][0]`
    a = import_author(edition['authors'][0], eastern=east)
    if 'key' in a:
        return {'key': a['key']}
    ret = ol.new(a, comment='new author')
    print 'ret:', ret
    assert isinstance(ret, basestring)
    return {'key': ret}
Ejemplo n.º 2
0
def author_from_data(loc, data):
    edition = read_edition(data)
    assert 'authors' in edition
    east = east_in_by_statement(edition)
    assert len(edition['authors']) == 1
    print(repr(edition['authors'][0]))
    a = import_author(edition['authors'][0], eastern=east)
    if 'key' in a:
        return {'key': a['key']}
    ret = ol.new(a, comment='new author')
    print('ret:', ret)
    assert isinstance(ret, basestring)
    return {'key': ret}