feat: show all tasks in directory when calling streamer

Signed-off-by: Konstantin Fickel <mail@konstantinfickel.de>
This commit is contained in:
Konstantin Fickel 2025-04-13 17:00:14 +02:00
parent e748d46c8a
commit f73c6d16cb
5 changed files with 22 additions and 6 deletions

2
.envrc
View file

@ -1 +1 @@
use flake
use flake .#uv2nix

View file

@ -1,3 +1,7 @@
# streamer
Searching for `@tags` in time-based [streams](https://www.cs.yale.edu/homes/freeman/lifestreams.html).
# Usage
Running `streamer` finds all lines with @Task

View file

@ -190,9 +190,10 @@
in
pkgs.mkShell {
packages = [
packages = with pkgs; [
virtualenv
pkgs.uv
uv
bashInteractive
];
env = {

View file

@ -9,7 +9,7 @@ dependencies = [
]
[project.scripts]
streamer = "streamer:hello"
streamer = "streamer:run"
[build-system]
requires = ["hatchling"]

View file

@ -1,2 +1,13 @@
def hello() -> None:
print("You got some stuff to do!")
import glob
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}")