papers-cli 2.7.2__tar.gz → 2.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. {papers_cli-2.7.2 → papers_cli-2.8}/PKG-INFO +9 -9
  2. {papers_cli-2.7.2 → papers_cli-2.8}/README.md +8 -8
  3. {papers_cli-2.7.2 → papers_cli-2.8}/papers/__main__.py +5 -27
  4. {papers_cli-2.7.2 → papers_cli-2.8}/papers/_version.py +2 -2
  5. {papers_cli-2.7.2 → papers_cli-2.8}/papers/bib.py +5 -5
  6. {papers_cli-2.7.2 → papers_cli-2.8}/papers/encoding.py +41 -0
  7. {papers_cli-2.7.2 → papers_cli-2.8}/papers_cli.egg-info/PKG-INFO +9 -9
  8. {papers_cli-2.7.2 → papers_cli-2.8}/tests/test_list.py +27 -27
  9. {papers_cli-2.7.2 → papers_cli-2.8}/.gitattributes +0 -0
  10. {papers_cli-2.7.2 → papers_cli-2.8}/.github/workflows/pypi.yml +0 -0
  11. {papers_cli-2.7.2 → papers_cli-2.8}/.github/workflows/tests.yml +0 -0
  12. {papers_cli-2.7.2 → papers_cli-2.8}/.gitignore +0 -0
  13. {papers_cli-2.7.2 → papers_cli-2.8}/LICENSE +0 -0
  14. {papers_cli-2.7.2 → papers_cli-2.8}/papers/__init__.py +0 -0
  15. {papers_cli-2.7.2 → papers_cli-2.8}/papers/config.py +0 -0
  16. {papers_cli-2.7.2 → papers_cli-2.8}/papers/duplicate.py +0 -0
  17. {papers_cli-2.7.2 → papers_cli-2.8}/papers/extract.py +0 -0
  18. {papers_cli-2.7.2 → papers_cli-2.8}/papers/filename.py +0 -0
  19. {papers_cli-2.7.2 → papers_cli-2.8}/papers/latexenc.py +0 -0
  20. {papers_cli-2.7.2 → papers_cli-2.8}/papers/utils.py +0 -0
  21. {papers_cli-2.7.2 → papers_cli-2.8}/papers_cli.egg-info/SOURCES.txt +0 -0
  22. {papers_cli-2.7.2 → papers_cli-2.8}/papers_cli.egg-info/dependency_links.txt +0 -0
  23. {papers_cli-2.7.2 → papers_cli-2.8}/papers_cli.egg-info/entry_points.txt +0 -0
  24. {papers_cli-2.7.2 → papers_cli-2.8}/papers_cli.egg-info/requires.txt +0 -0
  25. {papers_cli-2.7.2 → papers_cli-2.8}/papers_cli.egg-info/top_level.txt +0 -0
  26. {papers_cli-2.7.2 → papers_cli-2.8}/pyproject.toml +0 -0
  27. {papers_cli-2.7.2 → papers_cli-2.8}/requirements.txt +0 -0
  28. {papers_cli-2.7.2 → papers_cli-2.8}/setup.cfg +0 -0
  29. {papers_cli-2.7.2 → papers_cli-2.8}/setup.py +0 -0
  30. {papers_cli-2.7.2 → papers_cli-2.8}/tests/__init__.py +0 -0
  31. {papers_cli-2.7.2 → papers_cli-2.8}/tests/common.py +0 -0
  32. {papers_cli-2.7.2 → papers_cli-2.8}/tests/config.py +0 -0
  33. {papers_cli-2.7.2 → papers_cli-2.8}/tests/download.py +0 -0
  34. {papers_cli-2.7.2 → papers_cli-2.8}/tests/downloadedpapers/.gitignore +0 -0
  35. {papers_cli-2.7.2 → papers_cli-2.8}/tests/downloadedpapers/bg-8-515-2011.txt +0 -0
  36. {papers_cli-2.7.2 → papers_cli-2.8}/tests/test_add.py +0 -0
  37. {papers_cli-2.7.2 → papers_cli-2.8}/tests/test_biblio.py +0 -0
  38. {papers_cli-2.7.2 → papers_cli-2.8}/tests/test_duplicates.py +0 -0
  39. {papers_cli-2.7.2 → papers_cli-2.8}/tests/test_encoding.py +0 -0
  40. {papers_cli-2.7.2 → papers_cli-2.8}/tests/test_extract.py +0 -0
  41. {papers_cli-2.7.2 → papers_cli-2.8}/tests/test_filecheck.py +0 -0
  42. {papers_cli-2.7.2 → papers_cli-2.8}/tests/test_install.py +0 -0
  43. {papers_cli-2.7.2 → papers_cli-2.8}/tests/test_misc.py +0 -0
  44. {papers_cli-2.7.2 → papers_cli-2.8}/tests/test_undo.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: papers-cli
3
- Version: 2.7.2
3
+ Version: 2.8
4
4
  Summary: utilities to keep your PDF library organized
5
5
  Author-email: Mahé Perrette <mahe.perrette@gmail.com>
6
6
  License: MIT
@@ -17,7 +17,7 @@ Requires-Dist: scholarly
17
17
  Requires-Dist: rapidfuzz
18
18
  Requires-Dist: normality
19
19
 
20
- [![test](https://github.com/perrette/papers/workflows/CI/badge.svg)](https://github.com/perrette/papers/actions)
20
+ [![test](https://github.com/perrette/papers/workflows/CI/badge.svg?branch=main)](https://github.com/perrette/papers/actions)
21
21
  [![python](https://img.shields.io/badge/python-3.9-blue.svg)]()
22
22
  [![python](https://img.shields.io/badge/python-3.10-blue.svg)]()
23
23
  [![python](https://img.shields.io/badge/python-3.11-blue.svg)]()
@@ -121,25 +121,25 @@ Some old files don't have a DOI. Best is to add the entry from its bibtex:
121
121
 
122
122
  ### List entries (and edit etc...)
123
123
 
124
- Pretty listing (-1 or -l for one-liner listing, otherwise plain bibtex):
124
+ Pretty listing by default (otherwise pass --plain for plain bibtex):
125
125
 
126
- $> papers list -1
126
+ $> papers list
127
127
  Perrette2013: A scaling approach to project regional sea level rise and it... (doi:10.5194/esd-4-11-2013, file:1)
128
128
 
129
129
  Search with any number of keywords:
130
130
 
131
- $> papers list perrette scaling approach sea level -1
131
+ $> papers list perrette scaling approach sea level
132
132
  ... (short list)
133
- $> papers list perrette scaling approach sea level --any -1
133
+ $> papers list perrette scaling approach sea level --any
134
134
  ... (long list)
135
- $> papers list --key perrette2013 --author perrette --year 2013 --title scaling approach sea level -1
135
+ $> papers list --key perrette2013 --author perrette --year 2013 --title scaling approach sea level
136
136
  ... (precise list)
137
137
 
138
138
  Add tags to view papers by topic:
139
139
 
140
- $> papers list perrette2013 --add-tag sea-level projections -1
140
+ $> papers list perrette2013 --add-tag sea-level projections
141
141
  ...
142
- $> papers list --tag sea-level projections -1
142
+ $> papers list --tag sea-level projections
143
143
  Perrette2013: A scaling approach to project regional sea level rise and it... (doi:10.5194/esd-4-11-2013, file:1, sea-level | projections )
144
144
 
145
145
  `papers list` is a powerful command, inspired from unix's `find` and `grep`.
@@ -1,4 +1,4 @@
1
- [![test](https://github.com/perrette/papers/workflows/CI/badge.svg)](https://github.com/perrette/papers/actions)
1
+ [![test](https://github.com/perrette/papers/workflows/CI/badge.svg?branch=main)](https://github.com/perrette/papers/actions)
2
2
  [![python](https://img.shields.io/badge/python-3.9-blue.svg)]()
3
3
  [![python](https://img.shields.io/badge/python-3.10-blue.svg)]()
4
4
  [![python](https://img.shields.io/badge/python-3.11-blue.svg)]()
@@ -102,25 +102,25 @@ Some old files don't have a DOI. Best is to add the entry from its bibtex:
102
102
 
103
103
  ### List entries (and edit etc...)
104
104
 
105
- Pretty listing (-1 or -l for one-liner listing, otherwise plain bibtex):
105
+ Pretty listing by default (otherwise pass --plain for plain bibtex):
106
106
 
107
- $> papers list -1
107
+ $> papers list
108
108
  Perrette2013: A scaling approach to project regional sea level rise and it... (doi:10.5194/esd-4-11-2013, file:1)
109
109
 
110
110
  Search with any number of keywords:
111
111
 
112
- $> papers list perrette scaling approach sea level -1
112
+ $> papers list perrette scaling approach sea level
113
113
  ... (short list)
114
- $> papers list perrette scaling approach sea level --any -1
114
+ $> papers list perrette scaling approach sea level --any
115
115
  ... (long list)
116
- $> papers list --key perrette2013 --author perrette --year 2013 --title scaling approach sea level -1
116
+ $> papers list --key perrette2013 --author perrette --year 2013 --title scaling approach sea level
117
117
  ... (precise list)
118
118
 
119
119
  Add tags to view papers by topic:
120
120
 
121
- $> papers list perrette2013 --add-tag sea-level projections -1
121
+ $> papers list perrette2013 --add-tag sea-level projections
122
122
  ...
123
- $> papers list --tag sea-level projections -1
123
+ $> papers list --tag sea-level projections
124
124
  Perrette2013: A scaling approach to project regional sea level rise and it... (doi:10.5194/esd-4-11-2013, file:1, sea-level | projections )
125
125
 
126
126
  `papers list` is a powerful command, inspired from unix's `find` and `grep`.
@@ -16,11 +16,11 @@ import papers
16
16
  from papers import logger
17
17
  from papers.extract import extract_pdf_doi, isvaliddoi, extract_pdf_metadata
18
18
  from papers.extract import fetch_bibtex_by_doi
19
- from papers.encoding import parse_file, format_file, family_names, format_entries, standard_name
19
+ from papers.encoding import parse_file, format_file, family_names, format_entries, standard_name, format_entry, parse_keywords, format_key
20
20
  from papers.config import bcolors, Config, search_config, CONFIG_FILE, CONFIG_FILE_LOCAL, DATA_DIR, CONFIG_FILE_LEGACY, BACKUP_DIR
21
21
  from papers.duplicate import list_duplicates, list_uniques, edit_entries
22
22
  from papers.bib import Biblio, FUZZY_RATIO, DEFAULT_SIMILARITY, entry_filecheck, backupfile as backupfile_func, isvalidkey
23
- from papers.utils import move, checksum, ansi_link as link, view_pdf
23
+ from papers.utils import move, checksum, view_pdf
24
24
  from papers import __version__
25
25
 
26
26
 
@@ -801,15 +801,6 @@ def listcmd(parser, o, config):
801
801
  eq = lambda a, b: a['ID'] == b['ID'] or are_duplicates(a, b, similarity="PARTIAL", fuzzy_ratio=o.fuzzy_ratio)
802
802
  entries = list_dup(entries, eq=eq)
803
803
 
804
- if o.no_key:
805
- key = lambda e: ''
806
- else:
807
- # key = lambda e: bcolors.OKBLUE+e['ID']+filetag(e)+':'+bcolors.ENDC
808
- key = lambda e: _nfiles(e)*(bcolors.BOLD)+bcolors.OKBLUE+e['ID']+':'+bcolors.ENDC
809
-
810
- def parse_keywords(e):
811
- return [w.strip() for w in e.get('keywords', '').split(',') if w.strip()]
812
-
813
804
  if o.add_keywords:
814
805
  for e in entries:
815
806
  keywords = parse_keywords(e)
@@ -861,27 +852,13 @@ def listcmd(parser, o, config):
861
852
  elif o.field:
862
853
  # entries = [{k:e[k] for k in e if k in o.field+['ID','ENTRYTYPE']} for e in entries]
863
854
  for e in entries:
864
- print(key(e),*[e.get(k, "") for k in o.field])
855
+ print(format_key(e, no_key=o.no_key),*[e.get(k, "") for k in o.field])
865
856
  elif o.key_only:
866
857
  for e in entries:
867
858
  print(e['ID'])
868
859
  elif o.one_liner:
869
860
  for e in entries:
870
- tit = e.get('title', '')[:60]+ ('...' if len(e.get('title', ''))>60 else '')
871
- info = []
872
- if e.get('doi',''):
873
- info.append(link(f"https://doi.org/{e['doi']}", 'doi:'+e['doi']))
874
- n = _nfiles(e)
875
- if n:
876
- files = parse_file(e.get('file',''), relative_to=biblio.relative_to)
877
- file_link = f"file:///{Path(files[0]).resolve()}"
878
- ansi_link = link(file_link, f'{"file" if n == 1 else "files"}:{str(n)}')
879
- info.append(bcolors.OKGREEN+ansi_link+bcolors.ENDC)
880
- if e.get('keywords',''):
881
- keywords = parse_keywords(e)
882
- info.append(bcolors.WARNING+" | ".join(keywords)+bcolors.ENDC)
883
- infotag = '('+', '.join(info)+')' if info else ''
884
- print(key(e), tit, infotag)
861
+ print(format_entry(biblio, e, no_key=o.no_key))
885
862
 
886
863
  else:
887
864
  print(format_entries(entries))
@@ -1147,6 +1124,7 @@ def get_parser(config=None):
1147
1124
 
1148
1125
  grp = listp.add_argument_group('formatting')
1149
1126
  mgrp = grp.add_mutually_exclusive_group()
1127
+ mgrp.add_argument('--plain', action='store_false', dest="one_liner", help='print in bibtex format')
1150
1128
  mgrp.add_argument('-l', '-1', '--one-liner', action='store_true', help='one liner')
1151
1129
  mgrp.add_argument('--key-only', action='store_true')
1152
1130
  mgrp.add_argument('-f', '--field', nargs='+', help='specific field(s) only')
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '2.7.2'
16
- __version_tuple__ = version_tuple = (2, 7, 2)
15
+ __version__ = version = '2.8'
16
+ __version_tuple__ = version_tuple = (2, 8)
@@ -19,7 +19,7 @@ from papers.extract import extract_pdf_metadata
19
19
  from papers.extract import fetch_bibtex_by_fulltext_crossref, fetch_bibtex_by_doi
20
20
 
21
21
  from papers.encoding import unicode_to_latex, unicode_to_ascii
22
- from papers.encoding import parse_file, format_file, standard_name, family_names, format_entries, update_file_path
22
+ from papers.encoding import parse_file, format_file, standard_name, family_names, format_entries, update_file_path, format_entry
23
23
 
24
24
  from papers.filename import NAMEFORMAT, KEYFORMAT
25
25
  from papers.utils import bcolors, checksum, move as _move
@@ -298,14 +298,14 @@ class Biblio:
298
298
  newkey = self.append_abc_to_key(entry) # add abc
299
299
  logger.info('update key: {} => {}'.format(entry['ID'], newkey))
300
300
  entry['ID'] = newkey
301
- print("Updated entry:", self.key(entry))
301
+ print(format_entry(self, entry, prefix="Updated"))
302
302
 
303
303
  else:
304
304
  raise DuplicateKeyError('this error can be avoided if update_key is True')
305
305
 
306
306
  else:
307
307
  logger.info('new entry: '+self.key(entry))
308
- print("New entry:", self.key(entry))
308
+ print(format_entry(self, entry, prefix="Added"))
309
309
 
310
310
  self.entries.insert(i, entry)
311
311
 
@@ -335,7 +335,7 @@ class Biblio:
335
335
  if entry == candidate:
336
336
  logger.debug('exact duplicate')
337
337
  if rename: self.rename_entry_files(candidate, copy=copy)
338
- print("Existing entry:", self.key(entry))
338
+ print(format_entry(self, entry, prefix="Existing"))
339
339
  return [ entry ] # do nothing
340
340
 
341
341
  if update_key and entry['ID'] != candidate['ID']:
@@ -354,7 +354,7 @@ class Biblio:
354
354
  logger.debug('fixed: exact duplicate')
355
355
  entry = candidate
356
356
  if rename: self.rename_entry_files(candidate, copy=copy)
357
- print("Existing entry:", self.key(entry))
357
+ print(format_entry(self, entry, prefix="Existing"))
358
358
  return [ entry ] # do nothing
359
359
 
360
360
  logger.debug('conflict resolution: '+on_conflict)
@@ -1,7 +1,9 @@
1
1
  import os
2
2
  import bibtexparser
3
+ from pathlib import Path
3
4
  from unidecode import unidecode as unicode_to_ascii
4
5
  from papers.latexenc import unicode_to_latex
6
+ from papers.utils import ansi_link as link, bcolors
5
7
  from papers import logger
6
8
 
7
9
  # fix bibtexparser call on empty strings
@@ -89,6 +91,45 @@ def format_entries(entries):
89
91
  db.entries.extend(entries)
90
92
  return bibtexparser.dumps(db)
91
93
 
94
+ def parse_keywords(e):
95
+ return [w.strip() for w in e.get('keywords', '').split(',') if w.strip()]
96
+
97
+ def format_key(e, no_key=False):
98
+ if no_key:
99
+ key = lambda e: ''
100
+ else:
101
+ n = len(parse_file(e.get('file','')))
102
+ key = lambda e: n*(bcolors.BOLD)+bcolors.OKBLUE+e['ID']+':'+bcolors.ENDC
103
+ return key(e)
104
+
105
+ def format_entry(biblio, e, no_key=False, prefix=""):
106
+ """One-liner formatter
107
+ """
108
+ tit = e.get('title', '')[:60]+ ('...' if len(e.get('title', ''))>60 else '')
109
+ info = []
110
+ if e.get('doi',''):
111
+ info.append(link(f"https://doi.org/{e['doi']}", 'doi:'+e['doi']))
112
+
113
+ files = parse_file(e.get('file',''), relative_to=biblio.relative_to)
114
+ n = len(files)
115
+
116
+ if n:
117
+ file_link = f"file:///{Path(files[0]).resolve()}"
118
+ ansi_link = link(file_link, f'{"file" if n == 1 else "files"}:{str(n)}')
119
+ info.append(bcolors.OKGREEN+ansi_link+bcolors.ENDC)
120
+
121
+ if e.get('keywords',''):
122
+ keywords = parse_keywords(e)
123
+ info.append(bcolors.WARNING+" | ".join(keywords)+bcolors.ENDC)
124
+
125
+ infotag = '('+', '.join(info)+')' if info else ''
126
+ if prefix:
127
+ prefixtag = f"{bcolors.WARNING}{prefix} -> {bcolors.ENDC}"
128
+ else:
129
+ prefixtag = ""
130
+ return f"{prefixtag}{format_key(e, no_key=no_key)} {tit} {infotag}"
131
+
132
+
92
133
  # Parse name entry
93
134
  # ================
94
135
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: papers-cli
3
- Version: 2.7.2
3
+ Version: 2.8
4
4
  Summary: utilities to keep your PDF library organized
5
5
  Author-email: Mahé Perrette <mahe.perrette@gmail.com>
6
6
  License: MIT
@@ -17,7 +17,7 @@ Requires-Dist: scholarly
17
17
  Requires-Dist: rapidfuzz
18
18
  Requires-Dist: normality
19
19
 
20
- [![test](https://github.com/perrette/papers/workflows/CI/badge.svg)](https://github.com/perrette/papers/actions)
20
+ [![test](https://github.com/perrette/papers/workflows/CI/badge.svg?branch=main)](https://github.com/perrette/papers/actions)
21
21
  [![python](https://img.shields.io/badge/python-3.9-blue.svg)]()
22
22
  [![python](https://img.shields.io/badge/python-3.10-blue.svg)]()
23
23
  [![python](https://img.shields.io/badge/python-3.11-blue.svg)]()
@@ -121,25 +121,25 @@ Some old files don't have a DOI. Best is to add the entry from its bibtex:
121
121
 
122
122
  ### List entries (and edit etc...)
123
123
 
124
- Pretty listing (-1 or -l for one-liner listing, otherwise plain bibtex):
124
+ Pretty listing by default (otherwise pass --plain for plain bibtex):
125
125
 
126
- $> papers list -1
126
+ $> papers list
127
127
  Perrette2013: A scaling approach to project regional sea level rise and it... (doi:10.5194/esd-4-11-2013, file:1)
128
128
 
129
129
  Search with any number of keywords:
130
130
 
131
- $> papers list perrette scaling approach sea level -1
131
+ $> papers list perrette scaling approach sea level
132
132
  ... (short list)
133
- $> papers list perrette scaling approach sea level --any -1
133
+ $> papers list perrette scaling approach sea level --any
134
134
  ... (long list)
135
- $> papers list --key perrette2013 --author perrette --year 2013 --title scaling approach sea level -1
135
+ $> papers list --key perrette2013 --author perrette --year 2013 --title scaling approach sea level
136
136
  ... (precise list)
137
137
 
138
138
  Add tags to view papers by topic:
139
139
 
140
- $> papers list perrette2013 --add-tag sea-level projections -1
140
+ $> papers list perrette2013 --add-tag sea-level projections
141
141
  ...
142
- $> papers list --tag sea-level projections -1
142
+ $> papers list --tag sea-level projections
143
143
  Perrette2013: A scaling approach to project regional sea level rise and it... (doi:10.5194/esd-4-11-2013, file:1, sea-level | projections )
144
144
 
145
145
  `papers list` is a powerful command, inspired from unix's `find` and `grep`.
@@ -40,99 +40,99 @@ class FormattingTest(ListTest):
40
40
  class SearchTest(ListTest):
41
41
 
42
42
  def test_list_title(self):
43
- out = self.papers(f'list --title "ice-edge blooms"', sp_cmd='check_output')
43
+ out = self.papers(f'list --plain --title "ice-edge blooms"', sp_cmd='check_output')
44
44
  self.assertMultiLineEqual(out, self.initial_content)
45
45
 
46
46
  def test_list_title_fuzzy(self):
47
- out = self.papers(f'list --title "ice edge bloom arctc"', sp_cmd='check_output')
47
+ out = self.papers(f'list --plain --title "ice edge bloom arctc"', sp_cmd='check_output')
48
48
  self.assertEqual(out, "")
49
49
 
50
- out = self.papers(f'list --title "ice edge bloom arctc" --fuzzy', sp_cmd='check_output')
50
+ out = self.papers(f'list --plain --title "ice edge bloom arctc" --fuzzy', sp_cmd='check_output')
51
51
  self.assertMultiLineEqual(out, self.initial_content)
52
52
 
53
53
  def test_list_title_multiple(self):
54
- out = self.papers(f'list --title ice edge', sp_cmd='check_output')
54
+ out = self.papers(f'list --plain --title ice edge', sp_cmd='check_output')
55
55
  self.assertMultiLineEqual(out, self.initial_content)
56
56
 
57
- out = self.papers(f'list --title ice edge antarctic', sp_cmd='check_output')
57
+ out = self.papers(f'list --plain --title ice edge antarctic', sp_cmd='check_output')
58
58
  self.assertEqual(out, "")
59
59
 
60
- out = self.papers(f'list --title ice edge antarctic --any', sp_cmd='check_output')
60
+ out = self.papers(f'list --plain --title ice edge antarctic --any', sp_cmd='check_output')
61
61
  self.assertMultiLineEqual(out, self.initial_content)
62
62
 
63
63
  def test_list_author(self):
64
- out = self.papers(f'list --author perrette', sp_cmd='check_output')
64
+ out = self.papers(f'list --plain --author perrette', sp_cmd='check_output')
65
65
  self.assertMultiLineEqual(out, self.initial_content)
66
66
 
67
- out = self.papers(f'list --author perrette balafon', sp_cmd='check_output')
67
+ out = self.papers(f'list --plain --author perrette balafon', sp_cmd='check_output')
68
68
  self.assertEqual(out, "")
69
69
 
70
- out = self.papers(f'list --author perrette balafon --any', sp_cmd='check_output')
70
+ out = self.papers(f'list --plain --author perrette balafon --any', sp_cmd='check_output')
71
71
  self.assertMultiLineEqual(out, self.initial_content)
72
72
 
73
73
  def test_list_key(self):
74
- out = self.papers(f'list --key perrette', sp_cmd='check_output')
74
+ out = self.papers(f'list --plain --key perrette', sp_cmd='check_output')
75
75
  self.assertMultiLineEqual(out, self.initial_content)
76
76
 
77
- out = self.papers(f'list --key perrette --strict', sp_cmd='check_output')
77
+ out = self.papers(f'list --plain --key perrette --strict', sp_cmd='check_output')
78
78
  self.assertEqual(out, "")
79
79
 
80
- out = self.papers(f'list --key perrette_2011 --strict', sp_cmd='check_output')
80
+ out = self.papers(f'list --plain --key perrette_2011 --strict', sp_cmd='check_output')
81
81
  self.assertMultiLineEqual(out, self.initial_content)
82
82
 
83
83
  def test_list_year(self):
84
- out = self.papers(f'list --year 201', sp_cmd='check_output')
84
+ out = self.papers(f'list --plain --year 201', sp_cmd='check_output')
85
85
  self.assertMultiLineEqual(out, self.initial_content)
86
86
 
87
- out = self.papers(f'list --year 201 --strict', sp_cmd='check_output')
87
+ out = self.papers(f'list --plain --year 201 --strict', sp_cmd='check_output')
88
88
  self.assertEqual(out, "")
89
89
 
90
- out = self.papers(f'list --year 2011 --strict', sp_cmd='check_output')
90
+ out = self.papers(f'list --plain --year 2011 --strict', sp_cmd='check_output')
91
91
  self.assertMultiLineEqual(out, self.initial_content)
92
92
 
93
93
  def test_list_tag(self):
94
- out = self.papers(f'list --tag kiwi', sp_cmd='check_output')
94
+ out = self.papers(f'list --plain --tag kiwi', sp_cmd='check_output')
95
95
  self.assertMultiLineEqual(out, self.initial_content)
96
96
 
97
- out = self.papers(f'list --tag kiwi ocean', sp_cmd='check_output')
97
+ out = self.papers(f'list --plain --tag kiwi ocean', sp_cmd='check_output')
98
98
  self.assertMultiLineEqual(out, self.initial_content)
99
99
 
100
- out = self.papers(f'list --tag kiwi bonobo', sp_cmd='check_output')
100
+ out = self.papers(f'list --plain --tag kiwi bonobo', sp_cmd='check_output')
101
101
  self.assertEqual(out, "")
102
102
 
103
- out = self.papers(f'list --tag kiwi bonobo --any', sp_cmd='check_output')
103
+ out = self.papers(f'list --plain --tag kiwi bonobo --any', sp_cmd='check_output')
104
104
  self.assertMultiLineEqual(out, self.initial_content)
105
105
 
106
106
 
107
107
  def test_list_combined(self):
108
- out = self.papers(f'list --year 2011 --author perrette', sp_cmd='check_output')
108
+ out = self.papers(f'list --plain --year 2011 --author perrette', sp_cmd='check_output')
109
109
  self.assertMultiLineEqual(out, self.initial_content)
110
110
 
111
111
  # Here we'd need the full name (never useful in practice)
112
- out = self.papers(f'list --year 2011 --author perrette --strict', sp_cmd='check_output')
112
+ out = self.papers(f'list --plain --year 2011 --author perrette --strict', sp_cmd='check_output')
113
113
  self.assertEqual(out, "")
114
114
 
115
- out = self.papers(f'list --year 2021 --author perrette', sp_cmd='check_output')
115
+ out = self.papers(f'list --plain --year 2021 --author perrette', sp_cmd='check_output')
116
116
  self.assertEqual(out, "")
117
117
 
118
118
  # --any has no effect on multiple strings
119
- out = self.papers(f'list --year 2021 --author perrette --any', sp_cmd='check_output')
119
+ out = self.papers(f'list --plain --year 2021 --author perrette --any', sp_cmd='check_output')
120
120
  self.assertEqual(out, "")
121
121
 
122
122
 
123
123
  def test_list_fullsearch(self):
124
- out = self.papers(f'list 2011 perrette', sp_cmd='check_output')
124
+ out = self.papers(f'list --plain 2011 perrette', sp_cmd='check_output')
125
125
  self.assertMultiLineEqual(out, self.initial_content)
126
126
 
127
127
  # --strict is deactivated
128
- out = self.papers(f'list 2011 perrette --strict', sp_cmd='check_output')
128
+ out = self.papers(f'list --plain 2011 perrette --strict', sp_cmd='check_output')
129
129
  self.assertMultiLineEqual(out, self.initial_content)
130
130
 
131
- out = self.papers(f'list 2021 perrette', sp_cmd='check_output')
131
+ out = self.papers(f'list --plain 2021 perrette', sp_cmd='check_output')
132
132
  self.assertEqual(out, "")
133
133
 
134
134
  # any works well on full search strings
135
- out = self.papers(f'list 2021 perrette --any', sp_cmd='check_output')
135
+ out = self.papers(f'list --plain 2021 perrette --any', sp_cmd='check_output')
136
136
  self.assertMultiLineEqual(out, self.initial_content)
137
137
 
138
138
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes