diff options
| -rwxr-xr-x | .local/bin/django-test | 52 | ||||
| -rwxr-xr-x | .local/bin/sct-daemon | 18 | ||||
| -rwxr-xr-x | .local/bin/tree-sitter | bin | 12489088 -> 0 bytes |
3 files changed, 0 insertions, 70 deletions
diff --git a/.local/bin/django-test b/.local/bin/django-test deleted file mode 100755 index f5081cf..0000000 --- a/.local/bin/django-test +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python3 -import ast -import subprocess -import sys -from pathlib import Path -from typing import override - -if len(sys.argv) < 2: - raise SystemExit("usage: django-test [--list] <func_name>") - -list_only = sys.argv[1] == "--list" -func_name = sys.argv[2] if list_only else sys.argv[1] - -repo_root = Path(subprocess.check_output(["git", "rev-parse", "--show-toplevel"], text=True).strip()) -files = subprocess.check_output(["git", "ls-files", "*.py"], text=True, cwd=repo_root).splitlines() -hits: list[str] = [] - -for rel_path in files: - path = repo_root / rel_path - s = path.read_text(encoding="utf-8") - - if func_name not in s: - continue - t = ast.parse(s, filename=str(rel_path)) - mod = rel_path[:-3].replace("/", ".").replace("\\", ".") - - class V(ast.NodeVisitor): - cls: str | None = None - - @override - def visit_ClassDef(self, node: ast.ClassDef) -> None: - old = self.cls - self.cls = node.name - self.generic_visit(node) - self.cls = old - - @override - def visit_FunctionDef(self, node: ast.FunctionDef) -> None: - if node.name == func_name: - hits.append(f"{sys.executable} manage.py test {mod}.{self.cls+'.' if self.cls else ''}{func_name}") - self.generic_visit(node) - - V().visit(t) - -hits = sorted(set(hits)) - -if list_only or len(hits) != 1: - [print(h) for h in hits] -else: - cmd = hits[0] - print(cmd) - _ = subprocess.run(cmd, shell=True, check=True, cwd=repo_root) diff --git a/.local/bin/sct-daemon b/.local/bin/sct-daemon deleted file mode 100755 index b16a67e..0000000 --- a/.local/bin/sct-daemon +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -set -e - -while true; do - hour=$(date +%H) - - if [ "$hour" -ge 6 ] && [ "$hour" -lt 18 ]; then - sct 6500 # day - elif [ "$hour" -ge 18 ] && [ "$hour" -lt 20 ]; then - sct 4500 # evening - elif [ "$hour" -ge 20 ] && [ "$hour" -lt 22 ]; then - sct 3500 # night - else - sct 3000 # late night/early morning - fi - - sleep 600 # check every 10 minutes -done diff --git a/.local/bin/tree-sitter b/.local/bin/tree-sitter Binary files differdeleted file mode 100755 index 05ed7f3..0000000 --- a/.local/bin/tree-sitter +++ /dev/null |