Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 620377f

Browse files
committed
windows下插入U盘,访问U盘时会出现错误
1 parent df8e09c commit 620377f

20 files changed

+15
-7
lines changed

__pycache__/index.cpython-37.pyc

1.39 KB
Binary file not shown.
324 Bytes
Binary file not shown.
1.61 KB
Binary file not shown.

lib/__pycache__/task.cpython-37.pyc

4.77 KB
Binary file not shown.
1.84 KB
Binary file not shown.

route/PenetrationSend.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ def PenetrationSendFunc():
1313
diskTotal = 0
1414
diskUsed = 0
1515
for i in io:
16-
o = psutil.disk_usage(i.mountpoint)
17-
diskTotal += o.total
18-
diskUsed += o.used
16+
#windows下插入U盘,访问U盘时会出现"设备未就绪"
17+
try:
18+
o = psutil.disk_usage(i.mountpoint)
19+
diskTotal += o.total
20+
diskUsed += o.used
21+
except:
22+
pass
1923
response = make_response(json.dumps({
2024
'cpu':psutil.cpu_percent(0.5),
2125
'memory':round(m.used/m.total, 3),
404 Bytes
Binary file not shown.
2.24 KB
Binary file not shown.
2.88 KB
Binary file not shown.
2.81 KB
Binary file not shown.

route/__pycache__/file.cpython-37.pyc

10.7 KB
Binary file not shown.
3.58 KB
Binary file not shown.
1.45 KB
Binary file not shown.
4.56 KB
Binary file not shown.
5.65 KB
Binary file not shown.
1.92 KB
Binary file not shown.
4.65 KB
Binary file not shown.

route/echarts.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ def GetPie():
2828
diskUsed = 0 #已用
2929
diskFree = 0 #剩余
3030
for i in io:
31-
o = psutil.disk_usage(i.mountpoint)
32-
diskTotal += int(o.total/(1024.0*1024.0*1024.0))
33-
diskUsed += int(o.used/(1024.0*1024.0*1024.0))
34-
diskFree += int(o.free/(1024.0*1024.0*1024.0))
31+
try:
32+
#若windows下插入U盘,访问U盘磁盘时,会出现"设备未就绪的错误"
33+
o = psutil.disk_usage(i.mountpoint)
34+
diskTotal += int(o.total/(1024.0*1024.0*1024.0))
35+
diskUsed += int(o.used/(1024.0*1024.0*1024.0))
36+
diskFree += int(o.free/(1024.0*1024.0*1024.0))
37+
except:
38+
pass
3539
resJson = []
3640
resJson.append({
3741
'ttl':'CPU状态',
6.66 KB
Binary file not shown.

sqlitedb/mange.db

20 KB
Binary file not shown.

0 commit comments

Comments
 (0)