Skip to content

Commit c48d865

Browse files
committed
close method
1 parent a68a278 commit c48d865

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

servercom/implementations/circuitpy.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,12 @@ def code_update(self, reset=True) -> bool:
461461
print("Stale update.")
462462
return False
463463

464-
def __exit__(self):
464+
def close(self):
465+
"""Closes the connection to the server"""
465466
if self.v:
466467
print("Closing the server connection-")
467468
self.close_socket()
468469
self.close_wifi()
470+
471+
def __exit__(self):
472+
self.close()

servercom/implementations/cpy.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,13 @@ def code_update(reset=True):
371371
Restarts the microcontroller and run the new code if it is available
372372
"""
373373
pass
374-
def __exit__(self):
374+
375+
def close(self):
376+
"""Closes the connection to the server"""
375377
if self.v:
376378
print("Closing the server connection-")
377379
self.close_socket()
378380
self.close_wifi()
381+
382+
def __exit__(self):
383+
self.close()

0 commit comments

Comments
 (0)