| 314 | return version |
| 315 | |
| 316 | def GetBootTime(self): |
| 317 | # 取系统启动时间 |
| 318 | key = 'sys_time' |
| 319 | sys_time = cache.get(key) |
| 320 | if sys_time: return sys_time |
| 321 | import public, math |
| 322 | conf = public.readFile('/proc/uptime').split() |
| 323 | tStr = float(conf[0]) |
| 324 | min = tStr / 60 |
| 325 | hours = min / 60 |
| 326 | days = math.floor(hours / 24) |
| 327 | hours = math.floor(hours - (days * 24)) |
| 328 | min = math.floor(min - (days * 60 * 24) - (hours * 60)) |
| 329 | |
| 330 | sys_time = "{}天".format(int(days)) |
| 331 | if int(days) == 0: |
| 332 | sys_time = "{}小时".format(int(hours)) |
| 333 | if int(hours) == 0: |
| 334 | sys_time = "{}分钟".format(int(min)) |
| 335 | |
| 336 | cache.set(key, sys_time, 300) |
| 337 | return sys_time |
| 338 | # return public.getMsg('SYS_BOOT_TIME',(str(int(days)),str(int(hours)),str(int(min)))) |
| 339 | |
| 340 | def GetCpuInfo(self, interval=1): |
| 341 | # 取CPU信息 |