feat: show all tasks in directory when calling streamer
Signed-off-by: Konstantin Fickel <mail@konstantinfickel.de>
This commit is contained in:
parent
e748d46c8a
commit
f73c6d16cb
5 changed files with 22 additions and 6 deletions
2
.envrc
2
.envrc
|
|
@ -1 +1 @@
|
||||||
use flake
|
use flake .#uv2nix
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
# streamer
|
# streamer
|
||||||
|
|
||||||
Searching for `@tags` in time-based [streams](https://www.cs.yale.edu/homes/freeman/lifestreams.html).
|
Searching for `@tags` in time-based [streams](https://www.cs.yale.edu/homes/freeman/lifestreams.html).
|
||||||
|
|
||||||
|
# Usage
|
||||||
|
|
||||||
|
Running `streamer` finds all lines with @Task
|
||||||
|
|
@ -190,9 +190,10 @@
|
||||||
|
|
||||||
in
|
in
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
packages = [
|
packages = with pkgs; [
|
||||||
virtualenv
|
virtualenv
|
||||||
pkgs.uv
|
uv
|
||||||
|
bashInteractive
|
||||||
];
|
];
|
||||||
|
|
||||||
env = {
|
env = {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
streamer = "streamer:hello"
|
streamer = "streamer:run"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["hatchling"]
|
requires = ["hatchling"]
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,13 @@
|
||||||
def hello() -> None:
|
import glob
|
||||||
print("You got some stuff to do!")
|
import os
|
||||||
|
cwd = os.getcwd()
|
||||||
|
|
||||||
|
def run() -> None:
|
||||||
|
for file_name in glob.glob(f"{glob.escape(cwd)}/*.md"):
|
||||||
|
with open(file_name, "r") as file:
|
||||||
|
file_content: str = file.read()
|
||||||
|
|
||||||
|
for line_number, line in enumerate(file_content.split("\n"), 1):
|
||||||
|
if "@Task" in line and "@Done" not in line:
|
||||||
|
print(line)
|
||||||
|
print(f" {file_name}:{line_number}")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue