update ssview

pull/32/head
ubuntu 2018-12-04 16:44:41 +08:00
parent 0c96e6736d
commit b085c6b9ca
1 changed files with 4 additions and 2 deletions

View File

@ -13,7 +13,8 @@ import requests
import time import time
from prettytable import PrettyTable from prettytable import PrettyTable
cp = 'clear' if 'linux' in sys.platform else 'cls' scroll = False
clear = lambda: os.system('clear' if 'linux' in sys.platform else 'cls')
def sscmd(address): def sscmd(address):
while True: while True:
@ -57,7 +58,8 @@ def sscmd(address):
"%d%%" % (float(i["hdd_used"]) / i["hdd_total"] * 100), "%d%%" % (float(i["hdd_used"]) / i["hdd_total"] * 100),
] ]
) )
os.system(cp) if scroll is True:
clear()
print(ss) print(ss)
time.sleep(1) time.sleep(1)