mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1084519 - Return full uptime string if unable to parse. r=gbrown
This commit is contained in:
parent
ede9c7af78
commit
498ac3ed15
@ -504,12 +504,14 @@ class DeviceManagerADB(DeviceManager):
|
|||||||
if directive == "os" or directive == "all":
|
if directive == "os" or directive == "all":
|
||||||
ret["os"] = self.shellCheckOutput(["getprop", "ro.build.display.id"])
|
ret["os"] = self.shellCheckOutput(["getprop", "ro.build.display.id"])
|
||||||
if directive == "uptime" or directive == "all":
|
if directive == "uptime" or directive == "all":
|
||||||
utime = self.shellCheckOutput(["uptime"])
|
uptime = self.shellCheckOutput(["uptime"])
|
||||||
if (not utime):
|
if not uptime:
|
||||||
raise DMError("error getting uptime")
|
raise DMError("error getting uptime")
|
||||||
m = re.match("up time: ((\d+) days, )*(\d{2}):(\d{2}):(\d{2})", utime)
|
m = re.match("up time: ((\d+) days, )*(\d{2}):(\d{2}):(\d{2})", uptime)
|
||||||
ret["uptime"] = "%d days %d hours %d minutes %d seconds" % tuple(
|
if m:
|
||||||
|
uptime = "%d days %d hours %d minutes %d seconds" % tuple(
|
||||||
[int(g or 0) for g in m.groups()[1:]])
|
[int(g or 0) for g in m.groups()[1:]])
|
||||||
|
ret["uptime"] = uptime
|
||||||
if directive == "process" or directive == "all":
|
if directive == "process" or directive == "all":
|
||||||
ret["process"] = self.shellCheckOutput(["ps"])
|
ret["process"] = self.shellCheckOutput(["ps"])
|
||||||
if directive == "systime" or directive == "all":
|
if directive == "systime" or directive == "all":
|
||||||
|
Loading…
Reference in New Issue
Block a user