support all one_liner + fix deprecation warnings in utils

main
Fabien C. Y. Benureau 5 years ago
parent 1b8728f4f6
commit a30e75a5e6
No known key found for this signature in database
GPG Key ID: C3FB5E831A249A9A

@ -147,7 +147,7 @@ def command(conf, args):
doc_add = conf['main']['doc_add']
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:
rp.push_doc(p.citekey, docfile, copy=(doc_add in ('copy', 'move')))
if doc_add == 'move' and content.content_type(docfile) != 'url':

@ -117,7 +117,7 @@ def command(conf, args):
len(p.tags.intersection(excluded)) == 0):
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))
rp.close()

@ -27,7 +27,8 @@ edit_cmd = string(default='')
# Which default extension to use when creating a note file.
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)
# 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))
for c in citekeys:
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:
ui.exit()
return citekey
@ -73,11 +73,11 @@ def standardize_doi(doi):
"""
doi_regexes = (
'(10\.\d{4,9}/[-._;()/:A-z0-9\>\<]+)',
'(10.1002/[^\s]+)',
'(10\.\d{4}/\d+-\d+X?(\d+)\d+<[\d\w]+:[\d\w]*>\d+.\d+.\w+;\d)',
'(10\.1021/\w\w\d+\+)',
'(10\.1207/[\w\d]+\&\d+_\d+)')
r'(10\.\d{4,9}/[-._;()/:A-z0-9\>\<]+)',
r'(10.1002/[^\s]+)',
r'(10\.\d{4}/\d+-\d+X?(\d+)\d+<[\d\w]+:[\d\w]*>\d+.\d+.\w+;\d)',
r'(10\.1021/\w\w\d+\+)',
r'(10\.1207/[\w\d]+\&\d+_\d+)')
doi_pattern = re.compile('|'.join(doi_regexes))
match = doi_pattern.search(doi)

Loading…
Cancel
Save