mirror of
https://github.com/servo/servo.git
synced 2025-06-20 15:18:58 +01:00
Make build time display more human friendly
This commit is contained in:
parent
7a439e6237
commit
5b328623af
1 changed files with 6 additions and 5 deletions
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
from __future__ import print_function, unicode_literals
|
from __future__ import print_function, unicode_literals
|
||||||
|
|
||||||
|
import datetime
|
||||||
import os
|
import os
|
||||||
import os.path as path
|
import os.path as path
|
||||||
import sys
|
import sys
|
||||||
|
@ -85,7 +86,7 @@ def notify_build_done(elapsed):
|
||||||
"""Generate desktop notification when build is complete and the
|
"""Generate desktop notification when build is complete and the
|
||||||
elapsed build time was longer than 30 seconds."""
|
elapsed build time was longer than 30 seconds."""
|
||||||
if elapsed > 30:
|
if elapsed > 30:
|
||||||
notify("Servo build", "Completed in %0.2fs" % elapsed)
|
notify("Servo build", "Completed in %s" % str(datetime.timedelta(seconds=elapsed)))
|
||||||
|
|
||||||
|
|
||||||
def notify(title, text):
|
def notify(title, text):
|
||||||
|
@ -240,7 +241,7 @@ class MachCommands(CommandBase):
|
||||||
# Generate Desktop Notification if elapsed-time > some threshold value
|
# Generate Desktop Notification if elapsed-time > some threshold value
|
||||||
notify_build_done(elapsed)
|
notify_build_done(elapsed)
|
||||||
|
|
||||||
print("Build completed in %0.2fs" % elapsed)
|
print("Build completed in %s" % str(datetime.timedelta(seconds=elapsed)))
|
||||||
return status
|
return status
|
||||||
|
|
||||||
@Command('build-cef',
|
@Command('build-cef',
|
||||||
|
@ -276,7 +277,7 @@ class MachCommands(CommandBase):
|
||||||
# Generate Desktop Notification if elapsed-time > some threshold value
|
# Generate Desktop Notification if elapsed-time > some threshold value
|
||||||
notify_build_done(elapsed)
|
notify_build_done(elapsed)
|
||||||
|
|
||||||
print("CEF build completed in %0.2fs" % elapsed)
|
print("CEF build completed in %s" % str(datetime.timedelta(seconds=elapsed)))
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
@ -313,7 +314,7 @@ class MachCommands(CommandBase):
|
||||||
# Generate Desktop Notification if elapsed-time > some threshold value
|
# Generate Desktop Notification if elapsed-time > some threshold value
|
||||||
notify_build_done(elapsed)
|
notify_build_done(elapsed)
|
||||||
|
|
||||||
print("GeckoLib build completed in %0.2fs" % elapsed)
|
print("GeckoLib build completed in %s" % str(datetime.timedelta(seconds=elapsed)))
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
@ -351,7 +352,7 @@ class MachCommands(CommandBase):
|
||||||
# Generate Desktop Notification if elapsed-time > some threshold value
|
# Generate Desktop Notification if elapsed-time > some threshold value
|
||||||
notify_build_done(elapsed)
|
notify_build_done(elapsed)
|
||||||
|
|
||||||
print("Gonk build completed in %0.2fs" % elapsed)
|
print("Gonk build completed in %s" % str(datetime.timedelta(seconds=elapsed)))
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue