Rework a bunch of scripts into a single website script

This commit is contained in:
Eryn Wells 2024-11-18 14:59:43 -08:00
parent f83c6ebbe5
commit a9f52aad98
12 changed files with 275 additions and 92 deletions

View file

@ -0,0 +1 @@
from .command import Command

View file

@ -0,0 +1,24 @@
# Eryn Wells <eryn@erynwells.me>
import argparse
import re
class Command:
def __init__(self) -> None:
pass
@property
def name(self) -> str:
class_name = self.__class__.__name__
if class_name.endswith('Command'):
trimmed_class_name = class_name.removesuffix('Command')
hyphenated_name = re.sub(r'\B([A-Z])', r'-\1', trimmed_class_name)
return hyphenated_name.lower()
return class_name.lower()
@property
def help(self) -> str:
return ''
def add_arguments(self, _: argparse.ArgumentParser):
raise NotImplementedError()