From 002bb632e888e90577c87111f99674be153f79d0 Mon Sep 17 00:00:00 2001 From: Ilya Etingof Date: Thu, 31 Mar 2016 00:04:43 +0200 Subject: pep8 fixes --- examples/smi/agent/custom-managed-object.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'examples/smi') diff --git a/examples/smi/agent/custom-managed-object.py b/examples/smi/agent/custom-managed-object.py index 56fd15c8..87dea364 100644 --- a/examples/smi/agent/custom-managed-object.py +++ b/examples/smi/agent/custom-managed-object.py @@ -12,27 +12,29 @@ mibBuilder = builder.MibBuilder() # A base class for a custom Managed Object MibScalarInstance, = mibBuilder.importSymbols( 'SNMPv2-SMI', 'MibScalarInstance' - ) +) # Managed object specification sysLocation, = mibBuilder.importSymbols('SNMPv2-MIB', 'sysLocation') + # Custom Managed Object class MySysLocationInstance(MibScalarInstance): # noinspection PyUnusedLocal def readGet(self, name, *args): # Just return a custom value return name, self.syntax.clone('The Leaky Cauldron') - + + sysLocationInstance = MySysLocationInstance( sysLocation.name, (0,), sysLocation.syntax - ) +) # Register Managed Object with a MIB tree mibBuilder.exportSymbols( # '__' prefixed MIB modules take precedence on indexing '__MY-LOCATION-MIB', sysLocationInstance=sysLocationInstance - ) +) if __name__ == '__main__': # -- cgit v1.2.1