Changelog¶
0.9.1 2021-05-06
[Bug]: The
cluCLI now only outputs replies to commands initiated by the command line client itself (and broadcasts if--ignore-broadcastsis not passed).
0.9.0 2021-05-06
0.8.1 2021-04-10
[Bug]: In an
AMQPBaseActornormally 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
Modelbeing updated is a dictionary itself, update thePropertydictionary 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
TCPBaseActorwhich is the same as the oldJSONActorbut without a parser implementation.JSONActoris now the implementation of the base TCP actor with a Click parser.TCPBaseActorcan 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.parserssubmodule so this can be a breaking changes for code that used advanced functions directly from the oldclu.parsermodule. Also adds aAMQPBaseActorthat does not explicitly include a parser;AMQPActorstill 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
modeleven if they are instantiated withschema=None. The default schema imlpiesadditionalProperties=True. Added a new default commandkeywordsthat prints information about a schema keyword in human-readable format.[Bug]:
UserInfomust be an array of integer and string instead of a comma-separated string.[Support]: Improve typing of
CommandandBaseCommand.[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
cluCLI instance.[Bug]: Add
UserInfo,num_users, andyourUserIDto 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_checkerwithjsonschemato allow lists and tuples to be be used as arrays (fixes deprecation of thetypeargument).
0.7.4 2021-03-23
[Support] #63: Breaking change.
TronKeyis now set with two attributes (in addition tovalue):keywhich contains the actorkeysKeyinstance, andkeywordwith the updated keyword as an opscoreKeywordobject.TronKey.valuecontains a list of thekeywordvalues as Python native types. This is a breaking change because in previous versionsTronKey.keycontained 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:
ModelandTronModelcallbacks 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
CallbackMixInmay not be running at the time at which the callback needs to be invoked.[Support]: Typing:
BaseCommandnow 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.writenow processes the reply regardless of the specific actor implementation and creates aReply. TheReplyis passed to the actor_write_internalimplementation which handles sending it to the users using the specific actor transport. If the reply has been created by a command, theReplyobject is appended toBaseCommand.replies.[Feature] #49:
setup_test_actorcan now be used withAMQPActorinstances.
0.6.3 2021-02-16
[Feature]: The JSONSchema
arraytype now allows both Pythonlistandtuple.[Support]: Renamed
no_validatein actorswritemethod tovalidate(defaults toTrueso 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
_TimeTupleJ2000in PVT.[Bug]: If
version=Falsethe console logger level was being set to zero. Now it’s set toWARNINGunlessverbose=Truewhich sets it toDEBUGor 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-timeallows to disable it.[Feature]: New option
--no-indentin CLI to output JSONs in a single line.[Feature]: Allow
errorkeyword 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
cluCLI.[Bug]: More file logger fixes. Prevent a failure when the log directory cannot be created.
[Support]: Improve the output of the
helpcommand.
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, andsslparameters forAMQPClientthat propagates toTopicListener. When definedurloverrides the connection parameters. The CLU CLI now also accepts a--urlflag.[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
silentoption toBaseCommand.set_status.[Feature]: When a
parentcommand is specified, output messages using that command.[Bug]: Handle
Device.stopwhen the client is not connected.[Bug]: Fix typo that caused
Device.stopto fail.
0.5.3 2020-10-31
[Feature]: Expose
BaseClient.configwith the full configuration passed toBaseClient.from_config.
0.5.2 2020-09-22
[Bug] #42: Detect EOF received in
TronConnectionand cleanly close the connection.[Support]: Call the
TronModelcallback only with the model itself (it was also receiving the latest changed key). This make it consistent withModeland 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}inCluCommandby default to allow correct parsing of negative number in arguments.[Support] #39: Use
schemaand schema validation inLegacyActorandJSONActor.[Support] #38: Use reply code
>when the command is set toRUNNING.[Support]: Rename
clu_exchangetosdss_exchange.
0.5.0 2020-09-01
[Feature] #31: Add
multilinecommand toJSONActorto produce human-readable output.[Feature] #32: Add default
versioncommand.[Feature] #4:
AMQPActoractors now self-validate their messages. The schema can be requested as a command.[Bug] #34: Fix actor replies with level
REPLYnot being logged.[Bug] #29: Fix the CLI application.
[Support] #35:
TronConnectionnow subclasses fromBaseClientand keeps track of running commands and replies.[Support]: Several changes to homogenise the API. All actors and clients now have
start,stop, andrun_forevermethods.[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
KeyDictionaryfromactorkeys.[Support] #27: Tests for legacy tools.
[Support] #27: Replace
CallbackSchedulerwithCallbackMixIn.[Support] #27: Consolidated how stream servers and clients work. Renamed
TCPStreamClienttoopen_connectionandTCPStreamClientContainertoTCPStreamClient. All servers and clients now start and stop withstartandstopcoroutines. The_serverand_clientattributes are now consistently named and not public.
0.3.3 2020-08-01
[Bug]: In the previous release I set the level to
ERROinstead ofERROR😓.
0.3.1 2020-08-01
[Bug]: Log
StreamHandlertostderrwhen the record level isERRORor greater.
0.3.0 2020-07-31
[Support]: Breaking changes. Improve modularity. Some files have been renamed.
BaseActoris now parser-agnostic and the Click-parsing functionality has been moved toClickParser. Similarly,BaseLegacyActordoes 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_replywhen the value of the keyword contains multiple=.[Support]: Relax
sdsstoolsversion to allowjaegerto bump the minimum version.
0.2.1 2020-01-24
0.2.0 2020-01-19
[Feature] #21: Renamed
BaseCommand.doneand.failedtoBaseCommand.finishandBaseCommand.fail.BaseCommand.finishandBaseCommand.failnow 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
parserargument fromBaseClienttoBaseActor, since only actors receive and need to parse commands.Add a
JSONActorclass that replies to the user using JSON dictionaries.Simplify
from_configby 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_configand do not need to override it of each subclass.Improve representation of actor classes (print name of class as
repr).Use
AsyncMockin thetestingmodule 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, andwarningconvenience methods.
0.1.6 2019-11-15
Breaking change: Rename
Client.run()andActor.run()to.start()(same for legacy actor). Added aBaseLegacyActor.run_forevermethod for convenience.In legacy actor, default to use the
textkeyword 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 theASCIICmdEncoderwithuseCID=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.