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 7BECF138351 for ; Mon, 13 Apr 2020 20:43:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 613AEE0C38; Mon, 13 Apr 2020 20:43:30 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 094D2E0C26 for ; Mon, 13 Apr 2020 20:43:30 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 CBD3E34F2A4 for ; Mon, 13 Apr 2020 20:43:28 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6E7D91D7 for ; Mon, 13 Apr 2020 20:43:27 +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: <1586810590.f0c42aff30385e2e37b96bb0b568ed049d40443b.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: f0c42aff30385e2e37b96bb0b568ed049d40443b X-VCS-Branch: master Date: Mon, 13 Apr 2020 20:43:27 +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: 911e3ca1-1d63-4c1c-b023-ccea18aceb66 X-Archives-Hash: 19c6ad9200a64682f3c01918f28c68a2 commit: f0c42aff30385e2e37b96bb0b568ed049d40443b Author: Matt Turner gentoo org> AuthorDate: Sat Apr 11 21:59:07 2020 +0000 Commit: Matt Turner gentoo org> CommitDate: Mon Apr 13 20:43:10 2020 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=f0c42aff 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