From 97c3f63f547e7cf88f2ff1c333c32f1e34b02c89 Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Mon, 15 Apr 2019 23:30:20 -0700 Subject: [PATCH] Docstring cleanups --- rbackup/plugins/packagemanager.py | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/rbackup/plugins/packagemanager.py b/rbackup/plugins/packagemanager.py index 4e19681..4a429b5 100644 --- a/rbackup/plugins/packagemanager.py +++ b/rbackup/plugins/packagemanager.py @@ -84,11 +84,9 @@ class PackageManager: it is to be assumed that no file was created, therefore there is no file to cleanup. - .. note:: This method is internal and is meant to be called from - a subclass in a separate module. - :returns: path to temporary file :rtype: path-like object + :raises NotImplementedError: if package list generation command is not present """ syslog.info("Creating a package list") @@ -109,14 +107,12 @@ class PackageManager: All arguments and keyword-only arguments are passed directly to the PackageManager object. - .. note:: This method is internal and is meant to be called from - a subclass in a separate module. - :param compress: compression mode :type compress: str :returns: 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 """ if compress is not None and compress not in VALID_DB_COMPRESS_MODES: raise ValueError(f"{compress} is not a valid compress mode") @@ -139,7 +135,7 @@ class PackageManager: @property def cache_directory(self): """ - :returns: the cache directory of this package manager. + :returns: the cache directory of this package manager :rtype: path-like object """ return self._cachedir @@ -147,7 +143,7 @@ class PackageManager: @property def database_path(self): """ - :returns: the database path of this package manager. + :returns: the database path of this package manager :rtype: path-like object """ return self._db_path @@ -163,14 +159,7 @@ class PackageManager: @property def pkglist_cmd(self): """ - :returns: the package listing command of this package manager. + :returns: the package listing command of this package manager :rtype: iterable or str """ return self._pkglist_cmd - - -# ========== Functions ========== -if __name__ == "__main__": - import doctest - - doctest.testmod()