Change :returns: in docstrings to :return:
This commit is contained in:
parent
91996e3d96
commit
09228b0aa1
@ -34,7 +34,7 @@ def get_files_by_suffix(suffix):
|
||||
|
||||
:param suffix: the suffix to search for
|
||||
:type suffix: str
|
||||
:returns: paths pointing to include files
|
||||
:return: paths pointing to include files
|
||||
:rtype: generator of path-like objects
|
||||
"""
|
||||
yield from CONFIG_DIR.glob(f"*{suffix}")
|
||||
@ -50,7 +50,7 @@ def load_list_from_option(parser, *, section="", option="", fallback=None):
|
||||
:type section: str
|
||||
:param option: the option value inside the specified section
|
||||
:type option: str
|
||||
:returns: the list parsed by JSON
|
||||
:return: the list parsed by JSON
|
||||
:param fallback: the fallback value to return if the option is empty
|
||||
:type fallback: list
|
||||
:rtype: list
|
||||
@ -73,7 +73,7 @@ def merge_files(files):
|
||||
|
||||
:param files: files including paths to read from
|
||||
:type files: iterable of path-like objects
|
||||
:returns: path to file that lists include paths
|
||||
:return: path to file that lists include paths
|
||||
:rtype: path-like object
|
||||
"""
|
||||
include_lines = []
|
||||
@ -124,7 +124,7 @@ def parse_configfile():
|
||||
"""Parse the main backup config file and return
|
||||
a ``configparser.ConfigParser`` object.
|
||||
|
||||
:returns: object used to parse config file
|
||||
:return: object used to parse config file
|
||||
:rtype: ConfigParser object
|
||||
:raises FileNotFoundError: if path does not exist
|
||||
"""
|
||||
|
@ -67,7 +67,7 @@ class PackageManager:
|
||||
|
||||
This method only creates the lockfile if it was configured.
|
||||
|
||||
:returns: self
|
||||
:return: self
|
||||
:rtype: ``PackageManager`` object
|
||||
:raises FileExistsError: if lockfile exists when this method is called
|
||||
"""
|
||||
@ -90,7 +90,7 @@ class PackageManager:
|
||||
it is to be assumed that no file was created, therefore there
|
||||
is no file to cleanup.
|
||||
|
||||
:returns: path to temporary file
|
||||
:return: path to temporary file
|
||||
:rtype: path-like object
|
||||
:raises NotImplementedError: if package list generation command is not present
|
||||
"""
|
||||
@ -115,7 +115,7 @@ class PackageManager:
|
||||
|
||||
:param compress: compression mode
|
||||
:type compress: str
|
||||
:returns: the path to the created file
|
||||
:return: the path to the created file
|
||||
:rtype: path-like object
|
||||
:raises ValueError: if compress is not in packagemanager.VALID_DB_COMPRESS_MODES
|
||||
:raises NotImplementedError: if database path is not present
|
||||
@ -144,7 +144,7 @@ class PackageManager:
|
||||
@property
|
||||
def cache_directory(self):
|
||||
"""
|
||||
:returns: the cache directory of this package manager
|
||||
:return: the cache directory of this package manager
|
||||
:rtype: path-like object or None
|
||||
"""
|
||||
return self._cachedir
|
||||
@ -152,7 +152,7 @@ class PackageManager:
|
||||
@property
|
||||
def database_path(self):
|
||||
"""
|
||||
:returns: the database path of this package manager
|
||||
:return: the database path of this package manager
|
||||
:rtype: path-like object or None
|
||||
"""
|
||||
return self._db_path
|
||||
@ -160,7 +160,7 @@ class PackageManager:
|
||||
@property
|
||||
def lockfile(self):
|
||||
"""
|
||||
:returns: the lockfile path of this package manager
|
||||
:return: the lockfile path of this package manager
|
||||
:rtype: path-like object or None
|
||||
"""
|
||||
return self._lockfile
|
||||
@ -168,7 +168,7 @@ class PackageManager:
|
||||
@property
|
||||
def pkglist_cmd(self):
|
||||
"""
|
||||
:returns: the package listing command of this package manager
|
||||
:return: the package listing command of this package manager
|
||||
:rtype: iterable, str or None
|
||||
"""
|
||||
return self._pkglist_cmd
|
||||
|
@ -76,7 +76,7 @@ class Hierarchy(PathLike):
|
||||
@property
|
||||
def path(self):
|
||||
"""
|
||||
:returns: the base directory of this hierarchy
|
||||
:return: the base directory of this hierarchy
|
||||
:rtype: path-like object
|
||||
"""
|
||||
return self._path
|
||||
@ -84,7 +84,7 @@ class Hierarchy(PathLike):
|
||||
@property
|
||||
def name(self):
|
||||
"""
|
||||
:returns: the name of this hierarchy.
|
||||
:return: the name of this hierarchy.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._name
|
||||
@ -92,7 +92,7 @@ class Hierarchy(PathLike):
|
||||
@property
|
||||
def metadata_path(self):
|
||||
"""
|
||||
:returns: the path of this hierarchy's metadata file.
|
||||
:return: the path of this hierarchy's metadata file.
|
||||
:rtype: path-like object
|
||||
"""
|
||||
return self._metadata_path
|
||||
|
@ -96,7 +96,7 @@ class Repository(Hierarchy):
|
||||
def __contains__(self, name):
|
||||
"""Check membership of a Snapshot in this Repository by name.
|
||||
|
||||
:returns: True if name is the name of a Snapshot in this Repository
|
||||
:return: True if name is the name of a Snapshot in this Repository
|
||||
:type name: str
|
||||
:rtype: bool
|
||||
"""
|
||||
@ -156,7 +156,7 @@ class Repository(Hierarchy):
|
||||
|
||||
:param name: name to validate
|
||||
:type name: str
|
||||
:returns: true if this name is deemed valid, otherwise False
|
||||
:return: true if this name is deemed valid, otherwise False
|
||||
:rtype: bool
|
||||
"""
|
||||
return bool(re.match(VALID_SNAPSHOT_NAME, name))
|
||||
@ -179,7 +179,7 @@ class Repository(Hierarchy):
|
||||
@property
|
||||
def snapshot_dir(self):
|
||||
"""
|
||||
:returns: the directory in this Repository in which snapshots
|
||||
:return: the directory in this Repository in which snapshots
|
||||
are stored.
|
||||
:rtype: path-like object
|
||||
"""
|
||||
@ -196,7 +196,7 @@ class Repository(Hierarchy):
|
||||
@property
|
||||
def snapshots(self):
|
||||
"""
|
||||
:returns: all snapshots stored in this repository
|
||||
:return: all snapshots stored in this repository
|
||||
:rtype: list of Snapshot objects
|
||||
"""
|
||||
return self._snapshots
|
||||
@ -204,7 +204,7 @@ class Repository(Hierarchy):
|
||||
@property
|
||||
def empty(self):
|
||||
"""
|
||||
:returns: True if there are no Snapshots in this Repository,
|
||||
:return: True if there are no Snapshots in this Repository,
|
||||
False otherwise
|
||||
:rtype: bool
|
||||
"""
|
||||
@ -266,7 +266,7 @@ class Repository(Hierarchy):
|
||||
|
||||
:param name: the name of the snapshot
|
||||
:type name: str
|
||||
:returns: Snapshot object
|
||||
:return: Snapshot object
|
||||
:raises ValueError: if name is an invalid value
|
||||
"""
|
||||
syslog.debug("Creating snapshot")
|
||||
|
@ -46,7 +46,7 @@ class Snapshot(Hierarchy):
|
||||
@property
|
||||
def ctime(self):
|
||||
"""
|
||||
:returns: this Snapshot's creation time
|
||||
:return: this Snapshot's creation time
|
||||
:rtype: str
|
||||
"""
|
||||
return self._ctime
|
||||
@ -54,7 +54,7 @@ class Snapshot(Hierarchy):
|
||||
@property
|
||||
def pkg_dir(self):
|
||||
"""
|
||||
:returns: the package manager backup directory of this snapshot.
|
||||
:return: the package manager backup directory of this snapshot.
|
||||
:rtype: path-like object
|
||||
"""
|
||||
return self._pkg_dir
|
||||
|
Loading…
x
Reference in New Issue
Block a user