cofdb_submit/main.py
def on_click_add(event):
    """Add paper to file cof-papers.csv: botton will turn red if something is missing or paper already present."""
    if not (inp_paper_id.value and inp_reference.value and inp_doi.value and inp_title.value) or \
       "(already present)" in inp_paper_id.value or \
       "ERROR" in inp_paper_id.value:
        btn_add_paper.button_type = 'danger'
        print(inp_paper_id.value + " Paper not added because of some problem.")
        return

    btn_add_paper.button_type = 'primary'

    line = '{id},"{ref}",{doi},"{title}"\n'.format(id=inp_paper_id.value, ref=inp_reference.value,
                                                  doi=inp_doi.value, title=inp_title.value)
    print(line)
    with open(PAPERS_FILE, 'a+') as handle:
        handle.write(line)

    btn_add_paper.button_type = 'success'
Add paper to file cof-papers.csv: botton will turn red if something is missing or paper already present.
Add paper to file cof-papers.csv: botton will turn red if something is missing or paper already present.
Add paper to file cof - papers . csv : botton will turn red if something is missing or paper already present .
def on_click_add(event):
    if not (inp_paper_id.value and inp_reference.value and inp_doi.value and inp_title.value) or \
       "(already present)" in inp_paper_id.value or \
       "ERROR" in inp_paper_id.value:
        btn_add_paper.button_type = 'danger'
        print(inp_paper_id.value + " Paper not added because of some problem.")
        return
    btn_add_paper.button_type = 'primary'
    line = '{id},"{ref}",{doi},"{title}"\n'.format(id=inp_paper_id.value, ref=inp_reference.value,
                                                  doi=inp_doi.value, title=inp_title.value)
    print(line)
    with open(PAPERS_FILE, 'a+') as handle:
        handle.write(line)
    btn_add_paper.button_type = 'success'
def on_click_add ( event ) : if not ( inp_paper_id . value and inp_reference . value and inp_doi . value and inp_title . value ) or "(already present)" in inp_paper_id . value or "ERROR" in inp_paper_id . value : btn_add_paper . button_type = 'danger' print ( inp_paper_id . value + " Paper not added because of some problem." ) return btn_add_paper . button_type = 'primary' line = '{id},"{ref}",{doi},"{title}"\n' . format ( id = inp_paper_id . value , ref = inp_reference . value , doi = inp_doi . value , title = inp_title . value ) print ( line ) with open ( PAPERS_FILE , 'a+' ) as handle : handle . write ( line ) btn_add_paper . button_type = 'success'
Add paper to file cof-papers.csv: botton will turn red if something is missing or paper already present.
Add paper to file cof - papers . csv : botton will turn red if something is missing or paper already present .
"""Add paper to file cof-papers.csv: botton will turn red if something is missing or paper already present."""
event