• R/O
  • HTTP
  • SSH
  • HTTPS

serene-cleaner: Commit


Commit MetaInfo

Revision4e8fabfb50b28ae6886ed6d4b14b70df526623bf (tree)
Zeit2019-07-27 13:41:56
Autorksmt4699 <ksmt4699@gmai...>
Commiterksmt4699

Log Message

不要な命令を削除

Ändern Zusammenfassung

Diff

--- a/main/serene-cleaner.py
+++ b/main/serene-cleaner.py
@@ -1,6 +1,6 @@
11 #!/usr/bin/env python3
22 import subprocess
3-
3+import os.path
44 class clearcache():
55 def __init__(self, path):
66 rpath = path + r"/*"
@@ -13,6 +13,9 @@ class clearcache():
1313 rawout = output.stdout.decode("UTF-8")
1414 size = [int(s) for s in rawout.split() if s.isdigit()][0]
1515 return size
16+ def check_dir(self):
17+ return os.path.isfile(r"/var/cache/apt/pkgcache.bin")
18+
1619 def cleanit(self):
1720 cmd = "sudo rm -r " + self.removepath
1821 subprocess.run(cmd, shell=True)
@@ -55,26 +58,4 @@ def yesno(choice):
5558 elif choice.upper() == 'N':
5659 return False
5760 else:
58- return "Error"
59-
60-def swich(choice):
61- if choice == "":
62- return "Error"
63- try:
64- choice = int(choice[0])
65- except ValueError:
66- return "Please enter as an integer."
67- try:
68- task = list[choice - 1]
69- except IndexError:
70- return "The task is not find."
71- return task
72-
73-inst = clearcache(r"/var/cache/apt")
74-#Main
75-print("APT-cache size is {}MiB.\nAre you clean it?".format(inst.get_cachesize()))
76-anser = yesno(input("Y/n "))
77-if anser == True:
78- inst.cleanit()
79-else:
80- exit(0)
61+ return "Error"
\ No newline at end of file
Show on old repository browser