Skip to content
Snippets Groups Projects
Commit 282e7f19 authored by vlorentz's avatar vlorentz
Browse files

Fix various Sphinx warnings

parent 134c828e
No related branches found
No related tags found
1 merge request!210Fix various Sphinx warnings
.. _swh-loader-core:
Software Heritage - Loader foundations
======================================
......
.. _swh-loader-core:
.. include:: README.rst
.. toctree::
......@@ -16,3 +18,4 @@ Reference Documentation
cli
/apidoc/swh.loader.core
/apidoc/swh.loader.package
......@@ -71,7 +71,7 @@ Create a file named ``loader.py`` in your package's directory, with two empty cl
We now have to fill some of the methods declared by
:ref:class:`swh.loader.package.PackageLoader`: in your new ``NewLoader`` class.
:class:`swh.loader.package.PackageLoader`: in your new ``NewLoader`` class.
Listing versions
......@@ -599,7 +599,7 @@ a date of discovery (usually the time your loader ran).
This is done by adding them to the ``directory_extrinsic_metadata`` attribute of
your ``NewPackageInfo`` object when creating it in ``get_package_info``
as :py:cls:`swh.loader.package.loader.RawExtrinsicMetadataCore` objects::
as :class:`swh.loader.package.loader.RawExtrinsicMetadataCore` objects::
NewPackageInfo(
...,
......@@ -615,7 +615,7 @@ as :py:cls:`swh.loader.package.loader.RawExtrinsicMetadataCore` objects::
``format`` should be a human-readable ASCII string that unambiguously describes
the format. Readers of the metadata object will have a built-in list of formats
they understand, and will check if your metadata object is among them.
You should use one of the :ref:`known metadata formats <extrinsic-metadata-format>`
You should use one of the :ref:`known metadata formats <extrinsic-metadata-formats>`
if possible, or add yours to this list.
``metadata`` is the metadata object itself. When possible, it should be copied verbatim
......
......@@ -90,7 +90,7 @@ locally, then return them lazily on demand.
Incremental loading
------------------
-------------------
Loading a repository from scratch can be costly, so ``swh-storage`` provides
ways to remember what objects in the repository were already loaded,
......
......@@ -55,6 +55,11 @@ class BaseLoader:
"""
visit_date: Optional[datetime.datetime]
origin: Optional[Origin]
origin_metadata: Dict[str, Any]
loaded_snapshot_id: Optional[Sha1Git]
def __init__(
self,
storage: StorageInterface,
......@@ -77,14 +82,14 @@ class BaseLoader:
_log.setLevel(logging.WARN)
# possibly overridden in self.prepare method
self.visit_date: Optional[datetime.datetime] = None
self.origin: Optional[Origin] = None
self.visit_date = None
self.origin = None
if not hasattr(self, "visit_type"):
self.visit_type: Optional[str] = None
self.origin_metadata: Dict[str, Any] = {}
self.loaded_snapshot_id: Optional[Sha1Git] = None
self.origin_metadata = {}
self.loaded_snapshot_id = None
if save_data_path:
path = save_data_path
......
......@@ -18,9 +18,9 @@ def clean_dangling_folders(dirpath, pattern_check, log=None):
Args:
dirpath (str): Path to check for dangling files
pattern_check (str): A dedicated pattern to check on first
level directory (e.g `swh.loader.mercurial.`,
`swh.loader.svn.`)
log (Logger): Optional logger
level directory (e.g `swh.loader.mercurial.`,
`swh.loader.svn.`)
log (Logger): Optional logger
"""
if not os.path.exists(dirpath):
......
......@@ -75,7 +75,7 @@ of downloaded archive files."""
PartialExtID = Tuple[str, bytes]
"""The ``extid_type`` and ``extid`` fields of an :ref:py:`ExtID` object."""
"""The ``extid_type`` and ``extid`` fields of an :class:`ExtID` object."""
@attr.s
......@@ -170,7 +170,7 @@ class PackageLoader(BaseLoader, Generic[TPackageInfo]):
"""Return the list of all published package versions.
Raises:
`class:swh.loader.exception.NotFound` error when failing to read the
class:`swh.loader.exception.NotFound` error when failing to read the
published package versions.
Returns:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment