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

  • [Feature] #75: Add flag --ignore-broadcasts/-b to the CLI tool to prevent broadcast replies from being shown.

  • [Feature] #46: Add an option to TronModel to reload the model from actorkeys.

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 the Property 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 old JSONActor 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 old clu.parser module. Also adds a AMQPBaseActor 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 with schema=None. The default schema imlpies additionalProperties=True. Added a new default command keywords 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 and BaseCommand.

  • [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, and yourUserID 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 with jsonschema to allow lists and tuples to be be used as arrays (fixes deprecation of the type argument).

0.7.4 2021-03-23

  • [Support] #63: Breaking change. TronKey is now set with two attributes (in addition to value): key which contains the actorkeys Key instance, and keyword with the updated keyword as an opscore Keyword object. TronKey.value contains a list of the keyword values as Python native types. This is a breaking change because in previous versions TronKey.key contained the Keyword, 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 and TronModel 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

0.7.0 2021-02-18

  • [Feature] #48: BaseActor.write now processes the reply regardless of the specific actor implementation and creates a Reply. The Reply 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, the Reply object is appended to BaseCommand.replies.

  • [Feature] #49: setup_test_actor can now be used with AMQPActor instances.

0.6.3 2021-02-16

  • [Feature]: The JSONSchema array type now allows both Python list and tuple.

  • [Support]: Renamed no_validate in actors write method to validate (defaults to True 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 to WARNING unless verbose=True which sets it to DEBUG or if verbose=<int> in which case it sets it to that numerical value.

0.6.1 2021-02-13

  • [Feature] #52: Flatten dictionary message in LegacyActor.write into a list, when possible.

  • [Feature]: Use log rollover.

  • [Bug]: Remove newline when logging JSONActor replies.

  • [Bug]: If verbose=True set console logger level to DEBUG. This prevents replies being logged to the console.

0.6.0 2021-02-04

  • [Feature] #50: Add type hints to all codebase.

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, and ssl parameters for AMQPClient that propagates to TopicListener. When defined url 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 to BaseCommand.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

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 with Model 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} in CluCommand by default to allow correct parsing of negative number in arguments.

  • [Support] #39: Use schema and schema validation in LegacyActor and JSONActor.

  • [Support] #38: Use reply code > when the command is set to RUNNING.

  • [Support]: Rename clu_exchange to sdss_exchange.

0.5.0 2020-09-01

  • [Feature] #31: Add multiline command to JSONActor 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 from BaseClient and keeps track of running commands and replies.

  • [Support]: Several changes to homogenise the API. All actors and clients now have start, stop, and run_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 from actorkeys.

  • [Support] #27: Tests for legacy tools.

  • [Support] #27: Replace CallbackScheduler with CallbackMixIn.

  • [Support] #27: Consolidated how stream servers and clients work. Renamed TCPStreamClient to open_connection and TCPStreamClientContainer to TCPStreamClient. All servers and clients now start and stop with start and stop 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 of ERROR 😓.

0.3.1 2020-08-01

  • [Bug]: Log StreamHandler to stderr when the record level is ERROR 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 to ClickParser. Similarly, BaseLegacyActor does not include a parser, with the Click parser implemented in LegacyActor. 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 allow jaeger to bump the minimum version.

0.2.1 2020-01-24

  • [Feature] #18: Allow to pass a command parser that inherits from CluGroup and autocomplete help and ping if needed.

  • Add CommandStatus.did_succeed.

  • For JSONActor, the help commands output lines as a list to improve readability.

0.2.0 2020-01-19

0.1.12 2020-01-14

  • Added an error reply level.

  • Some tweaks to JSONActor and the testing framework.

0.1.11 2020-01-14

  • Rename Actor to AMQPActor.

  • Move parser argument from BaseClient to BaseActor, 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 only BaseClient.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 the testing 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

0.1.6 2019-11-15

  • Breaking change: Rename Client.run() and Actor.run() to .start() (same for legacy actor). Added a BaseLegacyActor.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

  • [Feature] #17: Allow to run commands on a loop.

  • [Feature] #15: Implement subcommands.

  • [Feature] #7: Allow Tron connection to fail but keep the actor alive and working.

  • [Bug] #8: Fix AttributeError when connection breaks.

  • [Bug] #11: Allow to pass parser arguments to a CluGroup.

  • [Bug] #6: Fix bug when asking for help of subcommands and command groups.

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> (in tron, this requires setting the ASCIICmdEncoder with useCID=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.