mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-27 13:09:23 +01:00
classes: add docstrings to _pre_connect, _pre_disconnect, _post_disconnect
This commit is contained in:
parent
31c96bd1ed
commit
67dea6f748
10
classes.py
10
classes.py
@ -346,6 +346,9 @@ class PyLinkNetworkCore(structures.DeprecatedAttributesObject, structures.CamelC
|
||||
|
||||
## Shared helper functions
|
||||
def _pre_connect(self):
|
||||
"""
|
||||
Implements triggers called before a network connects.
|
||||
"""
|
||||
self._aborted.clear()
|
||||
self._init_vars()
|
||||
|
||||
@ -398,6 +401,9 @@ class PyLinkNetworkCore(structures.DeprecatedAttributesObject, structures.CamelC
|
||||
return
|
||||
|
||||
def _pre_disconnect(self):
|
||||
"""
|
||||
Implements triggers called before a network disconnects.
|
||||
"""
|
||||
self._aborted.set()
|
||||
self.was_successful = self.connected.is_set()
|
||||
log.debug('(%s) _pre_disconnect: got %s for was_successful state', self.name, self.was_successful)
|
||||
@ -410,7 +416,9 @@ class PyLinkNetworkCore(structures.DeprecatedAttributesObject, structures.CamelC
|
||||
log.removeHandler(self.loghandlers.pop())
|
||||
|
||||
def _post_disconnect(self):
|
||||
|
||||
"""
|
||||
Implements triggers called after a network disconnects.
|
||||
"""
|
||||
# Internal hook signifying that a network has disconnected.
|
||||
self.call_hooks([None, 'PYLINK_DISCONNECT', {'was_successful': self.was_successful}])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user