mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-05 17:00:58 +01:00
ugg
This commit is contained in:
parent
cc7dd91553
commit
23f606666d
1 changed files with 3 additions and 1 deletions
|
@ -28,7 +28,7 @@ def _uptime_osx():
|
|||
"""Returns the uptime on mac / darwin."""
|
||||
global _BOOTTIME
|
||||
bt = xlimps.macutils.sysctlbyname("kern.boottime", return_str=False)
|
||||
bt = struct.unpack('@ii', bt)
|
||||
bt = struct.unpack('@ll', bt)
|
||||
bt = bt[0] + bt[1]*1e-6
|
||||
if bt == 0.0:
|
||||
return None
|
||||
|
@ -199,6 +199,7 @@ def _uptime_solaris():
|
|||
return time.time() - _BOOTTIME
|
||||
return None
|
||||
|
||||
|
||||
def _uptime_syllable():
|
||||
"""Returns uptime in seconds or None, on Syllable."""
|
||||
global _BOOTTIME
|
||||
|
@ -208,6 +209,7 @@ def _uptime_syllable():
|
|||
except (NameError, OSError):
|
||||
return None
|
||||
|
||||
|
||||
def _uptime_windows():
|
||||
"""
|
||||
Returns uptime in seconds or None, on Windows. Warning: may return
|
||||
|
|
Loading…
Add table
Reference in a new issue