MCPcopy Index your code
hub / github.com/retspen/webvirtcloud / __add__

Method __add__

vrtManager/IPy.py:887–901  ·  view source on GitHub ↗

Emulate numeric objects through network aggregation

(self, other)

Source from the content-addressed store, hash-verified

885 return ("IP('%s')" % (self.strCompressed(1)))
886
887 def __add__(self, other):
888 """Emulate numeric objects through network aggregation"""
889 if self.prefixlen() != other.prefixlen():
890 raise ValueError, "Only networks with the same prefixlen can be added."
891 if self.prefixlen < 1:
892 raise ValueError, "Networks with a prefixlen longer than /1 can't be added."
893 if self.version() != other.version():
894 raise ValueError, "Only networks with the same IP version can be added."
895 if self > other:
896 # fixed by Skinny Puppy <skin_pup-IPy@happypoo.com>
897 return other.__add__(self)
898 else:
899 ret = IP(self.int())
900 ret._prefixlen = self.prefixlen() - 1
901 return ret
902
903
904def _parseAddressIPv6(ipstr):

Callers

nothing calls this directly

Calls 4

IPClass · 0.85
prefixlenMethod · 0.80
versionMethod · 0.80
intMethod · 0.80

Tested by

no test coverage detected