Compare commits

...

10 commits

Author SHA1 Message Date
e511ffa7f7
python/venv
Some checks failed
/ job (push) Failing after 3s
2025-02-07 21:39:13 +01:00
7668ef8f47
lint/clean 2025-02-03 19:42:09 +01:00
aaba7cbcc6
2025-02-03 19:38:50 +01:00
3ef93255e9
ffmpeg 2025-02-03 19:29:02 +01:00
024172af9d
members 2025-02-03 19:21:15 +01:00
bd35b13f73
future 2025-02-03 19:15:34 +01:00
2c0d6050ef
log/"" 2025-02-01 01:47:12 +01:00
459e85de92
tasks/after 2025-02-01 01:38:15 +01:00
a98294a65e
fix 2025-02-01 01:32:33 +01:00
5a88d127d6
lint/return 2025-02-01 01:30:54 +01:00
6 changed files with 40 additions and 13 deletions

View file

@ -1,5 +1,7 @@
"""Wrap GRUB commands."""
from __future__ import annotations
from rwx import cmd, ps
cmd.need("grub-mkimage")

View file

@ -1,5 +1,7 @@
"""Handle processes."""
from __future__ import annotations
import subprocess
from rwx import Object, txt

View file

@ -145,6 +145,8 @@ rwx_ffmpeg_output_video_slow() {
rwx_ffmpeg_record_hdmi_precision() {
local file="${1}"
[ -n "${file}" ] || return
# LATER alternative
# shellcheck disable=SC2046,SC2312
set -- \
$(rwx_ffmpeg_input_hdmi) \
$(rwx_ffmpeg_input_dell_precision) \
@ -158,6 +160,8 @@ rwx_ffmpeg_record_hdmi_precision() {
rwx_ffmpeg_record_hdmi_yeti() {
local file="${1}"
[ -n "${file}" ] || return
# LATER alternative
# shellcheck disable=SC2046,SC2312
set -- \
$(rwx_ffmpeg_input_hdmi) \
$(rwx_ffmpeg_input_blue_yeti) \
@ -178,6 +182,8 @@ rwx_ffmpeg_reduce() {
local from="${3}"
local to="${4}"
[ -n "${output}" ] || return
# LATER alternative
# shellcheck disable=SC2046,SC2312
set -- \
$(rwx_ffmpeg_input_file "${input}" "${from}" "${to}") \
$(rwx_ffmpeg_output_video_slow) \

View file

@ -1,33 +1,31 @@
# lint code
rwx_lint() {
local path="${1}"
[ -n "${path}" ] || exit 1
rwx_lint_clean
[ -n "${path}" ] || return 1
rwx_lint_clean "${path}"
rwx_lint_tasks "${path}"
set \
"python" \
"shell"
local code
for code in "${@}"; do
rwx_log "${code}"
rwx_log "" "${code}"
"rwx_lint_${code}" "${path}"
done
rwx_lint_clean
rwx_lint_clean "${path}"
}
# clean
rwx_lint_clean() {
local path="${1}"
[ -n "${path}" ] || exit 1
rwx_log "py3clean"
py3clean \
--verbose \
"${path}"
[ -n "${path}" ] || return 1
rwx_log "" "clean" ""
py3clean "${path}"
set \
"mypy" \
"ruff"
local tool
for tool in "${@}"; do
rwx_log "${tool}"
rwx_remove "${path}/.${tool}_cache"
done
}
@ -42,7 +40,7 @@ rwx_lint_python() {
"mypy" \
"ruff"
for action in "${@}"; do
rwx_log "${action}"
rwx_log "" "${action}"
"rwx_${action}" "${path}"
done
}
@ -55,7 +53,7 @@ rwx_lint_shell() {
"shellcheck" \
"shfmt"
for action in "${@}"; do
rwx_log "${action}"
rwx_log "" "${action}"
"rwx_${action}" "${path}"
done
}
@ -69,8 +67,9 @@ rwx_lint_tasks() {
"TODO" \
"FIXME"
for type in "${@}"; do
rwx_log "${type}"
rwx_log "" "${type}"
grep \
--after "1" \
--directories "recurse" \
--line-number \
" ${type}" \

14
sh/python.sh Normal file
View file

@ -0,0 +1,14 @@
# ╭────────╮
# │ python │
# ╰────────╯
# ╭────────┬──────╮
# │ python │ venv │
# ╰────────┴──────╯
rwx_python_venv() {
local path="${1}"
[ -d "${path}" ] || return 1
export VIRTUAL_ENV="${path}" && \
export PATH="${VIRTUAL_ENV}/bin:${PATH}"
}

View file

@ -63,6 +63,8 @@ rwx_rescue_wipe_0_init_hetzner_8_8() {
for device in "${@}"; do
members="${members} ${device}2"
done
# LATER alternative
# shellcheck disable=SC2086
rwx_fs_raid_create \
"boot" "00000000:00000000:00000000:00000002" ${members}
#
@ -87,6 +89,8 @@ rwx_rescue_wipe_0_init_hetzner_8_8() {
for device in "${@}"; do
members="${members} ${device}1"
done
# LATER alternative
# shellcheck disable=SC2086
rwx_fs_raid_create \
"crypt" "00000000:00000000:00000000:00000001" ${members}
# encrypt