From db737cb94378cab8622649c522a8be99db61a89b Mon Sep 17 00:00:00 2001 From: Maciej Kwiek Date: Thu, 8 Oct 2015 16:49:37 +0200 Subject: [PATCH] Fix hacking 0.10 errors in shotgun Change-Id: I6db506606b978850cfda016573a4dec286f29e95 Partial-Bug: #1410810 --- shotgun/cli.py | 3 +-- shotgun/driver.py | 12 +++++++++--- shotgun/logger.py | 3 +-- shotgun/utils.py | 8 ++++++-- tox.ini | 2 +- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/shotgun/cli.py b/shotgun/cli.py index 14de225..60ed4ba 100644 --- a/shotgun/cli.py +++ b/shotgun/cli.py @@ -67,6 +67,5 @@ def make_snapshot(args): def main(): - """Entry point - """ + """Entry point""" make_snapshot(parse_args()) diff --git a/shotgun/driver.py b/shotgun/driver.py index d9c1886..b83e086 100644 --- a/shotgun/driver.py +++ b/shotgun/driver.py @@ -106,7 +106,9 @@ class Driver(object): return out def get(self, path, target_path): - """target_path must be the directory where to put + """Get remote or local file + + target_path must be the directory where to put copied files or directories """ try: @@ -150,7 +152,9 @@ class File(Driver): logger.debug("File to save: %s", self.target_path) def snapshot(self): - """Example: + """Make a snapshot + + Example: self.conf.target IS /target self.host IS host.domain.tld self.path IS /var/log/somedir @@ -200,7 +204,9 @@ class Subs(File): sedscript.close() def snapshot(self): - """Example: + """Make a snapshot + + Example: self.conf.target IS /target self.host IS host.domain.tld self.path IS /var/log/somedir (it can be /var/log/somedir*) diff --git a/shotgun/logger.py b/shotgun/logger.py index dbcc6d4..6f43bd3 100644 --- a/shotgun/logger.py +++ b/shotgun/logger.py @@ -18,8 +18,7 @@ from shotgun.settings import LOG_FILE def configure_logger(): - """Configures shotgun logger - """ + """Configures shotgun logger""" logger = logging.getLogger('shotgun') logger.setLevel(logging.DEBUG) formatter = logging.Formatter( diff --git a/shotgun/utils.py b/shotgun/utils.py index b117756..2b8dde7 100644 --- a/shotgun/utils.py +++ b/shotgun/utils.py @@ -52,7 +52,8 @@ def iterfiles(path): def remove(full_dst_path, excludes): - """Removes subdirs/files using unixs syntax. + """Removes subdirs/files using unixs syntax + full_dst_path is treated as root directory for remove :param full_dst_path: str @@ -66,6 +67,7 @@ def remove(full_dst_path, excludes): def compress(target, level, keep_target=False): """Runs compression of provided directory + :param target: directory to compress :param level: level of compression :param keep_target: bool, if True target directory wont be removed @@ -126,7 +128,9 @@ class CCStringIO(StringIO): """ def __init__(self, buffer='', writers=None): - """If ``writers`` is given and is a file-like object or an + """CCStringIO initializator + + If ``writers`` is given and is a file-like object or an iterable of same, it/they will be written to whenever this StringIO instance is written to. """ diff --git a/tox.ini b/tox.ini index 911be0b..8344def 100644 --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,7 @@ commands = downloadcache = ~/cache/pip [testenv:pep8] -deps = hacking==0.7 +deps = hacking==0.10 usedevelop = False commands = flake8 {posargs:shotgun}