You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
639 B
25 lines
639 B
"""
|
|
Contains abstract class for a distro
|
|
"""
|
|
|
|
from abc import ABC, abstractmethod
|
|
|
|
class Distro(ABC):
|
|
"""Abstract class for a distro"""
|
|
@staticmethod
|
|
@abstractmethod
|
|
def name():
|
|
"""Get name of distro"""
|
|
raise NotImplementedError
|
|
|
|
@staticmethod
|
|
@abstractmethod
|
|
def check():
|
|
"""Check if distro packages are up-to-date"""
|
|
raise NotImplementedError
|
|
|
|
@classmethod
|
|
def print_output(cls, is_successful):
|
|
"""Print final output of distro"""
|
|
output = "Success: {} up-to-date" if is_successful else "Failure: {} out-of-sync"
|
|
print(output.format(cls.name()))
|
|
|