# HG changeset patch # User Tero Marttila # Date 1424960226 -7200 # Node ID 51bab9649e7773d3bfa8a6e388742ab31fa1cd11 # Parent d472f2eb266b6ce0f6f1cac6d380367362a98440 pvl.dns.parse_prefix: fixup doc diff -r d472f2eb266b -r 51bab9649e77 pvl/dns/reverse.py --- a/pvl/dns/reverse.py Thu Feb 26 16:14:01 2015 +0200 +++ b/pvl/dns/reverse.py Thu Feb 26 16:17:06 2015 +0200 @@ -89,14 +89,18 @@ def parse_prefix (prefix) : """ - Return an ipaddr.IPNetwork from given IPv4/IPv6 prefix. + Return an ipaddr.IPNetwork from given filesystem-compatbile IPv4/IPv6 prefix-ish variant. + + Supports partial IPv4 prefixes on octet boundaries. + Supports partial IPv6 prefixes on nibble boundaries. + Supports IPv4 prefxies using "-" as the prefix separator in place of "/". >>> parse_prefix('127.0.0.0/8') IPv4Network('127.0.0.0/8') >>> parse_prefix('192.0.2.128/26') IPv4Network('192.0.2.128/26') >>> parse_prefix('192.0.2.128-26') - IPv4Network('192.0.2.128-26') + IPv4Network('192.0.2.128/26') >>> parse_prefix('127.') IPv4Network('127.0.0.0/8') >>> parse_prefix('10')