diff options
author | Gerrat Rickert <grickert@coldstorage.com> | 2016-12-21 17:01:43 -0500 |
---|---|---|
committer | Gerrat Rickert <grickert@coldstorage.com> | 2016-12-21 17:01:43 -0500 |
commit | 7023d87738b298c6b6588dedebdead26b65904a4 (patch) | |
tree | 3b6aa402c8618188646af1939544acaec42cc983 | |
parent | 023b707f83bb1805dafdcd38ea5b1adfbf83d7e9 (diff) | |
download | pysnmp-git-7023d87738b298c6b6588dedebdead26b65904a4.tar.gz |
Removed tuple unpacking in function signatures in twisted since removed in Python 3
11 files changed, 35 insertions, 14 deletions
diff --git a/examples/hlapi/twisted/agent/ntforg/default-v1-trap.py b/examples/hlapi/twisted/agent/ntforg/default-v1-trap.py index e8b05451..4d1a2700 100644 --- a/examples/hlapi/twisted/agent/ntforg/default-v1-trap.py +++ b/examples/hlapi/twisted/agent/ntforg/default-v1-trap.py @@ -24,7 +24,9 @@ from twisted.internet.task import react from pysnmp.hlapi.twisted import * -def success((errorStatus, errorIndex, varBinds), hostname): +def success(args, hostname): + (errorStatus, errorIndex, varBinds) = args + if errorStatus: print('%s: %s at %s' % ( hostname, diff --git a/examples/hlapi/twisted/agent/ntforg/multiple-notifications-at-once.py b/examples/hlapi/twisted/agent/ntforg/multiple-notifications-at-once.py index fc6fbf3c..e9d199e9 100644 --- a/examples/hlapi/twisted/agent/ntforg/multiple-notifications-at-once.py +++ b/examples/hlapi/twisted/agent/ntforg/multiple-notifications-at-once.py @@ -27,7 +27,9 @@ from twisted.internet.task import react from pysnmp.hlapi.twisted import * -def success((errorStatus, errorIndex, varBinds), hostname): +def success(args, hostname): + (errorStatus, errorIndex, varBinds) = args + if errorStatus: print('%s: %s at %s' % (hostname, errorStatus.prettyPrint(), diff --git a/examples/hlapi/twisted/manager/cmdgen/custom-timeout-and-retries.py b/examples/hlapi/twisted/manager/cmdgen/custom-timeout-and-retries.py index f0419fa7..a1ff7850 100644 --- a/examples/hlapi/twisted/manager/cmdgen/custom-timeout-and-retries.py +++ b/examples/hlapi/twisted/manager/cmdgen/custom-timeout-and-retries.py @@ -19,7 +19,9 @@ from twisted.internet.task import react from pysnmp.hlapi.twisted import * -def success((errorStatus, errorIndex, varBinds), hostname): +def success(args, hostname): + (errorStatus, errorIndex, varBinds) = args + if errorStatus: print('%s: %s at %s' % (hostname, errorStatus.prettyPrint(), diff --git a/examples/hlapi/twisted/manager/cmdgen/getbulk-to-eom.py b/examples/hlapi/twisted/manager/cmdgen/getbulk-to-eom.py index e2b3ebb7..d3675451 100644 --- a/examples/hlapi/twisted/manager/cmdgen/getbulk-to-eom.py +++ b/examples/hlapi/twisted/manager/cmdgen/getbulk-to-eom.py @@ -20,7 +20,9 @@ from twisted.internet.task import react from pysnmp.hlapi.twisted import * -def success((errorStatus, errorIndex, varBindTable), reactor, snmpEngine): +def success(args, reactor, snmpEngine): + (errorStatus, errorIndex, varBindTable) = args + if errorStatus: print('%s: %s at %s' % (hostname, errorStatus.prettyPrint(), diff --git a/examples/hlapi/twisted/manager/cmdgen/multiple-concurrent-queries.py b/examples/hlapi/twisted/manager/cmdgen/multiple-concurrent-queries.py index 042c8e33..92317cac 100644 --- a/examples/hlapi/twisted/manager/cmdgen/multiple-concurrent-queries.py +++ b/examples/hlapi/twisted/manager/cmdgen/multiple-concurrent-queries.py @@ -22,7 +22,9 @@ from twisted.internet.task import react from pysnmp.hlapi.twisted import * -def success((errorStatus, errorIndex, varBinds), hostname): +def success(args, hostname): + (errorStatus, errorIndex, varBindTable) = args + if errorStatus: print('%s: %s at %s' % (hostname, errorStatus.prettyPrint(), diff --git a/examples/hlapi/twisted/manager/cmdgen/pull-mibs-from-multiple-agents-at-once.py b/examples/hlapi/twisted/manager/cmdgen/pull-mibs-from-multiple-agents-at-once.py index 179d205f..41d779e6 100644 --- a/examples/hlapi/twisted/manager/cmdgen/pull-mibs-from-multiple-agents-at-once.py +++ b/examples/hlapi/twisted/manager/cmdgen/pull-mibs-from-multiple-agents-at-once.py @@ -20,7 +20,9 @@ from twisted.internet.task import react from pysnmp.hlapi.twisted import * -def success((errorStatus, errorIndex, varBindTable), reactor, snmpEngine, hostname): +def success(args, reactor, snmpEngine, hostname): + (errorStatus, errorIndex, varBindTable) = args + if errorStatus: print('%s: %s at %s' % (hostname, errorStatus.prettyPrint(), diff --git a/examples/hlapi/twisted/manager/cmdgen/pull-whole-mib.py b/examples/hlapi/twisted/manager/cmdgen/pull-whole-mib.py index e7c7c5fe..b2b245e6 100644 --- a/examples/hlapi/twisted/manager/cmdgen/pull-whole-mib.py +++ b/examples/hlapi/twisted/manager/cmdgen/pull-whole-mib.py @@ -19,7 +19,9 @@ from twisted.internet.task import react from pysnmp.hlapi.twisted import * -def success((errorStatus, errorIndex, varBindTable), reactor, snmpEngine): +def success(args, reactor, snmpEngine): + (errorStatus, errorIndex, varBindTable) = args + if errorStatus: print('%s: %s at %s' % (hostname, errorStatus.prettyPrint(), diff --git a/examples/hlapi/twisted/manager/cmdgen/v1-get.py b/examples/hlapi/twisted/manager/cmdgen/v1-get.py index 6cb2f17e..21719ff7 100644 --- a/examples/hlapi/twisted/manager/cmdgen/v1-get.py +++ b/examples/hlapi/twisted/manager/cmdgen/v1-get.py @@ -19,7 +19,9 @@ from twisted.internet.task import react from pysnmp.hlapi.twisted import * -def success((errorStatus, errorIndex, varBinds), hostname): +def success(args, hostname): + (errorStatus, errorIndex, varBinds) = args + if errorStatus: print('%s: %s at %s' % (hostname, errorStatus.prettyPrint(), diff --git a/pysnmp/carrier/twisted/base.py b/pysnmp/carrier/twisted/base.py index 590717df..86a01266 100644 --- a/pysnmp/carrier/twisted/base.py +++ b/pysnmp/carrier/twisted/base.py @@ -21,4 +21,4 @@ class AbstractTwistedTransport(AbstractTransport): def __init__(self, sock=None, sockMap=None): self._writeQ = [] - DgramTwistedTransport.__init__(self) +# DgramTwistedTransport.__init__(self) diff --git a/pysnmp/hlapi/twisted/cmdgen.py b/pysnmp/hlapi/twisted/cmdgen.py index 594ee776..edc3afef 100644 --- a/pysnmp/hlapi/twisted/cmdgen.py +++ b/pysnmp/hlapi/twisted/cmdgen.py @@ -88,7 +88,8 @@ def getCmd(snmpEngine, authData, transportTarget, contextData, >>> from twisted.internet.task import react >>> from pysnmp.hlapi.twisted import * >>> - >>> def success((errorStatus, errorIndex, varBinds)): + >>> def success(args): + ... (errorStatus, errorIndex, varBinds) = args ... print(errorStatus, errorIndex, varBind) ... >>> def failure(errorIndication): @@ -199,7 +200,8 @@ def setCmd(snmpEngine, authData, transportTarget, contextData, >>> from twisted.internet.task import react >>> from pysnmp.hlapi.twisted import * >>> - >>> def success((errorStatus, errorIndex, varBinds)): + >>> def success(args): + ... (errorStatus, errorIndex, varBinds) = args ... print(errorStatus, errorIndex, varBind) ... >>> def failure(errorIndication): @@ -314,7 +316,8 @@ def nextCmd(snmpEngine, authData, transportTarget, contextData, >>> from twisted.internet.task import react >>> from pysnmp.hlapi.twisted import * >>> - >>> def success((errorStatus, errorIndex, varBindTable)): + >>> def success(args): + ... (errorStatus, errorIndex, varBinds) = args ... print(errorStatus, errorIndex, varBindTable) ... >>> def failure(errorIndication): @@ -439,7 +442,8 @@ def bulkCmd(snmpEngine, authData, transportTarget, contextData, >>> from twisted.internet.task import react >>> from pysnmp.hlapi.twisted import * >>> - >>> def success((errorStatus, errorIndex, varBindTable)): + >>> def success(args): + ... (errorStatus, errorIndex, varBinds) = args ... print(errorStatus, errorIndex, varBindTable) ... >>> def failure(errorIndication): diff --git a/pysnmp/hlapi/twisted/ntforg.py b/pysnmp/hlapi/twisted/ntforg.py index fa5ec178..5e561f99 100644 --- a/pysnmp/hlapi/twisted/ntforg.py +++ b/pysnmp/hlapi/twisted/ntforg.py @@ -95,7 +95,8 @@ def sendNotification(snmpEngine, authData, transportTarget, contextData, >>> from twisted.internet.task import react >>> from pysnmp.hlapi.twisted import * >>> - >>> def success((errorStatus, errorIndex, varBinds)): + >>> def success(args): + ... (errorStatus, errorIndex, varBinds) = args ... print(errorStatus, errorIndex, varBind) ... >>> def failure(errorIndication): |