support all one_liner + fix deprecation warnings in utils
This commit is contained in:
parent
1b8728f4f6
commit
a30e75a5e6
@ -147,7 +147,7 @@ def command(conf, args):
|
|||||||
doc_add = conf['main']['doc_add']
|
doc_add = conf['main']['doc_add']
|
||||||
|
|
||||||
rp.push_paper(p)
|
rp.push_paper(p)
|
||||||
ui.message('added to pubs:\n{}'.format(pretty.paper_oneliner(p)))
|
ui.message('added to pubs:\n{}'.format(pretty.paper_oneliner(p, n_authors=conf['main']['n_authors'])))
|
||||||
if docfile is not None:
|
if docfile is not None:
|
||||||
rp.push_doc(p.citekey, docfile, copy=(doc_add in ('copy', 'move')))
|
rp.push_doc(p.citekey, docfile, copy=(doc_add in ('copy', 'move')))
|
||||||
if doc_add == 'move' and content.content_type(docfile) != 'url':
|
if doc_add == 'move' and content.content_type(docfile) != 'url':
|
||||||
|
@ -117,7 +117,7 @@ def command(conf, args):
|
|||||||
len(p.tags.intersection(excluded)) == 0):
|
len(p.tags.intersection(excluded)) == 0):
|
||||||
papers_list.append(p)
|
papers_list.append(p)
|
||||||
|
|
||||||
ui.message('\n'.join(pretty.paper_oneliner(p)
|
ui.message('\n'.join(pretty.paper_oneliner(p, n_authors=conf['main']['n_authors'])
|
||||||
for p in papers_list))
|
for p in papers_list))
|
||||||
|
|
||||||
rp.close()
|
rp.close()
|
||||||
|
@ -27,7 +27,8 @@ edit_cmd = string(default='')
|
|||||||
# Which default extension to use when creating a note file.
|
# Which default extension to use when creating a note file.
|
||||||
note_extension = string(default='txt')
|
note_extension = string(default='txt')
|
||||||
|
|
||||||
# How many authors to display in
|
# How many authors to display when displaying a citation. If there are more
|
||||||
|
# authors, only the first author is diplayed followed by 'et al.'.
|
||||||
n_authors = integer(default=3)
|
n_authors = integer(default=3)
|
||||||
|
|
||||||
# If true debug mode is on which means exceptions are not catched and
|
# If true debug mode is on which means exceptions are not catched and
|
||||||
|
@ -33,7 +33,7 @@ def resolve_citekey(repo, citekey, ui=None, exit_on_fail=True):
|
|||||||
"citekeys:".format(citekey))
|
"citekeys:".format(citekey))
|
||||||
for c in citekeys:
|
for c in citekeys:
|
||||||
p = repo.pull_paper(c)
|
p = repo.pull_paper(c)
|
||||||
ui.message(' {}'.format(pretty.paper_oneliner(p)))
|
ui.message(' {}'.format(pretty.paper_oneliner(p, n_authors=conf['main']['n_authors'])))
|
||||||
if exit_on_fail:
|
if exit_on_fail:
|
||||||
ui.exit()
|
ui.exit()
|
||||||
return citekey
|
return citekey
|
||||||
@ -73,11 +73,11 @@ def standardize_doi(doi):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
doi_regexes = (
|
doi_regexes = (
|
||||||
'(10\.\d{4,9}/[-._;()/:A-z0-9\>\<]+)',
|
r'(10\.\d{4,9}/[-._;()/:A-z0-9\>\<]+)',
|
||||||
'(10.1002/[^\s]+)',
|
r'(10.1002/[^\s]+)',
|
||||||
'(10\.\d{4}/\d+-\d+X?(\d+)\d+<[\d\w]+:[\d\w]*>\d+.\d+.\w+;\d)',
|
r'(10\.\d{4}/\d+-\d+X?(\d+)\d+<[\d\w]+:[\d\w]*>\d+.\d+.\w+;\d)',
|
||||||
'(10\.1021/\w\w\d+\+)',
|
r'(10\.1021/\w\w\d+\+)',
|
||||||
'(10\.1207/[\w\d]+\&\d+_\d+)')
|
r'(10\.1207/[\w\d]+\&\d+_\d+)')
|
||||||
doi_pattern = re.compile('|'.join(doi_regexes))
|
doi_pattern = re.compile('|'.join(doi_regexes))
|
||||||
|
|
||||||
match = doi_pattern.search(doi)
|
match = doi_pattern.search(doi)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user