Made the output of gkstats a little prettier.

This commit is contained in:
Jeremy Fincher 2003-10-27 05:13:31 +00:00
parent fc11ff4f24
commit aab9d8a3a0

View File

@ -124,14 +124,22 @@ class Gameknot(callbacks.PrivmsgCommandAndRegexp):
if 'Team:' in profile: if 'Team:' in profile:
team = self._gkteam.search(profile).group('name') team = self._gkteam.search(profile).group('name')
s = '%s (team: %s) is rated %s and has %s ' \ s = '%s (team: %s) is rated %s and has %s ' \
'and a record of W-%s, L-%s, D-%s (win/loss/draw %%: ' \ 'and a record of %s, %s, and %s ' \
'%.2f/%.2f/%.2f). %s' % \ '(win/loss/draw percentage: %.2f%%/%.2f%%/%.2f%%). %s' % \
(name, team, rating, games, w, l, d, wp, lp, dp, seen) (name, team, rating, games,
utils.nItems(w, 'win'),
utils.nItems(l, 'loss'),
utils.nItems(d, 'draw'),
wp, lp, dp, seen)
else: else:
s = '%s is rated %s and has %s ' \ s = '%s is rated %s and has %s ' \
'and a record of W-%s, L-%s, D-%s (win/loss/draw %%: ' \ 'and a record of %s, %s, and %s ' \
'%.2f/%.2f/%.2f). %s' % \ '(win/loss/draw percentage: %.2f%%/%.2f%%/%.2f%%). %s' % \
(name, rating, games, w, l, d, wp, lp, dp, seen) (name, rating, games,
utils.nItems(w, 'win'),
utils.nItems(l, 'loss'),
utils.nItems(d, 'draw'),
wp, lp, dp, seen)
return s return s
except AttributeError: except AttributeError:
if ('User %s not found!' % name) in profile: if ('User %s not found!' % name) in profile: