xfstestsdb/xfstestsdb/commands.py
Anna Schumaker 2a94b5e519 xfstestsdb: Create a generic Command class
This is intended to be used as a base class for implementing other
xfstestsdb commands.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-02-15 11:52:42 -05:00

20 lines
625 B
Python

# Copyright 2023 (c) Anna Schumaker.
"""A generic Command class."""
import argparse
from . import sqlite
class Command:
"""A class to help implement xfstestsdb subcommands."""
def __init__(self, subparser: argparse.Action, sql: sqlite.Connection,
name: str, help: str, **kwargs) -> None:
"""Set up the Command."""
self.parser = subparser.add_parser(name, help=help, **kwargs)
self.parser.set_defaults(function=self.do_command)
self.sql = sql
def do_command(self, args: argparse.Namespace) -> None:
"""Do something."""
raise NotImplementedError