mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-12-11 20:24:04 +03:00
examples: Add/fix PEP 484 type annotation
Signed-off-by: Philipp Hahn <hahn@univention.de>
This commit is contained in:
committed by
Philipp Hahn
parent
5434ed53ff
commit
9cf539a2a8
@@ -5,7 +5,7 @@ import libvirt
|
||||
import sys
|
||||
import time
|
||||
|
||||
def usage():
|
||||
def usage() -> None:
|
||||
print("Usage: %s [URI] NETWORK" % sys.argv[0])
|
||||
print(" Print leases info for a given virtual network")
|
||||
|
||||
@@ -39,7 +39,7 @@ if not leases:
|
||||
print("Failed to get leases for %s" % net.name())
|
||||
sys.exit(0)
|
||||
|
||||
def toIPAddrType(addrType):
|
||||
def toIPAddrType(addrType: int) -> str:
|
||||
if addrType == libvirt.VIR_IP_ADDR_TYPE_IPV4:
|
||||
return "ipv4"
|
||||
elif addrType == libvirt.VIR_IP_ADDR_TYPE_IPV6:
|
||||
|
||||
Reference in New Issue
Block a user