Skip to content

Commit

Permalink
fix: Remove sode code that was not meant to be exported
Browse files Browse the repository at this point in the history
  • Loading branch information
Konubinix committed Feb 16, 2024
1 parent 8b2a2b4 commit 94529d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 29 deletions.
26 changes: 0 additions & 26 deletions doc/use_cases/3D_printing_flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,32 +120,6 @@ def send(gcode, warn_when_done, printer):
print("Driiiiiiing!")
```

```bash
clk command create python --force --group printer --description "This is a group of commands to deal with 3D printing." --body '
@printer.command()
def calibrate():
"""Run everything that is needed to have the printer ready to print"""
print("Running some stuff for the printer to be ready to go")
@printer.command(flowdepends=["printer.calibrate"])
@option("--model", default=["model.stl"], help="The model to slice", multiple=True)
@option("--output", default="model.gcode", help="The file getting the final gcode")
def slice(model, output):
"""Slice a model"""
print("Slicing " + ", ".join(model) + f" to {output}")
@printer.command(flowdepends=["printer.slice"])
@option("--gcode", help="The gcode file", default="model.gcode")
@flag("--warn-when-done", help="Trigger a notification when done")
@argument("printer", help="The ip of the printer to send the gcode to")
def send(gcode, warn_when_done, printer):
"""Send some gcode to your printer"""
print(f"Printing {gcode} using {printer}")
if warn_when_done:
print("Driiiiiiing!")
'
```

Now, you only have three commands and running the flow needs to be done explicitly.

```bash
Expand Down
6 changes: 3 additions & 3 deletions doc/use_cases/3D_printing_flow.org
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Yet get something like this.
#+END_SRC

#+name: commands-with-explicit-flow
#+BEGIN_SRC bash :results none :exports code :session 73f5d57e-d16a-490a-b4e1-0254d6296590 :noweb yes
#+BEGIN_SRC bash :results none :exports none :session 73f5d57e-d16a-490a-b4e1-0254d6296590 :noweb yes
clk command create python --force --group printer --description "This is a group of commands to deal with 3D printing." --body '
<<with_explicit_flow>>
'
Expand All @@ -181,7 +181,7 @@ echo "# Running the send command, asking for its flow"
clk printer send myprinter --flow
#+END_SRC

#+RESULTS[5abe49977f70a65fadbd276544ea1ac468a78e9e]: running-the-explicit-flow
#+RESULTS[ab4abc6d0df732b964aae068b34e2ecbc06d48d6]: running-the-explicit-flow
: # Running the send command, without the flow
: Printing model.gcode using myprinter
: # Running the send command, asking for its flow
Expand All @@ -200,7 +200,7 @@ clk parameter set printer.slice --model someothermodel
clk printer send myprinter --flow
#+END_SRC

#+RESULTS[40db54ab1ea60d38b3ce3fafef1d8273c1c8977c]: running-the-explicit-flow-with-model
#+RESULTS[b8519ee1dee8a9434b4253ec4cfcb9c2ca8263a7]: running-the-explicit-flow-with-model
: New global parameters for printer.slice: --model someothermodel
: Running some stuff for the printer to be ready to go
: Slicing someothermodel to model.gcode
Expand Down

0 comments on commit 94529d5

Please sign in to comment.