Skip to content

Commit

Permalink
string formatting - line 112 (#7881)
Browse files Browse the repository at this point in the history
% is used to cast objects, %s to string etc. now, if int or float, the corresponding formatting (like %d) should be used instead of converting via str() then passing via  %s (double job as the purpose of formatting is precisely to allow even numbers)

now .format() is supported since py2.7 . it is more flexible and less dense
  • Loading branch information
Abdur-rahmaanJ authored and clefebvre committed Sep 24, 2018
1 parent b888e56 commit ffbeeaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/cinnamon-stap-monitor/cinnamon-stap-monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ def update_timer_label(self):

elapsed = now - self.start_time

string = str(timedelta(seconds=int(elapsed + .5)))
time_passed = timedelta(seconds=int(elapsed + .5))

self.timer_label.set_text("Elapsed time: %s" % string)
self.timer_label.set_text("Elapsed time: {}".format(time_passed))

return True

Expand Down

0 comments on commit ffbeeaf

Please sign in to comment.