Change :returns: in docstrings to :return:

This commit is contained in:
Eric Torres 2019-04-24 13:33:41 -07:00
parent 91996e3d96
commit 09228b0aa1
5 changed files with 22 additions and 22 deletions

View File

@ -34,7 +34,7 @@ def get_files_by_suffix(suffix):
:param suffix: the suffix to search for :param suffix: the suffix to search for
:type suffix: str :type suffix: str
:returns: paths pointing to include files :return: paths pointing to include files
:rtype: generator of path-like objects :rtype: generator of path-like objects
""" """
yield from CONFIG_DIR.glob(f"*{suffix}") yield from CONFIG_DIR.glob(f"*{suffix}")
@ -50,7 +50,7 @@ def load_list_from_option(parser, *, section="", option="", fallback=None):
:type section: str :type section: str
:param option: the option value inside the specified section :param option: the option value inside the specified section
:type option: str :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 :param fallback: the fallback value to return if the option is empty
:type fallback: list :type fallback: list
:rtype: list :rtype: list
@ -73,7 +73,7 @@ def merge_files(files):
:param files: files including paths to read from :param files: files including paths to read from
:type files: iterable of path-like objects :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 :rtype: path-like object
""" """
include_lines = [] include_lines = []
@ -124,7 +124,7 @@ def parse_configfile():
"""Parse the main backup config file and return """Parse the main backup config file and return
a ``configparser.ConfigParser`` object. a ``configparser.ConfigParser`` object.
:returns: object used to parse config file :return: object used to parse config file
:rtype: ConfigParser object :rtype: ConfigParser object
:raises FileNotFoundError: if path does not exist :raises FileNotFoundError: if path does not exist
""" """

View File

@ -67,7 +67,7 @@ class PackageManager:
This method only creates the lockfile if it was configured. This method only creates the lockfile if it was configured.
:returns: self :return: self
:rtype: ``PackageManager`` object :rtype: ``PackageManager`` object
:raises FileExistsError: if lockfile exists when this method is called :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 it is to be assumed that no file was created, therefore there
is no file to cleanup. is no file to cleanup.
:returns: path to temporary file :return: path to temporary file
:rtype: path-like object :rtype: path-like object
:raises NotImplementedError: if package list generation command is not present :raises NotImplementedError: if package list generation command is not present
""" """
@ -115,7 +115,7 @@ class PackageManager:
:param compress: compression mode :param compress: compression mode
:type compress: str :type compress: str
:returns: the path to the created file :return: the path to the created file
:rtype: path-like object :rtype: path-like object
:raises ValueError: if compress is not in packagemanager.VALID_DB_COMPRESS_MODES :raises ValueError: if compress is not in packagemanager.VALID_DB_COMPRESS_MODES
:raises NotImplementedError: if database path is not present :raises NotImplementedError: if database path is not present
@ -144,7 +144,7 @@ class PackageManager:
@property @property
def cache_directory(self): 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 :rtype: path-like object or None
""" """
return self._cachedir return self._cachedir
@ -152,7 +152,7 @@ class PackageManager:
@property @property
def database_path(self): 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 :rtype: path-like object or None
""" """
return self._db_path return self._db_path
@ -160,7 +160,7 @@ class PackageManager:
@property @property
def lockfile(self): 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 :rtype: path-like object or None
""" """
return self._lockfile return self._lockfile
@ -168,7 +168,7 @@ class PackageManager:
@property @property
def pkglist_cmd(self): 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 :rtype: iterable, str or None
""" """
return self._pkglist_cmd return self._pkglist_cmd

View File

@ -76,7 +76,7 @@ class Hierarchy(PathLike):
@property @property
def path(self): def path(self):
""" """
:returns: the base directory of this hierarchy :return: the base directory of this hierarchy
:rtype: path-like object :rtype: path-like object
""" """
return self._path return self._path
@ -84,7 +84,7 @@ class Hierarchy(PathLike):
@property @property
def name(self): def name(self):
""" """
:returns: the name of this hierarchy. :return: the name of this hierarchy.
:rtype: str :rtype: str
""" """
return self._name return self._name
@ -92,7 +92,7 @@ class Hierarchy(PathLike):
@property @property
def metadata_path(self): 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 :rtype: path-like object
""" """
return self._metadata_path return self._metadata_path

View File

@ -96,7 +96,7 @@ class Repository(Hierarchy):
def __contains__(self, name): def __contains__(self, name):
"""Check membership of a Snapshot in this Repository by 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 :type name: str
:rtype: bool :rtype: bool
""" """
@ -156,7 +156,7 @@ class Repository(Hierarchy):
:param name: name to validate :param name: name to validate
:type name: str :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 :rtype: bool
""" """
return bool(re.match(VALID_SNAPSHOT_NAME, name)) return bool(re.match(VALID_SNAPSHOT_NAME, name))
@ -179,7 +179,7 @@ class Repository(Hierarchy):
@property @property
def snapshot_dir(self): def snapshot_dir(self):
""" """
:returns: the directory in this Repository in which snapshots :return: the directory in this Repository in which snapshots
are stored. are stored.
:rtype: path-like object :rtype: path-like object
""" """
@ -196,7 +196,7 @@ class Repository(Hierarchy):
@property @property
def snapshots(self): def snapshots(self):
""" """
:returns: all snapshots stored in this repository :return: all snapshots stored in this repository
:rtype: list of Snapshot objects :rtype: list of Snapshot objects
""" """
return self._snapshots return self._snapshots
@ -204,7 +204,7 @@ class Repository(Hierarchy):
@property @property
def empty(self): 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 False otherwise
:rtype: bool :rtype: bool
""" """
@ -266,7 +266,7 @@ class Repository(Hierarchy):
:param name: the name of the snapshot :param name: the name of the snapshot
:type name: str :type name: str
:returns: Snapshot object :return: Snapshot object
:raises ValueError: if name is an invalid value :raises ValueError: if name is an invalid value
""" """
syslog.debug("Creating snapshot") syslog.debug("Creating snapshot")

View File

@ -46,7 +46,7 @@ class Snapshot(Hierarchy):
@property @property
def ctime(self): def ctime(self):
""" """
:returns: this Snapshot's creation time :return: this Snapshot's creation time
:rtype: str :rtype: str
""" """
return self._ctime return self._ctime
@ -54,7 +54,7 @@ class Snapshot(Hierarchy):
@property @property
def pkg_dir(self): 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 :rtype: path-like object
""" """
return self._pkg_dir return self._pkg_dir