ftao / python-ifcfg

Python cross-platform network interface discovery (ifconfig/ipconfig/ip)
BSD 3-Clause "New" or "Revised" License
55 stars 37 forks source link

WindowsParser support for _default_interface #25

Open PaluMacil opened 6 years ago

PaluMacil commented 6 years ago

_default_interface throws an attribute exception on Windows. I'm only a hobbyist in Python (work is C#) so I could be missing something, but it looks like this is only implemented for Unix. It also looks fairly easy to add. If I'm not misunderstanding anything, I'd like to make a pull request. I'm using your library for observing Raspberry Pis I'll register to my home network, but I figure I might as well use Windows to test so that I can make the library better for cross-compat cases.

benjaoming commented 6 years ago

There are challenges on Windows indeed! Your input is most welcome!

PaluMacil commented 6 years ago

If you know things that are missing in Windows and make an issue (or issues) listing them with help wanted tags, I'm sure people would start picking them up. For the usefulness of this library, it doesn't seem that complicated to develop new features.

PaluMacil commented 3 years ago

To clarify my plans, I am using more Python now (primary language at work), but I have not had any need for this feature on Windows yet since I've been even more rarely on Windows machines. However! It looks like @dogwynn made a PR that resolves this request for Windows. I can certainly close this if there is nothing else needed here.

benjaoming commented 3 years ago

@PaluMacil all contributions are welcome! I don't run Windows so I have no idea what specific issues can be. But I would say that localization of the ipconfig command seems to be the major issue, and then probably some flags from ifconfig aren't fully implemented.

I've just release #56 in 0.22