Skip to content

Commit

Permalink
Make build time display more human friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
fabricedesre committed May 4, 2016
1 parent 7a439e6 commit 5b32862
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions python/servo/build_commands.py
Expand Up @@ -9,6 +9,7 @@

from __future__ import print_function, unicode_literals

import datetime
import os
import os.path as path
import sys
Expand Down Expand Up @@ -85,7 +86,7 @@ def notify_build_done(elapsed):
"""Generate desktop notification when build is complete and the
elapsed build time was longer than 30 seconds."""
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):
Expand Down Expand Up @@ -240,7 +241,7 @@ def build(self, target=None, release=False, dev=False, jobs=None,
# Generate Desktop Notification if elapsed-time > some threshold value
notify_build_done(elapsed)

print("Build completed in %0.2fs" % elapsed)
print("Build completed in %s" % str(datetime.timedelta(seconds=elapsed)))
return status

@Command('build-cef',
Expand Down Expand Up @@ -276,7 +277,7 @@ def build_cef(self, jobs=None, verbose=False, release=False):
# Generate Desktop Notification if elapsed-time > some threshold value
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

Expand Down Expand Up @@ -313,7 +314,7 @@ def build_geckolib(self, jobs=None, verbose=False, release=False):
# Generate Desktop Notification if elapsed-time > some threshold value
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

Expand Down Expand Up @@ -351,7 +352,7 @@ def build_gonk(self, jobs=None, verbose=False, release=False):
# Generate Desktop Notification if elapsed-time > some threshold value
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

Expand Down

0 comments on commit 5b32862

Please sign in to comment.