Revision | c30e0208662403cf2e01a6d1ae406be87e2c0b7f (tree) |
---|---|
Zeit | 2019-07-27 20:23:10 |
Autor | ksmt4699 <ksmt4699@gmai...> |
Commiter | ksmt4699 |
いろいろ変更
@@ -8,7 +8,7 @@ root.title("serene-cleaner") | ||
8 | 8 | root.geometry("640x480") |
9 | 9 | root.mainloop() |
10 | 10 | |
11 | -class clearcache(): | |
11 | +class cleancache(): | |
12 | 12 | def __init__(self, path): |
13 | 13 | rpath = path + r"/*" |
14 | 14 | self.searchpath = path.split() |
@@ -22,8 +22,8 @@ class clearcache(): | ||
22 | 22 | size = [int(s) for s in rawout.split() if s.isdigit()][0] |
23 | 23 | return size |
24 | 24 | |
25 | - def check_dir(self): | |
26 | - return os.path.isfile(r"/var/cache/apt/pkgcache.bin") | |
25 | + def check_dir(self, file): | |
26 | + return os.path.isfile(self.path + r"/" + file) | |
27 | 27 | |
28 | 28 | def cleanit(self): |
29 | 29 | cmd = "sudo rm -r " + self.removepath |
@@ -41,8 +41,8 @@ class removekernel(): | ||
41 | 41 | del installing[0] |
42 | 42 | olders = installing |
43 | 43 | if not installing: |
44 | - print("Do not have to remove old kernel.") | |
45 | - exit(0) | |
44 | + #Do not have to remove old kernel. | |
45 | + return 0 | |
46 | 46 | terget = ("linux-headers-", "linux-image-") |
47 | 47 | self.removed = [tgt + version for version in olders for tgt in terget ] |
48 | 48 | return self.removed |
@@ -54,7 +54,6 @@ class removekernel(): | ||
54 | 54 | command_l.extend(self.removed) |
55 | 55 | subprocess.call(command_l) |
56 | 56 | |
57 | - | |
58 | 57 | #Others |
59 | 58 | def yesno(choice): |
60 | 59 | if choice == "": |