papers-cli 2.7__tar.gz → 2.7.2__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.
- {papers_cli-2.7 → papers_cli-2.7.2}/PKG-INFO +1 -1
- {papers_cli-2.7 → papers_cli-2.7.2}/papers/__main__.py +9 -1
- {papers_cli-2.7 → papers_cli-2.7.2}/papers/_version.py +2 -2
- {papers_cli-2.7 → papers_cli-2.7.2}/papers/bib.py +0 -1
- {papers_cli-2.7 → papers_cli-2.7.2}/papers/duplicate.py +1 -3
- {papers_cli-2.7 → papers_cli-2.7.2}/papers_cli.egg-info/PKG-INFO +1 -1
- {papers_cli-2.7 → papers_cli-2.7.2}/.gitattributes +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/.github/workflows/pypi.yml +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/.github/workflows/tests.yml +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/.gitignore +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/LICENSE +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/README.md +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/papers/__init__.py +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/papers/config.py +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/papers/encoding.py +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/papers/extract.py +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/papers/filename.py +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/papers/latexenc.py +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/papers/utils.py +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/papers_cli.egg-info/SOURCES.txt +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/papers_cli.egg-info/dependency_links.txt +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/papers_cli.egg-info/entry_points.txt +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/papers_cli.egg-info/requires.txt +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/papers_cli.egg-info/top_level.txt +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/pyproject.toml +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/requirements.txt +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/setup.cfg +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/setup.py +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/tests/__init__.py +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/tests/common.py +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/tests/config.py +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/tests/download.py +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/tests/downloadedpapers/.gitignore +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/tests/downloadedpapers/bg-8-515-2011.txt +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/tests/test_add.py +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/tests/test_biblio.py +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/tests/test_duplicates.py +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/tests/test_encoding.py +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/tests/test_extract.py +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/tests/test_filecheck.py +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/tests/test_install.py +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/tests/test_list.py +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/tests/test_misc.py +0 -0
- {papers_cli-2.7 → papers_cli-2.7.2}/tests/test_undo.py +0 -0
|
@@ -103,6 +103,14 @@ def _backup_bib(biblio, config, message=None):
|
|
|
103
103
|
config.gitcmd(f"checkout -B main")
|
|
104
104
|
config.gitcmd(f"clean -f")
|
|
105
105
|
|
|
106
|
+
def _silent_backup_bib(biblio, config, level=logging.WARNING, *args, **kwargs):
|
|
107
|
+
" this is useful when passing --info to avoid having too many outputs"
|
|
108
|
+
level0 = logger.getEffectiveLevel()
|
|
109
|
+
if level0 > logging.DEBUG: # if DEBUG, also show back debug logs
|
|
110
|
+
logger.setLevel(level)
|
|
111
|
+
_backup_bib(biblio, config, *args, **kwargs)
|
|
112
|
+
logger.setLevel(level0)
|
|
113
|
+
|
|
106
114
|
|
|
107
115
|
def _restore_from_backupdir(config, restore_files=False):
|
|
108
116
|
restore_cmd = f"papers add {config.backupfile_clean} --rename --copy" if config.backup_files else f"cp {config.backupfile} {config.bibtex}"
|
|
@@ -218,7 +226,7 @@ def savebib(biblio, config):
|
|
|
218
226
|
if biblio is not None:
|
|
219
227
|
biblio.save(config.bibtex)
|
|
220
228
|
if config.file and config.git:
|
|
221
|
-
|
|
229
|
+
_silent_backup_bib(biblio, config)
|
|
222
230
|
else:
|
|
223
231
|
logger.debug(f'do not backup bib: {config.file}, {config.git}')
|
|
224
232
|
# if config.git:
|
|
@@ -285,7 +285,6 @@ class Biblio:
|
|
|
285
285
|
# additional checks on DOI etc...
|
|
286
286
|
if check_duplicate:
|
|
287
287
|
logger.debug('check duplicates : TRUE')
|
|
288
|
-
print("entering...")
|
|
289
288
|
return self.insert_entry_check(entry, update_key=update_key, rename=rename, copy=copy, **checkopt)
|
|
290
289
|
else:
|
|
291
290
|
logger.debug('check duplicates : FALSE')
|
|
@@ -580,9 +580,7 @@ def conflict_resolution_on_insert(old, new, mode='i'):
|
|
|
580
580
|
(E)dit split (not a duplicate)
|
|
581
581
|
(s)kip
|
|
582
582
|
(a)ppend anyway
|
|
583
|
-
(r)aise'''.strip()
|
|
584
|
-
.replace('(u)','('+_colordiffline('u','+')+')') # green lines will be added
|
|
585
|
-
.replace('(o)','('+_colordiffline('o','-')+')') + bcolors.ENDC
|
|
583
|
+
(r)aise'''.strip() + bcolors.ENDC
|
|
586
584
|
)
|
|
587
585
|
# .replace('(s)','('+_colordiffline('s','-')+')'))
|
|
588
586
|
choices = list('uUoeEsar')
|
|
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
|
|
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
|