summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelie <elie>2005-06-28 17:39:58 +0000
committerelie <elie>2005-06-28 17:39:58 +0000
commit4961ff7d1584a21fa2df5e7f586cc28400a5a1bc (patch)
treeb5e9dec00ff15058476026058a7757afbda3efb5
parent34c847ceb4d22cb175430afdb767ebdf4b8075e7 (diff)
downloadpysnmp-4961ff7d1584a21fa2df5e7f586cc28400a5a1bc.tar.gz
prettyIn & prettyOut become public methods
-rw-r--r--pysnmp/proto/rfc1155.py4
-rw-r--r--pysnmp/proto/rfc1902.py8
-rw-r--r--pysnmp/smi/mibs/SNMPv2-TC.py4
-rw-r--r--pysnmp/smi/mibs/SNMPv2-TM.py2
4 files changed, 9 insertions, 9 deletions
diff --git a/pysnmp/proto/rfc1155.py b/pysnmp/proto/rfc1155.py
index 08e13ac..64fe9a1 100644
--- a/pysnmp/proto/rfc1155.py
+++ b/pysnmp/proto/rfc1155.py
@@ -42,8 +42,8 @@ class IpAddress(univ.OctetString):
4, 4
)
- def _prettyIn(self, value): return ipAddressPrettyIn(value)
- def _prettyOut(self, value): return ipAddressPrettyOut(value)
+ def prettyIn(self, value): return ipAddressPrettyIn(value)
+ def prettyOut(self, value): return ipAddressPrettyOut(value)
class Counter(univ.Integer):
tagSet = univ.Integer.tagSet.tagImplicitly(
diff --git a/pysnmp/proto/rfc1902.py b/pysnmp/proto/rfc1902.py
index c3cfbb8..698b920 100644
--- a/pysnmp/proto/rfc1902.py
+++ b/pysnmp/proto/rfc1902.py
@@ -25,8 +25,8 @@ class IpAddress(univ.OctetString):
subtypeSpec = univ.OctetString.subtypeSpec+constraint.ValueSizeConstraint(
4, 4
)
- def _prettyIn(self, value): return rfc1155.ipAddressPrettyIn(value)
- def _prettyOut(self, value): return rfc1155.ipAddressPrettyOut(value)
+ def prettyIn(self, value): return rfc1155.ipAddressPrettyIn(value)
+ def prettyOut(self, value): return rfc1155.ipAddressPrettyOut(value)
class Counter32(univ.Integer):
tagSet = univ.Integer.tagSet.tagImplicitly(
@@ -85,7 +85,7 @@ class Bits(univ.OctetString):
self, value, tagSet, subtypeSpec
)
- def _prettyIn(self, bits):
+ def prettyIn(self, bits):
if type(bits) == types.StringType:
return bits # raw bitstring
octets = []
@@ -101,7 +101,7 @@ class Bits(univ.OctetString):
octets[d] = octets[d] | 0x01 << (7-m)
return string.join(map(lambda x: chr(x), octets))
- def _prettyOut(self, value):
+ def prettyOut(self, value):
names = []
octets = tuple(map(None, value))
i = 0
diff --git a/pysnmp/smi/mibs/SNMPv2-TC.py b/pysnmp/smi/mibs/SNMPv2-TC.py
index 1a09430..c0e25af 100644
--- a/pysnmp/smi/mibs/SNMPv2-TC.py
+++ b/pysnmp/smi/mibs/SNMPv2-TC.py
@@ -21,7 +21,7 @@ class TextualConvention:
def getDescription(self): return self.description
def getReference(self): return self.reference
- def _prettyOut(self, value): # override asn1 type method
+ def prettyOut(self, value): # override asn1 type method
"""Implements DISPLAY-HINT evaluation"""
if self.displayHint and self.__integer.isSuperTypeOf(self):
t, f = apply(lambda t, f=0: (t, f), split(self.displayHint, '-'))
@@ -145,7 +145,7 @@ class TextualConvention:
# )
# XXX
-# def _prettyIn(self, value):
+# def prettyIn(self, value):
# # XXX parse TC syntax
# return str(value)
diff --git a/pysnmp/smi/mibs/SNMPv2-TM.py b/pysnmp/smi/mibs/SNMPv2-TM.py
index b395cfe..5427568 100644
--- a/pysnmp/smi/mibs/SNMPv2-TM.py
+++ b/pysnmp/smi/mibs/SNMPv2-TM.py
@@ -16,7 +16,7 @@ class SnmpUDPAddress(TextualConvention, OctetString):
subtypeSpec = OctetString.subtypeSpec + constraint.ValueSizeConstraint(6, 6)
displayHint = "1d.1d.1d.1d/2d"
- def _prettyIn(self, value):
+ def prettyIn(self, value):
self.__nativeValue = value
return "0000/0" # XXX