docstrings everywhere

This commit is contained in:
2021-03-15 02:21:41 +03:00
parent 67b97a64ea
commit d3e79120cb
34 changed files with 980 additions and 127 deletions

View File

@ -23,13 +23,26 @@ from ahriman.core.util import check_output
class Rsync(Uploader):
'''
rsync wrapper
:ivar remote: remote address to sync
'''
def __init__(self, architecture: str, config: Configuration) -> None:
'''
default constructor
:param architecture: repository architecture
:param config: configuration instance
'''
Uploader.__init__(self, architecture, config)
section = config.get_section_name('rsync', architecture)
self.remote = config.get(section, 'remote')
def sync(self, path: str) -> None:
'''
sync data to remote server
:param path: local path to sync
'''
check_output('rsync', '--archive', '--verbose', '--compress', '--partial', '--progress', '--delete', path, self.remote,
exception=None,
logger=self.logger)