Closed blckjack closed 6 years ago
Hi @blckjack, unfortunately the API docs aren't displaying properly. I'll try and fix them soon. In the meantime, the add method takes a list of entries:
def add(self, entries=None, force=False, allow_address_duplication=False):
"""
Add instances of HostsEntry to the instance of Hosts.
:param entries: A list of instances of HostsEntry
:param force: Remove matching before adding
:param allow_address_duplication: Allow using multiple entries for same address
:return: The counts of successes and failures
"""
To add a single HostsEntry, just enclose it in square brackets, so:
hosts.add(HostsEntry(entry_type='ipv4', address=address, names=names))
becomes:
hosts.add([HostsEntry(entry_type='ipv4', address=address, names=names)])
Docs now fixed: http://python-hosts.readthedocs.io/en/latest/
Detail on Hosts and HostsEntry are here: http://python-hosts.readthedocs.io/en/latest/python_hosts.hosts.html
Hey there, thanks for this lib! I have an issue, but not sure, about expected behavior of the code. So I have 2 lists:
And want to run my tests in all possible variations:
unfortunatelly exception appears:
probably, I missed something but, anyway, looking forward your assist. thx, ^_^