blue-yonder / bonfire

A CLI Graylog Client with Follow Mode
BSD 3-Clause "New" or "Revised" License
72 stars 26 forks source link

Error with map object in Python 3.5 #11

Closed xavierhardy closed 8 years ago

xavierhardy commented 8 years ago

Starting Python 3, map returns an iterator instead of a list.

Instead of using the map built-in function use:

formatted_msgs = [formatter(m) for m in result.messages]

in output.py, line 36

Here is the original error:

Traceback (most recent call last):
  File "/home/me/bin/bonfire", line 9, in <module>
    load_entry_point('bonfire==0.0.6.post0.dev12+g0c56782', 'console_scripts', 'bonfire')()
  File "/home/me/lib/python3.5/site-packages/click/core.py", line 610, in __call__
    return self.main(*args, **kwargs)
  File "/home/me/lib/python3.5/site-packages/click/core.py", line 590, in main
    rv = self.invoke(ctx)
  File "/home/me/lib/python3.5/site-packages/click/core.py", line 782, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/me/lib/python3.5/site-packages/click/core.py", line 416, in invoke
    return callback(*args, **kwargs)
  File "/home/me/lib/python3.5/site-packages/bonfire/cli.py", line 185, in run
    run_logprint(gl_api, q, formatter, follow, interval, latency, output)
  File "/home/me/lib/python3.5/site-packages/bonfire/output.py", line 23, in run_logprint
    result = run_logprint(api, query, formatter, follow=False, output=output)
  File "/home/me/lib/python3.5/site-packages/bonfire/output.py", line 38, in run_logprint
    formatted_msgs.reverse()
AttributeError: 'map' object has no attribute 'reverse'