From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 01804138353 for ; Mon, 13 Apr 2020 20:36:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3D715E0C1A; Mon, 13 Apr 2020 20:36:05 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 285FDE0C1A for ; Mon, 13 Apr 2020 20:36:05 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 533D534F1AB for ; Mon, 13 Apr 2020 20:36:04 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A430B1DA for ; Mon, 13 Apr 2020 20:36:02 +0000 (UTC) From: "Matt Turner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Turner" Message-ID: <1586810135.a711659173fa2d1b3763370bb8b76b990a2d2df4.mattst88@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/base/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/base/targetbase.py X-VCS-Directories: catalyst/base/ X-VCS-Committer: mattst88 X-VCS-Committer-Name: Matt Turner X-VCS-Revision: a711659173fa2d1b3763370bb8b76b990a2d2df4 X-VCS-Branch: master Date: Mon, 13 Apr 2020 20:36:02 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: afb595e7-d938-417d-8fd7-f4d18e261823 X-Archives-Hash: 23410294aab3f04663a6a8e640900e3a commit: a711659173fa2d1b3763370bb8b76b990a2d2df4 Author: Matt Turner gentoo org> AuthorDate: Sat Apr 11 21:59:07 2020 +0000 Commit: Matt Turner gentoo org> CommitDate: Mon Apr 13 20:35:35 2020 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=a7116591 catalyst: Require that subclasses implement needed properties Signed-off-by: Matt Turner gentoo.org> catalyst/base/targetbase.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/catalyst/base/targetbase.py b/catalyst/base/targetbase.py index 0977bad3..a09abc73 100644 --- a/catalyst/base/targetbase.py +++ b/catalyst/base/targetbase.py @@ -1,8 +1,10 @@ import os +from abc import ABC, abstractmethod + from catalyst.support import addl_arg_parse -class TargetBase(): +class TargetBase(ABC): """ The toplevel class for all targets. This is about as generic as we get. """ @@ -13,3 +15,15 @@ class TargetBase(): 'PATH': '/bin:/sbin:/usr/bin:/usr/sbin', 'TERM': os.getenv('TERM', 'dumb'), } + + @property + @classmethod + @abstractmethod + def required_values(cls): + return NotImplementedError + + @property + @classmethod + @abstractmethod + def valid_values(cls): + return NotImplementedError