Changelog¶
0.9.1 2021-05-06
[Bug]: The
clu
CLI now only outputs replies to commands initiated by the command line client itself (and broadcasts if--ignore-broadcasts
is not passed).
0.9.0 2021-05-06
0.8.1 2021-04-10
[Bug]: In an
AMQPBaseActor
normally we ignore replies from the actor itself, because the actor is also a client and receives all the messages that it emits. An exception is when the commander of the command the caused that reply is the actor itself (the actor commanded itself). In that case we want to process the reply because we need to mark the command done.[Bug]: If the property in a
Model
being updated is a dictionary itself, update theProperty
dictionary instead of replacing it. This ensures that if the dictionary output contains different number of keys on different issues, the complete information is kept.
0.8.0 2021-04-09
[Feature] #72: Add a new
TCPBaseActor
which is the same as the oldJSONActor
but without a parser implementation.JSONActor
is now the implementation of the base TCP actor with a Click parser.TCPBaseActor
can be used to implement any actor that receives commands over a normal TCP socket.[Feature] #70: Add a new JSON parser that receives a JSON command string that can be unpacked into a dictionary. The dictionary is then passed to the callback. This parser can be used for actors that won’t be directly addressed by a user on a command line interface and it simplifies passing complex arguments to a command callback. The parsers have been rearranged and compiled in the
clu.parsers
submodule so this can be a breaking changes for code that used advanced functions directly from the oldclu.parser
module. Also adds aAMQPBaseActor
that does not explicitly include a parser;AMQPActor
still uses the Click parser.[Support] #69: Rewrite the keyword model section of the documentation.
0.7.8 2021-04-08
[Bug]: Fix parsing of command strings in which parameters were a string with spaces. For example
command --value "A value"
would fail because it would be split into arguments without respeting the quoted string.
0.7.7 2021-04-06
[Feature] #67: All actor now have a
model
even if they are instantiated withschema=None
. The default schema imlpiesadditionalProperties=True
. Added a new default commandkeywords
that prints information about a schema keyword in human-readable format.[Bug]:
UserInfo
must be an array of integer and string instead of a comma-separated string.[Support]: Improve typing of
Command
andBaseCommand
.[Support]: Do not strip message in
Device.write
.
0.7.6 2021-03-26
[Bug] #65: Fix a bug that prevented opening more than one
clu
CLI instance.[Bug]: Add
UserInfo
,num_users
, andyourUserID
to the default schema.
0.7.5 2021-03-23
[Bug]: For a legacy actor, strip the reply keyword and value strings when parsing them in
MockReplyList
.[Support] #64: Use
type_checker
withjsonschema
to allow lists and tuples to be be used as arrays (fixes deprecation of thetype
argument).
0.7.4 2021-03-23
[Support] #63: Breaking change.
TronKey
is now set with two attributes (in addition tovalue
):key
which contains the actorkeysKey
instance, andkeyword
with the updated keyword as an opscoreKeyword
object.TronKey.value
contains a list of thekeyword
values as Python native types. This is a breaking change because in previous versionsTronKey.key
contained theKeyword
, but this nomenclature is more consistent with the opscore class names.
0.7.3 2021-03-17
[Support]: Remove leftover print statements used for testing.
0.7.2 2021-03-16
[Feature] #61:
Model
andTronModel
callbacks receive the model and the updated keyword again. This is done in a backwards compatible manner; if the callback has a single argument in its signature it will receive only the model.[Feature] #59: Fail AMQP client command when the consumer is not connected.
[Bug]: Deal with a case in which the loop for a
CallbackMixIn
may not be running at the time at which the callback needs to be invoked.[Support]: Typing:
BaseCommand
now accepts a generic with the class of the actor.
0.7.1 2021-02-21
[Feature]: Add the option to update the object of the parser object by setting
ClickParser.context_obj
.[Support] #57: Documentation on actor communication.
0.7.0 2021-02-18
[Feature] #48:
BaseActor.write
now processes the reply regardless of the specific actor implementation and creates aReply
. TheReply
is passed to the actor_write_internal
implementation which handles sending it to the users using the specific actor transport. If the reply has been created by a command, theReply
object is appended toBaseCommand.replies
.[Feature] #49:
setup_test_actor
can now be used withAMQPActor
instances.
0.6.3 2021-02-16
[Feature]: The JSONSchema
array
type now allows both Pythonlist
andtuple
.[Support]: Renamed
no_validate
in actorswrite
method tovalidate
(defaults toTrue
so the behaviour should not change).
0.6.2 2021-02-13
[Feature] #54: Filter out issues parsing out Tron replies and log them only to the file logger.
[Bug]: Missing variable
_TimeTupleJ2000
in PVT.[Bug]: If
version=False
the console logger level was being set to zero. Now it’s set toWARNING
unlessverbose=True
which sets it toDEBUG
or ifverbose=<int>
in which case it sets it to that numerical value.
0.6.1 2021-02-13
0.5.8 2021-01-27
[Feature]: Add time string at the beginning of the CLI messages. The option
--no-time
allows to disable it.[Feature]: New option
--no-indent
in CLI to output JSONs in a single line.[Feature]: Allow
error
keyword to output a string or a list of string. When the message being written fails schema validation, output the error message as a list.
0.5.7 2021-01-24
[Bug]: Add colour code for error message in
clu
CLI.[Bug]: More file logger fixes. Prevent a failure when the log directory cannot be created.
[Support]: Improve the output of the
help
command.
0.5.6 2020-12-07
[Bug]: Do not try to set logger format if it failed to create the file logger.
0.5.5 2020-11-17
[Bug] #44: Add
url
,virtualhost
, andssl
parameters forAMQPClient
that propagates toTopicListener
. When definedurl
overrides the connection parameters. The CLU CLI now also accepts a--url
flag.[Bug]: Fix AMQP CLI. It failed when printing a message code
>
as HTML.
0.5.4 2020-11-05
[Feature]: Provide more information in actor reply for an uncaught error.
[Feature]: Add
silent
option toBaseCommand.set_status
.[Feature]: When a
parent
command is specified, output messages using that command.[Bug]: Handle
Device.stop
when the client is not connected.[Bug]: Fix typo that caused
Device.stop
to fail.
0.5.3 2020-10-31
[Feature]: Expose
BaseClient.config
with the full configuration passed toBaseClient.from_config
.
0.5.2 2020-09-22
[Bug] #42: Detect EOF received in
TronConnection
and cleanly close the connection.[Support]: Call the
TronModel
callback only with the model itself (it was also receiving the latest changed key). This make it consistent withModel
and the documentation.[Support]: Significantly increased coverage and cleaned some code.
0.5.1 2020-09-09
[Feature] #40: Use
context_settings={'ignore_unknown_options': True}
inCluCommand
by default to allow correct parsing of negative number in arguments.[Support] #39: Use
schema
and schema validation inLegacyActor
andJSONActor
.[Support] #38: Use reply code
>
when the command is set toRUNNING
.[Support]: Rename
clu_exchange
tosdss_exchange
.
0.5.0 2020-09-01
[Feature] #31: Add
multiline
command toJSONActor
to produce human-readable output.[Feature] #32: Add default
version
command.[Feature] #4:
AMQPActor
actors now self-validate their messages. The schema can be requested as a command.[Bug] #34: Fix actor replies with level
REPLY
not being logged.[Bug] #29: Fix the CLI application.
[Support] #35:
TronConnection
now subclasses fromBaseClient
and keeps track of running commands and replies.[Support]: Several changes to homogenise the API. All actors and clients now have
start
,stop
, andrun_forever
methods.[Support]: First version with >80% test coverage.
0.4.1 2020-08-19
[Bug]: Fix starting server in
TCPStreamPeriodicServer
.[Support]: Set default logging level to warning for stdout/stderr.
0.4.0 2020-08-09
[Bug] #27: Fixed parsing of
KeyDictionary
fromactorkeys
.[Support] #27: Tests for legacy tools.
[Support] #27: Replace
CallbackScheduler
withCallbackMixIn
.[Support] #27: Consolidated how stream servers and clients work. Renamed
TCPStreamClient
toopen_connection
andTCPStreamClientContainer
toTCPStreamClient
. All servers and clients now start and stop withstart
andstop
coroutines. The_server
and_client
attributes are now consistently named and not public.
0.3.3 2020-08-01
[Bug]: In the previous release I set the level to
ERRO
instead ofERROR
😓.
0.3.1 2020-08-01
[Bug]: Log
StreamHandler
tostderr
when the record level isERROR
or greater.
0.3.0 2020-07-31
[Support]: Breaking changes. Improve modularity. Some files have been renamed.
BaseActor
is now parser-agnostic and the Click-parsing functionality has been moved toClickParser
. Similarly,BaseLegacyActor
does not include a parser, with the Click parser implemented inLegacyActor
. The logging system has been streamlined.
0.2.2 2020-07-29
[Bug]: Fix bug in
MockReplyList.parse_reply
when the value of the keyword contains multiple=
.[Support]: Relax
sdsstools
version to allowjaeger
to bump the minimum version.
0.2.1 2020-01-24
0.2.0 2020-01-19
[Feature] #21: Renamed
BaseCommand.done
and.failed
toBaseCommand.finish
andBaseCommand.fail
.BaseCommand.finish
andBaseCommand.fail
now return the command itself. This is useful when doingreturn command.fail()
in case the user wants to do something else with the command.Allow to define the default keyword to use if a message is just a string.
0.1.11 2020-01-14
Move
parser
argument fromBaseClient
toBaseActor
, since only actors receive and need to parse commands.Add a
JSONActor
class that replies to the user using JSON dictionaries.Simplify
from_config
by taking advantage that one can pass arguments as keyword arguments and does not need to conserve the original order. This allows to define onlyBaseClient.from_config
and do not need to override it of each subclass.Improve representation of actor classes (print name of class as
repr
).Use
AsyncMock
in thetesting
module when running Python 3.8+.Improve logging to actor.
Remove numpy dependency from CLU.
0.1.10 2019-12-25
Tweak dependencies and poetry install.
0.1.9 2019-11-21
Fix
__version__
definition from package version.
0.1.8 2019-11-21
Use poetry for development and building.
Allow to pass a mapping of logging to actor codes to the
ActorHandler
.
0.1.7 2019-11-19
Added
BaseCommand.debug
,info
, andwarning
convenience methods.
0.1.6 2019-11-15
Breaking change: Rename
Client.run()
andActor.run()
to.start()
(same for legacy actor). Added aBaseLegacyActor.run_forever
method for convenience.In legacy actor, default to use the
text
keyword if the message passed is a string.Fix display of warnings in actor.
0.1.5 2019-11-13
0.1.4 2019-10-11
Fix Travis deployment.
0.1.3 2019-10-11
Fix Travis deployment.
0.1.2 2019-10-11
Better exception and logging handling.
Provide a new clu.testing module with testing tools.
Modify legacy command parser. Now it accepts commands in the form
<command_id> <command_body>
(intron
, this requires setting theASCIICmdEncoder
withuseCID=False, CIDfirst=False
).Make sure help command finishes.
Allow to pass the command parser as an argument.
0.1.1 2019-10-03
Fix tag version.
0.1.0 2019-10-03
Basic framework.