#!/usr/bin/env python3
import os
from typing import List
from git import checkout_branch
from utils import mkcd
from submission import Submission
class BaseCommand:
def __init__(self, submissions: List[Submission]) -> None:
self.submissions = submissions
def __call__(self) -> None:
for submission in self.submissions:
self.exec(submission)
def exec(self, submission: Submission) -> None:
raise NotImplementedError()
class BaseGitCommand(BaseCommand):
checkout_branch(submission.branch)
mkcd(f"{submission.homework}/{submission.login}")
os.chdir("../..")
checkout_branch("master")