enhance documentation
- flatten hierarchy (some links do not work when using folders) + fix a bug with the redorder flag in Override + allow removal of parameters + clean description using inspect.cleandoc Change-Id: I3dde4f4cb29c46e8a21014f1fad7aa3ad610a1bf
This commit is contained in:
@@ -27,7 +27,7 @@ import time
|
||||
import threading
|
||||
import re
|
||||
from secop.lib.asynconn import AsynConn, ConnectionClosed
|
||||
from secop.modules import Module, Communicator, Parameter, Command, Property, Attached
|
||||
from secop.modules import Module, Communicator, Parameter, Command, Property, Attached, Override
|
||||
from secop.datatypes import StringType, FloatRange, ArrayOf, BoolType, TupleOf, ValueType
|
||||
from secop.errors import CommunicationFailedError, CommunicationSilentError
|
||||
from secop.poller import REGULAR
|
||||
@@ -65,8 +65,20 @@ class StringIO(Communicator):
|
||||
Parameter('reconnect interval', datatype=FloatRange(0), readonly=False, default=10),
|
||||
}
|
||||
commands = {
|
||||
'communicate':
|
||||
Override('''
|
||||
send a command and receive a reply
|
||||
|
||||
- using end_of_line, encoding and self._lock
|
||||
- for commands without reply, the command must be joined with a query command,
|
||||
- wait_before is respected for end_of_lines within a command
|
||||
'''),
|
||||
'multicomm':
|
||||
Command('execute multiple commands in one go',
|
||||
Command('''
|
||||
execute multiple commands in one go
|
||||
|
||||
assuring that no other thread calls commands in between
|
||||
''',
|
||||
argument=ArrayOf(StringType()), result=ArrayOf(StringType()))
|
||||
}
|
||||
|
||||
@@ -169,12 +181,6 @@ class StringIO(Communicator):
|
||||
self._reconnectCallbacks.pop(key)
|
||||
|
||||
def do_communicate(self, command):
|
||||
"""send a command and receive a reply
|
||||
|
||||
using end_of_line, encoding and self._lock
|
||||
for commands without reply, the command must be joined 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
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user