Until now in Crappy, the base Path object was requiring the last sent command and its timestamp as arguments.
Any other Path subclassing it also needed to take these two values as arguments, and to pass them to the parent class (for example with super().__init__(last_time, last_cmd)).
Starting with version 2.0.0, users can now define their own custom Path objects.
With the old architecture, however, they had to define a _last_cmd and a _last_time argument to their new class, only to provide it as argument to the parent class.
This is at the same time not elegant, a potential source of bugs, and definitely not intuitive.
Instead, this PR slightly modifies the base Path object and the Generator Block so that the last command and its timestamp are not needed as arguments anymore.
To do so, they are now set as class attributes of Path, and set by the Generator Block before instantiating a new Path (88bd0ba3).
The distributed Generator Paths, the examples, and the documentation were updated accordingly (respectively e9e6891a, ae501101, ed14e7a0).
Until now in Crappy, the base
Path
object was requiring the last sent command and its timestamp as arguments. Any otherPath
subclassing it also needed to take these two values as arguments, and to pass them to the parent class (for example withsuper().__init__(last_time, last_cmd)
).Starting with version
2.0.0
, users can now define their own customPath
objects. With the old architecture, however, they had to define a_last_cmd
and a_last_time
argument to their new class, only to provide it as argument to the parent class. This is at the same time not elegant, a potential source of bugs, and definitely not intuitive.Instead, this PR slightly modifies the base
Path
object and theGenerator
Block so that the last command and its timestamp are not needed as arguments anymore. To do so, they are now set as class attributes ofPath
, and set by theGenerator
Block before instantiating a newPath
(88bd0ba3). The distributed Generator Paths, the examples, and the documentation were updated accordingly (respectively e9e6891a, ae501101, ed14e7a0).