Skip to content

Commit

Permalink
Changed internal defaults to asyncio.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextm committed Feb 11, 2024
1 parent aa0d689 commit a72e913
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ asyncio.run(run())
$ python3 examples/hlapi/asyncio/manager/cmdgen/usm-sha-aes128.py
SNMPv2-MIB::sysDescr.0 = SunOS zeus.pysnmp.com 4.1.3_U1 1 sun4m
$
$ python3 examples//hlapi/asyncore/sync/agent/ntforg/v3-inform.py
$ python3 examples/hlapi/asyncio/agent/ntforg/v3-inform.py
SNMPv2-MIB::sysUpTime.0 = 0
SNMPv2-MIB::snmpTrapOID.0 = SNMPv2-MIB::warmStart
SNMPv2-MIB::sysName.0 = system name
Expand Down
2 changes: 1 addition & 1 deletion pysnmp/entity/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# License: https://www.pysnmp.com/pysnmp/license.html
#
from pyasn1.compat.octets import null
from pysnmp.carrier.asyncore.dgram import udp, udp6, unix
from pysnmp.carrier.asyncio.dgram import udp, udp6, unix
from pysnmp.proto.secmod.rfc3414.auth import hmacmd5, hmacsha, noauth
from pysnmp.proto.secmod.rfc3414.priv import des, nopriv
from pysnmp.proto.secmod.rfc3826.priv import aes
Expand Down
4 changes: 2 additions & 2 deletions pysnmp/entity/rfc3413/oneliner/cmdgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# All code in this file belongs to obsolete, compatibility wrappers.
# Never use interfaces below for new applications!
#
from pysnmp.hlapi.asyncore import *
from pysnmp.hlapi.asyncore import sync
from pysnmp.hlapi.asyncio import *
from pysnmp.hlapi.asyncio import sync
from pysnmp.hlapi.varbinds import *
from pysnmp.hlapi.lcd import *
from pyasn1.compat.octets import null
Expand Down
4 changes: 2 additions & 2 deletions pysnmp/entity/rfc3413/oneliner/ntforg.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# All code in this file belongs to obsolete, compatibility wrappers.
# Never use interfaces below for new applications!
#
from pysnmp.hlapi.asyncore import *
from pysnmp.hlapi.asyncore import sync
from pysnmp.hlapi.asyncio import *
from pysnmp.hlapi.asyncio import sync
from pysnmp.hlapi.varbinds import *
from pysnmp.hlapi.lcd import *
from pyasn1.compat.octets import null
Expand Down
4 changes: 2 additions & 2 deletions pysnmp/hlapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from pysnmp.hlapi.context import *
from pysnmp.entity.engine import *

# default is synchronous asyncore-based API
from pysnmp.hlapi.asyncore.sync import *
# default is synchronous asyncio-based API
from pysnmp.hlapi.asyncio import *


CommunityData = auth.CommunityData
Expand Down
6 changes: 3 additions & 3 deletions pysnmp/hlapi/asyncore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from pysnmp.smi.rfc1902 import *
from pysnmp.hlapi.auth import *
from pysnmp.hlapi.context import *
from pysnmp.hlapi.asyncore.transport import *
from pysnmp.hlapi.asyncore.cmdgen import *
from pysnmp.hlapi.asyncore.ntforg import *
from pysnmp.hlapi.asyncio.transport import *
from pysnmp.hlapi.asyncio.cmdgen import *
from pysnmp.hlapi.asyncio.ntforg import *
from pysnmp.entity.engine import *
8 changes: 4 additions & 4 deletions pysnmp/hlapi/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class CommunityData:
"""Creates SNMP v1/v2c configuration entry.
This object can be used by
:py:class:`~pysnmp.hlapi.asyncore.AsyncCommandGenerator` or
:py:class:`~pysnmp.hlapi.asyncore.AsyncNotificationOriginator`
:py:class:`~pysnmp.hlapi.asyncio.AsyncCommandGenerator` or
:py:class:`~pysnmp.hlapi.asyncio.AsyncNotificationOriginator`
and their derivatives for adding new entries to Local Configuration
Datastore (LCD) managed by :py:class:`~pysnmp.hlapi.SnmpEngine`
class instance.
Expand Down Expand Up @@ -219,8 +219,8 @@ class UsmUserData:
"""Creates SNMP v3 User Security Model (USM) configuration entry.
This object can be used by
:py:class:`~pysnmp.hlapi.asyncore.AsyncCommandGenerator` or
:py:class:`~pysnmp.hlapi.asyncore.AsyncNotificationOriginator`
:py:class:`~pysnmp.hlapi.asyncio.AsyncCommandGenerator` or
:py:class:`~pysnmp.hlapi.asyncio.AsyncNotificationOriginator`
and their derivatives for adding new entries to Local Configuration
Datastore (LCD) managed by :py:class:`~pysnmp.hlapi.SnmpEngine`
class instance.
Expand Down
4 changes: 2 additions & 2 deletions pysnmp/hlapi/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class ContextData:
"""Creates UDP/IPv6 configuration entry and initialize socket API if needed.
This object can be used by
:py:class:`~pysnmp.hlapi.asyncore.AsyncCommandGenerator` or
:py:class:`~pysnmp.hlapi.asyncore.AsyncNotificationOriginator`
:py:class:`~pysnmp.hlapi.asyncio.AsyncCommandGenerator` or
:py:class:`~pysnmp.hlapi.asyncio.AsyncNotificationOriginator`
and their derevatives for forming SNMP PDU and also adding new entries to
Local Configuration Datastore (LCD) in order to support SNMPv1/v2c with
SNMPv3 interoperability.
Expand Down
2 changes: 1 addition & 1 deletion pysnmp/proto/secmod/rfc2576.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from pyasn1.codec.ber import encoder
from pyasn1.error import PyAsn1Error
from pysnmp.proto.secmod import base
from pysnmp.carrier.asyncore.dgram import udp, udp6, unix
from pysnmp.carrier.asyncio.dgram import udp, udp6, unix
from pysnmp.smi.error import NoSuchInstanceError
from pysnmp.proto import errind, error
from pysnmp import debug
Expand Down
8 changes: 4 additions & 4 deletions runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ PYTHON=${1:-python}

for x in examples/hlapi/asyncio/manager/cmdgen/*.py \
examples/hlapi/asyncio/agent/ntforg/*.py \
examples/v3arch/asyncore/manager/cmdgen/*.py \
examples/v3arch/asyncore/agent/ntforg/*.py \
examples/v1arch/asyncore/manager/cmdgen/*.py \
examples/v1arch/asyncore/agent/ntforg/*.py \
examples/v3arch/asyncio/manager/cmdgen/*.py \
examples/v3arch/asyncio/agent/ntforg/*.py \
examples/v1arch/asyncio/manager/cmdgen/*.py \
examples/v1arch/asyncio/agent/ntforg/*.py \
examples/smi/manager/*py \
examples/smi/agent/*.py
do
Expand Down

0 comments on commit a72e913

Please sign in to comment.