]> Frank Brehm's Git Trees - pixelpark/admin-tools.git/commitdiff
Applying flake8 rules to pp_lib/pidfile.py
authorFrank Brehm <frank.brehm@pixelpark.com>
Tue, 6 Feb 2018 10:42:43 +0000 (11:42 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Tue, 6 Feb 2018 10:42:43 +0000 (11:42 +0100)
pp_lib/pidfile.py

index ab6432aa31c26a98428c7ec3942ba74bc2178fdc..e9ce29c108c5a53b0ab75b1365809df1d68d5246 100644 (file)
@@ -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))