From 76ea698a141a8f8ad388bb262f347ec4a10b923c Mon Sep 17 00:00:00 2001 From: ZeroCommits <37379471+ZeroCommits@users.noreply.github.com> Date: Fri, 1 Jul 2022 23:59:29 +0800 Subject: [PATCH 1/4] 1. Include abstract and DOI when exporting bibtex file. 2. Using utf-8 encoding fixes encoding errors on a Windows 10, Python 3 setup. --- findpapers/tools/bibtex_generator_tool.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/findpapers/tools/bibtex_generator_tool.py b/findpapers/tools/bibtex_generator_tool.py index a3022ba..3a62bee 100644 --- a/findpapers/tools/bibtex_generator_tool.py +++ b/findpapers/tools/bibtex_generator_tool.py @@ -101,6 +101,12 @@ def generate_bibtex(search_path: str, outputpath: str, only_selected_papers: Opt if paper.publication_date is not None: bibtex_output += f'{default_tab}year = {{{paper.publication_date.year}}},\n' + if paper.doi is not None: + bibtex_output += f'{default_tab}doi = {{{paper.doi}}},\n' + + if paper.abstract is not None: + bibtex_output += f'{default_tab}abstract = {{{paper.abstract}}},\n' + if paper.pages is not None: bibtex_output += f'{default_tab}pages = {{{paper.pages}}},\n' @@ -112,5 +118,5 @@ def generate_bibtex(search_path: str, outputpath: str, only_selected_papers: Opt except Exception as e: logging.debug(e, exc_info=True) - with open(outputpath, 'w') as fp: - fp.write(bibtex_output) + with open(outputpath, 'w', encoding='utf-8') as fp: + fp.write(bibtex_output) \ No newline at end of file From fea8450f262108109aa7dc53aad6962141f17fef Mon Sep 17 00:00:00 2001 From: ZeroCommits <37379471+ZeroCommits@users.noreply.github.com> Date: Thu, 15 Sep 2022 19:13:24 +0800 Subject: [PATCH 2/4] Add edlib dependency. --- .gitmodules | 4 ++++ packages/edlib | 1 + 2 files changed, 5 insertions(+) create mode 100644 .gitmodules create mode 160000 packages/edlib diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..d3e7179 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "packages/edlib"] + path = packages/edlib + url = https://github.com/Martinsos/edlib.git + branch = master diff --git a/packages/edlib b/packages/edlib new file mode 160000 index 0000000..ce008ea --- /dev/null +++ b/packages/edlib @@ -0,0 +1 @@ +Subproject commit ce008ea6c2c3d8c40a7a85e668f8fb75127d454a From 8e18d37b19e292154e40518c59609d4aec26310b Mon Sep 17 00:00:00 2001 From: ZeroCommits <37379471+ZeroCommits@users.noreply.github.com> Date: Fri, 16 Sep 2022 11:03:48 +0800 Subject: [PATCH 3/4] Revert "Add edlib dependency." This reverts commit fea8450f262108109aa7dc53aad6962141f17fef. --- .gitmodules | 4 ---- packages/edlib | 1 - 2 files changed, 5 deletions(-) delete mode 100644 .gitmodules delete mode 160000 packages/edlib diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index d3e7179..0000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "packages/edlib"] - path = packages/edlib - url = https://github.com/Martinsos/edlib.git - branch = master diff --git a/packages/edlib b/packages/edlib deleted file mode 160000 index ce008ea..0000000 --- a/packages/edlib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ce008ea6c2c3d8c40a7a85e668f8fb75127d454a From 118f77d5a2be6648789f9ca24f8f26f316a1f726 Mon Sep 17 00:00:00 2001 From: ZeroCommits <37379471+ZeroCommits@users.noreply.github.com> Date: Sat, 17 Sep 2022 16:14:51 +0800 Subject: [PATCH 4/4] 09/17/2022 Disable importlib metadata check. This module is used as a relative import in the main package. --- findpapers/__init__.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/findpapers/__init__.py b/findpapers/__init__.py index 59d0d80..c699748 100644 --- a/findpapers/__init__.py +++ b/findpapers/__init__.py @@ -6,9 +6,10 @@ from findpapers.tools.refiner_tool import refine from findpapers.tools.downloader_tool import download -try: - import importlib.metadata as importlib_metadata -except ModuleNotFoundError: - import importlib_metadata - -__version__ = importlib_metadata.version(__name__) +## 09/17/2022 Disable importlib metadata check. This module is used as a relative import in the main package. +## try: +## import importlib.metadata as importlib_metadata +## except ModuleNotFoundError: +## import importlib_metadata +## +## __version__ = importlib_metadata.version(__name__)