Instagram/redis-faina — pull request #1 by bobrik (2012-05-16 06:06:26+00:00)
Title: Fixed exception for empty list of top prefixes

I've got an exception for empty list of top prefixes:

```
Traceback (most recent call last):
File "redis-faina.py", line 139, in
counter.print_stats()
File "redis-faina.py", line 118, in print_stats
self._pretty_print(self._top_n(self.prefixes), 'Top Prefixes')
File "redis-faina.py", line 58, in _pretty_print
max_key_len = max((len(x[0]) for x in result))
ValueError: max() arg is an empty sequence
```

so I fixed it. Now `_pretty_print` will use `n/a` placeholder for empty lists.

Btw, prefix should be configurable.