Example #1
0
def add_disclaimer(new, entry):
    if there('disclaimer', entry):
        new['disclaimer'] = entry['disclaimer']
    elif there('status', entry) and entry['status'] in [
            'proposed', 'in preparation', 'forthcoming'
    ]:
        new['disclaimer'] = '*Draft only. Do not cite without permission.*'
Example #2
0
def article(e):
    o = str()
    o += prefix(e)
    info = e['published']
    if there('journal', info):
        o += '*' + info['journal'] + '*'
        o += ' '
    if there('year', info):
        o += '(' + str(info['year']) + ')'
        o += ' '
    if there('volume', info):
        o +=  str(info['volume'])
        o += ': '
    if there('pages', info):
            o +=  info['pages']
    o = o.rstrip()
    return o
Example #3
0
def article(e):
    o = str()
    o += prefix(e)
    info = e['published']
    if there('journal', info):
        o += '*' + info['journal'] + '*'
        o += ' '
    if there('year', info):
        o += '(' + str(info['year']) + ')'
        o += ' '
    if there('volume', info):
        o += str(info['volume'])
        o += ': '
    if there('pages', info):
        o += info['pages']
    o = o.rstrip()
    return o
Example #4
0
def incollection(e):
    o = str()
    o += prefix(e)
    info = e['published']
    if there('editor', info):
        o += concat_useinitials(info['editor'], ', ', ' & ')
        o += ' '
        if len(info['editor']) > 1:
            o += '(Eds.)'
        else:
            o += '(Ed.)'
        o += ' '
    if there('booktitle', info):
        o += '*' + info['booktitle'] + '*'
    if there('year', info) and type(info['year']) is int:
        o += ' '
        o += '(' + str(info['year']) + ')'
    if there('address', info):
        o += ', '
        o += info['address']
        o += ': '
    if there('publisher', info):
        o += info['publisher']
    if there('pages', info):
        o += ', '
        o += 'pp. ' + info['pages']
    elif there('chapter', info):
        o += 'chapter ' + info['chapter']
    o = o.rstrip()
    o = o.rstrip(',')
    return o
Example #5
0
def incollection(e):
    o = str()
    o += prefix(e)
    info = e['published']
    if there('editor', info):
        o += concat_useinitials(info['editor'], ', ', ' & ')
        o += ' '
        if len(info['editor']) > 1:
            o += '(Eds.)'
        else:
            o += '(Ed.)'
        o += ' '
    if there('booktitle', info):
        o += '*' + info['booktitle'] + '*'
    if there('year', info) and type(info['year']) is int:
        o += ' '
        o += '(' + str(info['year']) + ')'
    if there('address', info):
        o += ', '
        o += info['address']
        o += ': '
    if there('publisher', info):
        o += info['publisher']
    if there('pages', info):
        o += ', '
        o += 'pp. ' + info['pages']
    elif there('chapter', info):
        o += 'chapter ' + info['chapter']
    o = o.rstrip()
    o = o.rstrip(',')
    return o
Example #6
0
def add_publication(new, entry):
    def add_published(new, entry):
        import formatter
        f = getattr(formatter, entry['published']['type'], formatter.default)
        new['published'] = f(entry)
    def add_doi(new, entry):
        if there('doi', entry['published']):
            new['doi'] = entry['published']['doi']
    if there('published', entry):
        add_disclaimer(new, entry)
        add_published(new, entry)
        add_doi(new, entry)
Example #7
0
def add_publication(new, entry):
    def add_published(new, entry):
        import formatter
        f = getattr(formatter, entry['published']['type'], formatter.default)
        new['published'] = f(entry)

    def add_doi(new, entry):
        if there('doi', entry['published']):
            new['doi'] = entry['published']['doi']

    if there('published', entry):
        add_disclaimer(new, entry)
        add_published(new, entry)
        add_doi(new, entry)
Example #8
0
def add_date_updated(new, entry):
    if there('date_updated', entry):
        new['date'] = uk_date(entry['date_updated'])
Example #9
0
def add_title(new, entry):
    if there('title', entry):
        new['title'] = entry['title']
Example #10
0
def add_note(new, entry):
    if there('note', entry):
        new['note'] = entry['note']
Example #11
0
def add_author(new, entry):
    if there('author', entry):
        new['author'] = entry['author']
    for a in new['author']:
        a['name'] = a.get('name_first', '') + ' ' + a.get('name_last', '')
Example #12
0
def add_title(new, entry):
    if there('title', entry):
        new['title'] = entry['title']
Example #13
0
def add_review(new, entry):
    if there('review', entry):
        new['review'] = entry['review']
Example #14
0
def add_keywords(new, entry):
    if there('keywords', entry):
        new['keywords'] = entry['keywords']
Example #15
0
def add_note(new, entry):
    if there('note', entry):
        new['note'] = entry['note']
Example #16
0
def add_abstract(new, entry):
    if there('abstract', entry):
        new['abstract'] = entry['abstract']
Example #17
0
 def add_doi(new, entry):
     if there('doi', entry['published']):
         new['doi'] = entry['published']['doi']
Example #18
0
 def add_doi(new, entry):
     if there('doi', entry['published']):
         new['doi'] = entry['published']['doi']
Example #19
0
def add_abstract(new, entry):
    if there('abstract', entry):
        new['abstract'] = entry['abstract']
Example #20
0
def add_date_updated(new, entry):
    if there('date_updated', entry):
        new['date'] = uk_date(entry['date_updated'])
Example #21
0
def add_keywords(new, entry):
    if there('keywords', entry):
        new['keywords'] = entry['keywords']
Example #22
0
def add_review(new, entry):
    if there('review', entry):
        new['review'] = entry['review']
Example #23
0
def add_author(new, entry):
    if there('author', entry):
        new['author'] = entry['author']
    for a in new['author']:
        a['name'] = a.get('name_first', '') + ' ' + a.get('name_last', '')
Example #24
0
def add_disclaimer(new, entry):
    if there('disclaimer', entry):
        new['disclaimer'] = entry['disclaimer']
    elif there('status', entry) and entry['status'] in ['proposed', 'in preparation', 'forthcoming']:
        new['disclaimer'] = '*Draft only. Do not quote without permission.*'