adsfolio.gui.export_dialog
One window that exports library papers as BibTeX, citation text, or a list.
- class adsfolio.gui.export_dialog.AdsBibtexFetch(bibcodes, parent=None)[source]
Bases:
PySide6.QtCore.QThreadFetch ADS’s own BibTeX for papers in a worker thread.
The thread only talks to ADS. The window saves the result in the catalog, because a catalog connection belongs to the thread that opened it.
- Parameters:
bibcodes (Sequence[str])
parent (Any)
- fetched
- progressed
- staticMetaObject = PySide6.QtCore.QMetaObject("AdsBibtexFetch" inherits "QThread": Methods: #12 type=Signal, signature=progressed(int,int), parameters=int, int #13 type=Signal, signature=fetched(PyObject,PyObject), parameters=PyObject, PyObject )
- class adsfolio.gui.export_dialog.ExportPapersDialog(parent, scopes, catalog, citation_styles, *, initial_scope='selected', initial_format='bibtex', browser_command=None, show_unidentified=None, exclude_fields=('abstract', 'adsnote'))[source]
Bases:
PySide6.QtWidgets.QDialogChoose papers, a format, and its settings, then copy or save the text.
- Parameters:
parent (QWidget or None) – Parent widget.
scopes (Sequence[ExportScope]) – Paper choices. The first scope whose key equals initial_scope starts selected.
catalog (object) – Central PdfCatalog that holds the papers.
citation_styles (Sequence[CitationStyle]) – Custom citation styles for the citation text format.
initial_scope (str, optional) – Key of the scope to select first.
initial_format (str, optional) – Format key to select first.
browser_command (str or None, optional) – Browser command for links in the list preview.
show_unidentified (Callable[[], None] or None, optional) – Show the PDFs that need identification in the main window.
exclude_fields (Sequence[str], optional) – BibTeX fields to leave out at first, by default the abstract and the ADS note.
- done(result)[source]
Keep the list settings when the window closes.
- Parameters:
result (int)
- Return type:
None
- key_policy()[source]
Return the chosen key styles.
- Raises:
ValueError – If the key template is not valid.
- Return type:
- render(papers, *, preview=False)[source]
Return the exported text for papers in the current format.
- Raises:
CitationKeyError – When BibTeX keys are missing or shared and preview is true.
ValueError, sqlite3.Error – When the settings or catalog cannot produce the text.
- Parameters:
papers (collections.abc.Sequence[collections.abc.Mapping[str, Any]])
preview (bool)
- Return type:
- staticMetaObject = PySide6.QtCore.QMetaObject("ExportPapersDialog" inherits "QDialog": )
- class adsfolio.gui.export_dialog.ExportScope(key, label, records)[source]
Bases:
objectOne choice of papers for the export.
key is a stable name, for example
"selected"or"all". label is the text of the choice, without the count. records holds library table records in export order.- Parameters:
key (str)
label (str)
records (collections.abc.Sequence[collections.abc.Mapping[str, Any]])
- records: collections.abc.Sequence[collections.abc.Mapping[str, Any]]
- class adsfolio.gui.export_dialog.PaperSummary(papers, ads_papers, other_papers, skipped, shared_pdfs)[source]
Bases:
objectPapers that an export writes, and PDFs that it skips.
papers holds one record for each distinct catalog paper, in export order. ads_papers counts papers with an ADS bibcode, and other_papers counts the rest, for example papers from Crossref or DataCite. skipped holds PDFs without paper details, which do not export. shared_pdfs counts PDFs whose paper an earlier PDF already supplies.
- Parameters:
- papers: tuple[collections.abc.Mapping[str, Any], ...]
- skipped: tuple[collections.abc.Mapping[str, Any], ...]
- class adsfolio.gui.export_dialog.SkippedPdfsDialog(parent, records, show_unidentified)[source]
Bases:
PySide6.QtWidgets.QDialogList the PDFs that an export skips because they have no paper details.
- Parameters:
- staticMetaObject = PySide6.QtCore.QMetaObject("SkippedPdfsDialog" inherits "QDialog": )
- adsfolio.gui.export_dialog.summarize_papers(records)[source]
Split table records into exported papers and skipped PDFs.
A record exports when it has a catalog paper (a document ID). Several PDFs of one paper export once, through the first of them.
- Parameters:
records (collections.abc.Sequence[collections.abc.Mapping[str, Any]])
- Return type: