1 |
commit: d5fc0982052ada0eaab209b8c56574220f63a698 |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Oct 6 13:57:12 2015 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Oct 6 13:57:12 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=d5fc0982 |
7 |
|
8 |
lint: convert funcs to @staticmethod where it makes sense |
9 |
|
10 |
These functions don't actually utilize |self|, so make them into |
11 |
@staticmethod's to quiet down the linter. |
12 |
|
13 |
catalyst/base/stagebase.py | 3 ++- |
14 |
catalyst/lock.py | 9 ++++++--- |
15 |
catalyst/targets/snapshot.py | 3 ++- |
16 |
3 files changed, 10 insertions(+), 5 deletions(-) |
17 |
|
18 |
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py |
19 |
index b9dd1d5..409fcab 100644 |
20 |
--- a/catalyst/base/stagebase.py |
21 |
+++ b/catalyst/base/stagebase.py |
22 |
@@ -1695,7 +1695,8 @@ class StageBase(TargetBase, ClearBase, GenBase): |
23 |
self.unbind() |
24 |
raise CatalystError("build aborting due to livecd_update error.") |
25 |
|
26 |
- def _debug_pause_(self): |
27 |
+ @staticmethod |
28 |
+ def _debug_pause_(): |
29 |
py_input("press any key to continue: ") |
30 |
|
31 |
# vim: ts=4 sw=4 sta et sts=4 ai |
32 |
|
33 |
diff --git a/catalyst/lock.py b/catalyst/lock.py |
34 |
index 71918d6..01b1aa8 100644 |
35 |
--- a/catalyst/lock.py |
36 |
+++ b/catalyst/lock.py |
37 |
@@ -320,7 +320,8 @@ class LockDir(object): |
38 |
del self.hardlock_paths[self.lockdir] |
39 |
print self.hardlock_paths |
40 |
|
41 |
- def hardlock_name(self, path): |
42 |
+ @staticmethod |
43 |
+ def hardlock_name(path): |
44 |
mypath=path+"/.hardlock-"+os.uname()[1]+"-"+str(os.getpid()) |
45 |
newpath = os.path.normpath(mypath) |
46 |
if len(newpath) > 1: |
47 |
@@ -328,7 +329,8 @@ class LockDir(object): |
48 |
newpath = "/"+newpath.lstrip("/") |
49 |
return newpath |
50 |
|
51 |
- def hardlink_is_mine(self,link,lock): |
52 |
+ @staticmethod |
53 |
+ def hardlink_is_mine(link, lock): |
54 |
import stat |
55 |
try: |
56 |
myhls = os.stat(link) |
57 |
@@ -347,7 +349,8 @@ class LockDir(object): |
58 |
return True |
59 |
return False |
60 |
|
61 |
- def hardlink_active(self, lock): |
62 |
+ @staticmethod |
63 |
+ def hardlink_active(lock): |
64 |
if not os.path.exists(lock): |
65 |
return False |
66 |
|
67 |
|
68 |
diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py |
69 |
index 87340b7..a117a21 100644 |
70 |
--- a/catalyst/targets/snapshot.py |
71 |
+++ b/catalyst/targets/snapshot.py |
72 |
@@ -90,7 +90,8 @@ class snapshot(TargetBase, GenBase): |
73 |
def kill_chroot_pids(self): |
74 |
pass |
75 |
|
76 |
- def cleanup(self): |
77 |
+ @staticmethod |
78 |
+ def cleanup(): |
79 |
print "Cleaning up..." |
80 |
|
81 |
def purge(self): |