Merge remote-tracking branch 'origin/main'

This commit is contained in:
Toyga 2023-03-09 11:30:42 +08:00
commit c82038cfd1

View File

@ -1,5 +1,5 @@
import os, io, sys, platform, shutil, time, json, datetime import os, io, sys, platform, shutil, time, json, datetime
import re import re,docker
from api.utils import shell_execute from api.utils import shell_execute
from api.utils import network from api.utils import network
@ -10,6 +10,10 @@ from pathlib import Path
def get_process_perc(app_name): def get_process_perc(app_name):
process_now = "0%" process_now = "0%"
client = docker.from_env()
resp = client.api.pull(app_name, stream=True, decode=True)
for line in resp:
print(json.dumps(line, indent=4))
return process_now return process_now