Refactor extract function to take citekeys not papers

This commit is contained in:
Marty Oehme 2022-12-22 19:39:14 +01:00
parent ef24e544fc
commit 80b615651c
Signed by: Marty
GPG key ID: 73BA40D5AFAF49C9

View file

@ -75,15 +75,15 @@ class ExtractPlugin(PapersPlugin):
) )
if not citekeys: if not citekeys:
return return
papers = self._gather_papers(citekeys) all_annotations = self.extract(citekeys)
all_annotations = self.extract(papers)
if args.write: if args.write:
self._to_notes(conf, all_annotations, args.edit) self._to_notes(conf, all_annotations, args.edit)
else: else:
self._to_stdout(all_annotations) self._to_stdout(all_annotations)
self.repository.close() self.repository.close()
def extract(self, papers): def extract(self, citekeys):
papers = self._gather_papers(citekeys)
papers_annotated = [] papers_annotated = []
for paper in papers: for paper in papers:
file = self._get_file(paper) file = self._get_file(paper)