Skip to content
This repository
Browse code

Fix issue with locale.nl_langinfo() not being available on Windows.

  • Loading branch information...
commit 737c59b2c68e8c3a5aafc3d79cb97bb2e09710fe 1 parent 615896d
John Benediktsson authored

Showing 1 changed file with 3 additions and 11 deletions. Show diff stats Hide diff stats

  1. +3 11 tracstats/web_ui.py
14 tracstats/web_ui.py
@@ -723,18 +723,10 @@ def _process_code(self, req, cursor, where, data):
723 723 'y': y,})
724 724 data['byhour'] = stats
725 725
726   - days = dict((day, i) for i, day in
727   - enumerate((locale.nl_langinfo(locale.ABDAY_1),
728   - locale.nl_langinfo(locale.ABDAY_2),
729   - locale.nl_langinfo(locale.ABDAY_3),
730   - locale.nl_langinfo(locale.ABDAY_4),
731   - locale.nl_langinfo(locale.ABDAY_5),
732   - locale.nl_langinfo(locale.ABDAY_6),
733   - locale.nl_langinfo(locale.ABDAY_7))))
734   - d = dict((i, 0) for i in range(7))
  726 + d = dict((str(i), 0) for i in range(7))
735 727 for rev, t, author, _, _ in revisions:
736   - day = time.strftime('%a', time.localtime(t))
737   - d[days[day]] += 1
  728 + day = time.strftime('%w', time.localtime(t))
  729 + d[day] += 1
738 730 stats = []
739 731 for x, y in sorted(d.iteritems()):
740 732 stats.append({'x': x,

0 comments on commit 737c59b

Please sign in to comment.
Something went wrong with that request. Please try again.