XayOn / pyrcrack

Python Aircrack-ng bindings
122 stars 30 forks source link

Expose results as iterators #15

Closed XayOn closed 4 years ago

XayOn commented 4 years ago

Detailed Description

Results could be exposed as iterators. This way we could raise StopIteration() when current process has stopped.

Context

This would allow for:

async with pyrcrack.AirodumpNg() as pdump: async for results in pdump.run('wlan0mon0', write_interval=1): print(results)

Possible Implementation

Your Environment

XayOn commented 4 years ago

Actually, this probably calls for a whole new API. I no longer see the "self.meta" thing as viable, and is surely not the most intuitive thing. I belive an async generator would be the answer to both issues, with each class having a "results" async property that will be called each time.