Skip to content

Commit

Permalink
docs: add myke examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Donald Mellenbruch authored and Donald Mellenbruch committed Jun 8, 2023
1 parent 2ded549 commit 17de91b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ https://github.com/Textualize/trogon/assets/554369/c9e5dabb-5624-45cb-8612-f6ecf
</details>


Trogon works with the popular Python libraries [Click](https://click.palletsprojects.com/) and [Typer](https://github.com/tiangolo/typer), and will support other libraries and languages in the future. Trogon is integrated into the Python library [yapx](https://github.com/fresh2dev/yapx), and can even be used in conjunction with plain ol' `sys.argv`. See the `examples/` directory for examples of each.
Trogon works with the popular Python libraries [Click](https://click.palletsprojects.com/) and [Typer](https://github.com/tiangolo/typer), and will support other libraries and languages in the future. Trogon is integrated into the Python libraries [yapx](https://github.com/fresh2dev/yapx) and [myke](https://github.com/fresh2dev/myke), and can even be used in conjunction with plain ol' `sys.argv`. See the `examples/` directory for examples of each.

## How it works

Expand Down
3 changes: 3 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ pip install -r requirements.txt
./demo_yapx.py --tui
```

```sh
myke --myke-file ./demo_myke.py
```
17 changes: 17 additions & 0 deletions examples/demo_myke.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from myke import task

@task(root=True)
def setup(log_level="info"):
print(f"Log level: {log_level}")

@task
def hello(name):
print(f"Hello {name}")

@task
def goodbye(name, formal=False):
if formal:
print(f"Goodbye Ms. {name}. Have a good day.")
else:
print(f"Bye {name}!")

1 change: 1 addition & 0 deletions examples/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
..[click,typer]
yapx[tui]==0.1.*
myke[tui]==0.1.*

0 comments on commit 17de91b

Please sign in to comment.