summaryrefslogtreecommitdiff
path: root/test/py/u_boot_spawn.py
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2016-01-26 13:41:30 -0700
committerSimon Glass <sjg@chromium.org>2016-01-28 21:01:24 -0700
commite8debf394fbba594fcfc267c61f8c6bbca395b06 (patch)
tree4eb2bba3ccf9018ce50f992dc27486fbd6e12dce /test/py/u_boot_spawn.py
parent56382a81f38bed423791d7b80e95c1f65bd83b9b (diff)
downloadu-boot-imx-e8debf394fbba594fcfc267c61f8c6bbca395b06.zip
u-boot-imx-e8debf394fbba594fcfc267c61f8c6bbca395b06.tar.gz
u-boot-imx-e8debf394fbba594fcfc267c61f8c6bbca395b06.tar.bz2
test/py: use " for docstrings
Python's coding style docs indicate to use " not ' for docstrings. test/py has other violations of the coding style docs, since the docs specify a stranger style than I would expect, but nobody has complained about those yet:-) Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/py/u_boot_spawn.py')
-rw-r--r--test/py/u_boot_spawn.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/test/py/u_boot_spawn.py b/test/py/u_boot_spawn.py
index df4c675..d508075 100644
--- a/test/py/u_boot_spawn.py
+++ b/test/py/u_boot_spawn.py
@@ -12,23 +12,23 @@ import select
import time
class Timeout(Exception):
- '''An exception sub-class that indicates that a timeout occurred.'''
+ """An exception sub-class that indicates that a timeout occurred."""
pass
class Spawn(object):
- '''Represents the stdio of a freshly created sub-process. Commands may be
+ """Represents the stdio of a freshly created sub-process. Commands may be
sent to the process, and responses waited for.
- '''
+ """
def __init__(self, args):
- '''Spawn (fork/exec) the sub-process.
+ """Spawn (fork/exec) the sub-process.
Args:
args: array of processs arguments. argv[0] is the command to execute.
Returns:
Nothing.
- '''
+ """
self.waited = False
self.buf = ''
@@ -56,26 +56,26 @@ class Spawn(object):
self.poll.register(self.fd, select.POLLIN | select.POLLPRI | select.POLLERR | select.POLLHUP | select.POLLNVAL)
def kill(self, sig):
- '''Send unix signal "sig" to the child process.
+ """Send unix signal "sig" to the child process.
Args:
sig: The signal number to send.
Returns:
Nothing.
- '''
+ """
os.kill(self.pid, sig)
def isalive(self):
- '''Determine whether the child process is still running.
+ """Determine whether the child process is still running.
Args:
None.
Returns:
Boolean indicating whether process is alive.
- '''
+ """
if self.waited:
return False
@@ -88,19 +88,19 @@ class Spawn(object):
return False
def send(self, data):
- '''Send data to the sub-process's stdin.
+ """Send data to the sub-process's stdin.
Args:
data: The data to send to the process.
Returns:
Nothing.
- '''
+ """
os.write(self.fd, data)
def expect(self, patterns):
- '''Wait for the sub-process to emit specific data.
+ """Wait for the sub-process to emit specific data.
This function waits for the process to emit one pattern from the
supplied list of patterns, or for a timeout to occur.
@@ -116,7 +116,7 @@ class Spawn(object):
Notable exceptions:
Timeout, if the process did not emit any of the patterns within
the expected time.
- '''
+ """
for pi in xrange(len(patterns)):
if type(patterns[pi]) == type(''):
@@ -161,7 +161,7 @@ class Spawn(object):
self.logfile_read.flush()
def close(self):
- '''Close the stdio connection to the sub-process.
+ """Close the stdio connection to the sub-process.
This also waits a reasonable time for the sub-process to stop running.
@@ -170,7 +170,7 @@ class Spawn(object):
Returns:
Nothing.
- '''
+ """
os.close(self.fd)
for i in xrange(100):