Skip to content

Commit fe0e02a

Browse files
authored
Merge pull request #162 from justmobilize/remove-socket-pool-contants
Remove SocketPoolContants
2 parents 66ffd0b + ebf4677 commit fe0e02a

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

adafruit_wiznet5k/adafruit_wiznet5k_socketpool.py

+6-10
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
_global_socketpool = {}
3838

3939

40-
class SocketPoolContants: # pylint: disable=too-few-public-methods
41-
"""Helper class for the constants that are needed everywhere"""
40+
class SocketPool:
41+
"""WIZNET5K SocketPool library"""
4242

43-
# These must match circuitpython "socketpoool" values. However, we cannot
43+
# These must match circuitpython "socketpool" values. However, we cannot
4444
# depend on socketpool being importable, so hard-code them here.
4545
SOCK_STREAM = 1
4646
SOCK_DGRAM = 2
@@ -50,10 +50,6 @@ class SocketPoolContants: # pylint: disable=too-few-public-methods
5050

5151
AF_INET = const(3)
5252

53-
54-
class SocketPool(SocketPoolContants):
55-
"""WIZNET5K SocketPool library"""
56-
5753
def __new__(cls, iface: WIZNET5K):
5854
# We want to make sure to return the same pool for the same interface
5955
if iface not in _global_socketpool:
@@ -191,7 +187,7 @@ def getaddrinfo( # pylint: disable=redefined-builtin,too-many-arguments,unused-
191187
raise ValueError("Port must be an integer")
192188
if not self._is_ipv4_string(host):
193189
host = self.gethostbyname(host)
194-
return [(SocketPoolContants.AF_INET, type, proto, "", (host, port))]
190+
return [(SocketPool.AF_INET, type, proto, "", (host, port))]
195191

196192
def gethostbyname(self, hostname: str) -> str:
197193
"""
@@ -210,8 +206,8 @@ def gethostbyname(self, hostname: str) -> str:
210206

211207
def socket( # pylint: disable=redefined-builtin
212208
self,
213-
family: int = SocketPoolContants.AF_INET,
214-
type: int = SocketPoolContants.SOCK_STREAM,
209+
family: int = AF_INET,
210+
type: int = SOCK_STREAM,
215211
proto: int = 0,
216212
fileno: Optional[int] = None,
217213
):

0 commit comments

Comments
 (0)