Convert docstrings to reStructuredText
This commit also includes: - whitespace / code formatting fixes - slight syntax related changes: except <exception_name>, e -> except <exception_name> as e - 3 pointless instructions instances have been rewritten [sorted] (spotted by semi-automatic check) The unrelated changes shouldn't have any real impact on whipper's behaviour.
This commit is contained in:
@@ -25,9 +25,7 @@ class LoggableMultiSeparateTask(task.MultiSeparateTask):
|
||||
|
||||
|
||||
class PopenTask(task.Task):
|
||||
"""
|
||||
I am a task that runs a command using Popen.
|
||||
"""
|
||||
"""I am a task that runs a command using Popen."""
|
||||
|
||||
logCategory = 'PopenTask'
|
||||
bufsize = 1024
|
||||
@@ -44,7 +42,7 @@ class PopenTask(task.Task):
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
close_fds=True, cwd=self.cwd)
|
||||
except OSError, e:
|
||||
except OSError as e:
|
||||
import errno
|
||||
if e.errno == errno.ENOENT:
|
||||
self.commandMissing()
|
||||
@@ -88,7 +86,7 @@ class PopenTask(task.Task):
|
||||
return
|
||||
|
||||
self._done()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
logger.debug('exception during _read(): %r', str(e))
|
||||
self.setException(e)
|
||||
self.stop()
|
||||
@@ -118,31 +116,29 @@ class PopenTask(task.Task):
|
||||
# self.stop()
|
||||
|
||||
def readbytesout(self, bytes):
|
||||
"""
|
||||
Called when bytes have been read from stdout.
|
||||
"""Call when bytes have been read from stdout.
|
||||
|
||||
:param bytes:
|
||||
:type bytes:
|
||||
"""
|
||||
pass
|
||||
|
||||
def readbyteserr(self, bytes):
|
||||
"""
|
||||
Called when bytes have been read from stderr.
|
||||
"""Call when bytes have been read from stderr.
|
||||
|
||||
:param bytes:
|
||||
:type bytes:
|
||||
"""
|
||||
pass
|
||||
|
||||
def done(self):
|
||||
"""
|
||||
Called when the command completed successfully.
|
||||
"""
|
||||
"""Call when the command completed successfully."""
|
||||
pass
|
||||
|
||||
def failed(self):
|
||||
"""
|
||||
Called when the command failed.
|
||||
"""
|
||||
"""Call when the command failed."""
|
||||
pass
|
||||
|
||||
def commandMissing(self):
|
||||
"""
|
||||
Called when the command is missing.
|
||||
"""
|
||||
"""Call when the command is missing."""
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user