xdufacool/organize_bib.py
def organize_bib():
    """To parse command line and process the paper organization task."""

    parser = argparse.ArgumentParser(description='Organize papers')
    parser.add_argument('bibfile', help='The bibtex file to be processed.')
    subparsers = parser.add_subparsers(help='Available commands')

    help_tmpl = 'Create a YAML file describing metadata for the organization tasks.'
    parser_tmpl = subparsers.add_parser('genmetadata', help=help_tmpl)
    parser_tmpl.add_argument('--PI', default='Qi, Fei',
                             help='The name of the PI.')
    parser_tmpl.add_argument('--metadata', '-m',
                             help='Output metadata in a YAML file.')
    parser_tmpl.set_defaults(func=gen_metadata)

    help_patch = 'Create attachements for uploading to NSFC website.'
    parser_attach = subparsers.add_parser('genattach', help=help_patch)
    parser_attach.add_argument('--metadata', '-m',
                             help='Metadata in YAML format specifying the task.')
    parser_attach.add_argument('--script', '-s',
                             help='Bash script for creating tasks.')
    parser_attach.set_defaults(func=gen_attachments)    

    help_extract = 'Extract bib items based on a given aux file.'
    parser_extract = subparsers.add_parser('extract', help=help_extract)
    parser_extract.add_argument('--auxfile', '-x',
                                 help='AUX file created by LaTeX.')
    parser_extract.add_argument('--output', '-o',
                                 help='Output of cited references in BibTeX format.')
    parser_extract.set_defaults(func=extract_bibtex)

    help_simplify = 'Simplify a BibTeX file.'
    parser_simplify = subparsers.add_parser('simplify', help=help_simplify)
    parser_simplify.add_argument('--bib-journal', '-b',
                                help='BibTeX of canonical journal/conference titles.')
    parser_simplify.add_argument('--output', '-o',
                                help='Output of simplified BibTeX.')
    parser_simplify.set_defaults(func=simplify_bibtex)

    args = parser.parse_args()
    # print(args)
    args.func(args)
To parse command line and process the paper organization task.
To parse command line and process the paper organization task.
To parse command line and process the paper organization task .
def organize_bib():
    parser = argparse.ArgumentParser(description='Organize papers')
    parser.add_argument('bibfile', help='The bibtex file to be processed.')
    subparsers = parser.add_subparsers(help='Available commands')
    help_tmpl = 'Create a YAML file describing metadata for the organization tasks.'
    parser_tmpl = subparsers.add_parser('genmetadata', help=help_tmpl)
    parser_tmpl.add_argument('--PI', default='Qi, Fei',
                             help='The name of the PI.')
    parser_tmpl.add_argument('--metadata', '-m',
                             help='Output metadata in a YAML file.')
    parser_tmpl.set_defaults(func=gen_metadata)
    help_patch = 'Create attachements for uploading to NSFC website.'
    parser_attach = subparsers.add_parser('genattach', help=help_patch)
    parser_attach.add_argument('--metadata', '-m',
                             help='Metadata in YAML format specifying the task.')
    parser_attach.add_argument('--script', '-s',
                             help='Bash script for creating tasks.')
    parser_attach.set_defaults(func=gen_attachments)    
    help_extract = 'Extract bib items based on a given aux file.'
    parser_extract = subparsers.add_parser('extract', help=help_extract)
    parser_extract.add_argument('--auxfile', '-x',
                                 help='AUX file created by LaTeX.')
    parser_extract.add_argument('--output', '-o',
                                 help='Output of cited references in BibTeX format.')
    parser_extract.set_defaults(func=extract_bibtex)
    help_simplify = 'Simplify a BibTeX file.'
    parser_simplify = subparsers.add_parser('simplify', help=help_simplify)
    parser_simplify.add_argument('--bib-journal', '-b',
                                help='BibTeX of canonical journal/conference titles.')
    parser_simplify.add_argument('--output', '-o',
                                help='Output of simplified BibTeX.')
    parser_simplify.set_defaults(func=simplify_bibtex)
    args = parser.parse_args()
    args.func(args)
def organize_bib ( ) : parser = argparse . ArgumentParser ( description = 'Organize papers' ) parser . add_argument ( 'bibfile' , help = 'The bibtex file to be processed.' ) subparsers = parser . add_subparsers ( help = 'Available commands' ) help_tmpl = 'Create a YAML file describing metadata for the organization tasks.' parser_tmpl = subparsers . add_parser ( 'genmetadata' , help = help_tmpl ) parser_tmpl . add_argument ( '--PI' , default = 'Qi, Fei' , help = 'The name of the PI.' ) parser_tmpl . add_argument ( '--metadata' , '-m' , help = 'Output metadata in a YAML file.' ) parser_tmpl . set_defaults ( func = gen_metadata ) help_patch = 'Create attachements for uploading to NSFC website.' parser_attach = subparsers . add_parser ( 'genattach' , help = help_patch ) parser_attach . add_argument ( '--metadata' , '-m' , help = 'Metadata in YAML format specifying the task.' ) parser_attach . add_argument ( '--script' , '-s' , help = 'Bash script for creating tasks.' ) parser_attach . set_defaults ( func = gen_attachments ) help_extract = 'Extract bib items based on a given aux file.' parser_extract = subparsers . add_parser ( 'extract' , help = help_extract ) parser_extract . add_argument ( '--auxfile' , '-x' , help = 'AUX file created by LaTeX.' ) parser_extract . add_argument ( '--output' , '-o' , help = 'Output of cited references in BibTeX format.' ) parser_extract . set_defaults ( func = extract_bibtex ) help_simplify = 'Simplify a BibTeX file.' parser_simplify = subparsers . add_parser ( 'simplify' , help = help_simplify ) parser_simplify . add_argument ( '--bib-journal' , '-b' , help = 'BibTeX of canonical journal/conference titles.' ) parser_simplify . add_argument ( '--output' , '-o' , help = 'Output of simplified BibTeX.' ) parser_simplify . set_defaults ( func = simplify_bibtex ) args = parser . parse_args ( ) args . func ( args )
To parse command line and process the paper organization task.
To parse command line and process the paper organization task .
"""To parse command line and process the paper organization task.""" # print(args)