diff options
author | Ilya Etingof <etingof@gmail.com> | 2019-02-10 16:38:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-10 16:38:35 +0100 |
commit | 588b9b902d191d8010cb6b247fcb07887d59542c (patch) | |
tree | 419b01d2598e91331db784ac3a6675324aba8c24 /pysnmp/hlapi/v1arch/dispatch.py | |
parent | 9664858b145140a4fbb2a22b633c1ab41c2555bd (diff) | |
download | pysnmp-git-588b9b902d191d8010cb6b247fcb07887d59542c.tar.gz |
Uppercase global constants (#238)
This is a massive patch essentially upper-casing global/class attributes
that mean to be constants.
Some previously exposed constants have been preserved for compatibility
reasons (notably, in `hlapi`), though the rest might break user code relying
on pysnmp 4.
Diffstat (limited to 'pysnmp/hlapi/v1arch/dispatch.py')
-rw-r--r-- | pysnmp/hlapi/v1arch/dispatch.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pysnmp/hlapi/v1arch/dispatch.py b/pysnmp/hlapi/v1arch/dispatch.py index 48c67599..e52c999d 100644 --- a/pysnmp/hlapi/v1arch/dispatch.py +++ b/pysnmp/hlapi/v1arch/dispatch.py @@ -33,13 +33,14 @@ class AbstractSnmpDispatcher(object): works with SNMP must have its own `SnmpDispatcher` instance. """ - protoDispatcher = None + PROTO_DISPATCHER = None def __init__(self, transportDispatcher=None): if transportDispatcher: self.transportDispatcher = transportDispatcher + else: - self.transportDispatcher = self.protoDispatcher() + self.transportDispatcher = self.PROTO_DISPATCHER() self._automaticDispatcher = transportDispatcher is not self.transportDispatcher self._configuredTransports = set() @@ -77,7 +78,7 @@ class AbstractSnmpDispatcher(object): ) self._configuredTransports.add(transportTarget.transportDomain) - pMod = api.protoModules[authData.mpModel] + pMod = api.PROTOCOL_MODULES[authData.mpModel] reqMsg = pMod.Message() pMod.apiMessage.setDefaults(reqMsg) @@ -114,9 +115,9 @@ class AbstractSnmpDispatcher(object): except error.ProtocolError: return null # n.b the whole buffer gets dropped - debug.logger & debug.flagDsp and debug.logger('receiveMessage: msgVersion %s, msg decoded' % mpModel) + debug.logger & debug.FLAG_DSP and debug.logger('receiveMessage: msgVersion %s, msg decoded' % mpModel) - pMod = api.protoModules[mpModel] + pMod = api.PROTOCOL_MODULES[mpModel] while wholeMsg: rspMsg, wholeMsg = decoder.decode(wholeMsg, asn1Spec=pMod.Message()) |