3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

IRCNetwork: mark schedule_ping, process_queue as private

This commit is contained in:
James Lu 2017-06-27 02:53:09 -07:00
parent 710a276c45
commit fb34392fca

View File

@ -1130,11 +1130,11 @@ class PyLinkNetworkCoreWithUtils(PyLinkNetworkCore):
_getUid = _get_UID _getUid = _get_UID
class IRCNetwork(PyLinkNetworkCoreWithUtils): class IRCNetwork(PyLinkNetworkCoreWithUtils):
def schedule_ping(self): def _schedule_ping(self):
"""Schedules periodic pings in a loop.""" """Schedules periodic pings in a loop."""
self.ping() self.ping()
self.pingTimer = threading.Timer(self.pingfreq, self.schedule_ping) self.pingTimer = threading.Timer(self.pingfreq, self._schedule_ping)
self.pingTimer.daemon = True self.pingTimer.daemon = True
self.pingTimer.name = 'Ping timer loop for %s' % self.name self.pingTimer.name = 'Ping timer loop for %s' % self.name
self.pingTimer.start() self.pingTimer.start()
@ -1248,7 +1248,7 @@ class IRCNetwork(PyLinkNetworkCoreWithUtils):
if checks_ok: if checks_ok:
self.queue_thread = threading.Thread(name="Queue thread for %s" % self.name, self.queue_thread = threading.Thread(name="Queue thread for %s" % self.name,
target=self.process_queue, daemon=True) target=self._process_queue, daemon=True)
self.queue_thread.start() self.queue_thread.start()
self.sid = self.serverdata.get("sid") self.sid = self.serverdata.get("sid")
@ -1264,7 +1264,7 @@ class IRCNetwork(PyLinkNetworkCoreWithUtils):
or conf.conf['bot']['serverdesc']) or conf.conf['bot']['serverdesc'])
log.info('(%s) Starting ping schedulers....', self.name) log.info('(%s) Starting ping schedulers....', self.name)
self.schedule_ping() self._schedule_ping()
log.info('(%s) Server ready; listening for data.', self.name) log.info('(%s) Server ready; listening for data.', self.name)
self.autoconnect_active_multiplier = 1 # Reset any extra autoconnect delays self.autoconnect_active_multiplier = 1 # Reset any extra autoconnect delays
self._run_irc() self._run_irc()
@ -1374,7 +1374,7 @@ class IRCNetwork(PyLinkNetworkCoreWithUtils):
else: else:
self._send(data) self._send(data)
def process_queue(self): def _process_queue(self):
"""Loop to process outgoing queue data.""" """Loop to process outgoing queue data."""
while True: while True:
throttle_time = self.serverdata.get('throttle_time', 0.005) throttle_time = self.serverdata.get('throttle_time', 0.005)