make most important classes available from secop

+ consmetic changes to make PyCharm more happy
+ update authorship

Change-Id: I67cb61a04e502b207be74cea4ca07931c88fdafe
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22070
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
2019-12-20 14:31:50 +01:00
parent e2cc9f74b5
commit 795759786f
15 changed files with 161 additions and 148 deletions

View File

@ -193,7 +193,7 @@ class StringIO(Communicator):
if not re.match(regexp, reply):
self.closeConnection()
raise CommunicationFailedError('bad response: %s does not match %s' %
(reply, regexp))
(reply, regexp))
def registerReconnectCallback(self, name, func):
"""register reconnect callback
@ -216,14 +216,14 @@ class StringIO(Communicator):
self._reconnectCallbacks.pop(key)
def do_communicate(self, command):
'''send a command and receive a reply
"""send a command and receive a reply
using end_of_line, encoding and self._lock
for commands without reply, join it with a query command,
wait_before is respected for end_of_lines within a command.
'''
"""
if not self.is_connected:
self.read_is_connected() # try to reconnect
self.read_is_connected() # try to reconnect
try:
with self._lock:
# read garbage and wait before send
@ -235,7 +235,7 @@ class StringIO(Communicator):
for cmd in cmds:
if self.wait_before:
time.sleep(self.wait_before)
if garbage is None: # read garbage only once
if garbage is None: # read garbage only once
garbage = b''
data = self.readWithTimeout(0)
while data: