Rework a bunch of scripts into a single website script
This commit is contained in:
parent
f83c6ebbe5
commit
a9f52aad98
12 changed files with 275 additions and 92 deletions
24
scripts/erynwells_me/scripting/command.py
Normal file
24
scripts/erynwells_me/scripting/command.py
Normal 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()
|
Loading…
Add table
Add a link
Reference in a new issue