Skip to content

Commit

Permalink
Use graphviz instead of seqdiag, allow pillow upgrade to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
mikee47 committed Apr 4, 2024
1 parent c487f91 commit cc6998e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 25 deletions.
2 changes: 2 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ build:
os: ubuntu-22.04
tools:
python: "3.12"
apt_packages:
- graphviz

# Optionally build your docs in additional formats such as PDF and ePub
formats:
Expand Down
3 changes: 1 addition & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ m2r2==0.3.3.post2
breathe==4.35.0
sphinxcontrib-wavedrom
sphinx-copybutton
sphinxcontrib-seqdiag
jinja2>=3.0.3
setuptools>=57.5.0
pillow==9.5.0 # V10 breaks seqdiag
pillow
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
extensions = [
'm2r2',
'breathe',
'sphinxcontrib.seqdiag',
'sphinx.ext.graphviz',
'link-roles',
'sphinxcontrib.wavedrom',
'sphinx_copybutton',
Expand Down
44 changes: 22 additions & 22 deletions docs/source/information/tasks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,30 @@ The BasicTask class
This class uses the task queue plus a timer to provide an easy way to write a background task.
All you need to is define a *loop()* function which does the work. The task has three states:

.. seqdiag::
.. graphviz::
:caption: Task states
:align: center
seqdiag task-states {
activation = none;
node_width = 80;
node_height = 60;
edge_length = 160;
span_height = 5;
default_shape = roundedbox;
default_fontsize = 12;

SUSPENDED [label = "suspended"];
RUNNING [label = "running"];
SLEEPING [label = "sleeping"];

SUSPENDED -> RUNNING [label = "resume()"];
SUSPENDED -> SLEEPING [label = "sleep()"];
RUNNING -> SLEEPING [label = "sleep()"];
RUNNING -> SUSPENDED [label = "suspend()"];
SLEEPING -> RUNNING [label = "resume()"];
SLEEPING -> RUNNING [label = "timer expired"];
SLEEPING -> SUSPENDED [label = "suspend()"];

digraph "task-states" {
activation = none
node_width = 80
node_height = 60
edge_length = 160
span_height = 5
default_shape = roundedbox
default_fontsize = 12

SUSPENDED [label = "suspended"]
RUNNING [label = "running"]
SLEEPING [label = "sleeping"]

SUSPENDED -> RUNNING [label = "resume()"]
SUSPENDED -> SLEEPING [label = "sleep()"]
RUNNING -> SLEEPING [label = "sleep()"]
RUNNING -> SUSPENDED [label = "suspend()"]
SLEEPING -> RUNNING [label = "resume()"]
SLEEPING -> RUNNING [label = "timer expired"]
SLEEPING -> SUSPENDED [label = "suspend()"]
}

To see this in operation, have a look at the :sample:`Basic_Tasks` sample.
Expand Down

0 comments on commit cc6998e

Please sign in to comment.