Esempio n. 1
0
def _browse(ctx: click.Context, key: Optional[str]) -> None:
    """browse a document in the documents list"""
    docs = papis.api.pick_doc(ctx.obj['documents'])
    if key:
        config.set("browse-key", key)
    if not docs:
        return
    for d in docs:
        papis.commands.browse.run(d)
Esempio n. 2
0
def cli(ctx: click.Context, no_auto_read: bool) -> None:
    """A papis script to interact with bibtex files"""
    global explorer_mgr
    ctx.obj = {'documents': []}

    if no_auto_read:
        logger.info('Setting auto-read to False')
        config.set('auto-read', 'False', section='bibtex')

    bibfile = config.get('default-read-bibfile', section='bibtex')
    if (bool(config.getboolean('auto-read', section='bibtex')) and bibfile
            and os.path.exists(bibfile)):
        logger.info("auto reading {0}".format(bibfile))
        explorer_mgr['bibtex'].plugin.callback(bibfile)