From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-catalyst+bounces-3279-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A285013888F for <garchives@archives.gentoo.org>; Tue, 6 Oct 2015 15:05:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A03B421C03E; Tue, 6 Oct 2015 15:05:36 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D4C7621C010 for <gentoo-catalyst@lists.gentoo.org>; Tue, 6 Oct 2015 15:05:35 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 1B6C6340AE0 for <gentoo-catalyst@lists.gentoo.org>; Tue, 6 Oct 2015 15:05:35 +0000 (UTC) From: Mike Frysinger <vapier@gentoo.org> To: gentoo-catalyst@lists.gentoo.org Subject: [gentoo-catalyst] [PATCH 04/13] lint: convert funcs to @staticmethod where it makes sense Date: Tue, 6 Oct 2015 11:05:20 -0400 Message-Id: <1444143929-26705-4-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 2.5.2 In-Reply-To: <1444143929-26705-1-git-send-email-vapier@gentoo.org> References: <1444143929-26705-1-git-send-email-vapier@gentoo.org> Precedence: bulk List-Post: <mailto:gentoo-catalyst@lists.gentoo.org> List-Help: <mailto:gentoo-catalyst+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-catalyst+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-catalyst+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-catalyst.gentoo.org> X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org X-Archives-Salt: bded9f29-4675-400f-b05e-a5061be94b10 X-Archives-Hash: df53e4a45ffa2dcb29733a61f63b2763 These functions don't actually utilize |self|, so make them into @staticmethod's to quiet down the linter. --- catalyst/base/stagebase.py | 3 ++- catalyst/lock.py | 9 ++++++--- catalyst/targets/snapshot.py | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index b9dd1d5..409fcab 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -1695,7 +1695,8 @@ class StageBase(TargetBase, ClearBase, GenBase): self.unbind() raise CatalystError("build aborting due to livecd_update error.") - def _debug_pause_(self): + @staticmethod + def _debug_pause_(): py_input("press any key to continue: ") # vim: ts=4 sw=4 sta et sts=4 ai diff --git a/catalyst/lock.py b/catalyst/lock.py index 71918d6..01b1aa8 100644 --- a/catalyst/lock.py +++ b/catalyst/lock.py @@ -320,7 +320,8 @@ class LockDir(object): del self.hardlock_paths[self.lockdir] print self.hardlock_paths - def hardlock_name(self, path): + @staticmethod + def hardlock_name(path): mypath=path+"/.hardlock-"+os.uname()[1]+"-"+str(os.getpid()) newpath = os.path.normpath(mypath) if len(newpath) > 1: @@ -328,7 +329,8 @@ class LockDir(object): newpath = "/"+newpath.lstrip("/") return newpath - def hardlink_is_mine(self,link,lock): + @staticmethod + def hardlink_is_mine(link, lock): import stat try: myhls = os.stat(link) @@ -347,7 +349,8 @@ class LockDir(object): return True return False - def hardlink_active(self, lock): + @staticmethod + def hardlink_active(lock): if not os.path.exists(lock): return False diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py index 87340b7..a117a21 100644 --- a/catalyst/targets/snapshot.py +++ b/catalyst/targets/snapshot.py @@ -90,7 +90,8 @@ class snapshot(TargetBase, GenBase): def kill_chroot_pids(self): pass - def cleanup(self): + @staticmethod + def cleanup(): print "Cleaning up..." def purge(self): -- 2.5.2