From 14c55a6646aeefd12a1fbb2b0bf538867bd39f92 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 6 Feb 2018 11:42:43 +0100 Subject: [PATCH] Applying flake8 rules to pp_lib/pidfile.py --- pp_lib/pidfile.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pp_lib/pidfile.py b/pp_lib/pidfile.py index ab6432a..e9ce29c 100644 --- a/pp_lib/pidfile.py +++ b/pp_lib/pidfile.py @@ -25,14 +25,14 @@ from six import reraise # Own modules -from .errors import ReadTimeoutError +from .error import ReadTimeoutError from .obj import PpBaseObjectError from .obj import PpBaseObject from .common import to_utf8 -__version__ = '0.2.3' +__version__ = '0.2.4' LOG = logging.getLogger(__name__) @@ -168,7 +168,7 @@ class PidFile(PpBaseObject): ) if not filename: - raise ValueError(_('No filename given on initializing PidFile object.')) + raise ValueError('No filename given on initializing PidFile object.') self._filename = os.path.abspath(str(filename)) """ @@ -421,7 +421,7 @@ class PidFile(PpBaseObject): @raise InvalidPidFileError: if the pidfile is unusable @raise PidFileInUseError: if the pidfile is in use by another application - @raise PbReadTimeoutError: on timeout reading an existing pidfile + @raise ReadTimeoutError: on timeout reading an existing pidfile @raise OSError: on some other reasons, why the existing pidfile couldn't be read @@ -433,13 +433,16 @@ class PidFile(PpBaseObject): if not os.path.exists(self.filename): if not os.path.exists(self.parent_dir): - reason = "Pidfile parent directory {!r} doesn't exists.".format(self.parent_dir) + reason = "Pidfile parent directory {!r} doesn't exists.".format( + self.parent_dir) raise InvalidPidFileError(self.filename, reason) if not os.path.isdir(self.parent_dir): - reason = "Pidfile parent directory {!r} is not a directory.".format(self.parent_dir) + reason = "Pidfile parent directory {!r} is not a directory.".format( + self.parent_dir) raise InvalidPidFileError(self.filename, reason) if not os.access(self.parent_dir, os.X_OK): - reason = "No write access to pidfile parent directory {!r}.".format(self.parent_dir) + reason = "No write access to pidfile parent directory {!r}.".format( + self.parent_dir) raise InvalidPidFileError(self.filename, reason) return False @@ -459,7 +462,7 @@ class PidFile(PpBaseObject): @type sigframe: object """ - return PbReadTimeoutError(self.timeout, self.filename) + return ReadTimeoutError(self.timeout, self.filename) if self.verbose > 1: LOG.debug("Reading content of pidfile {!r} ...".format(self.filename)) -- 2.39.5