3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 21:19:31 +01:00

protocols: rename pingServer -> ping

This commit is contained in:
James Lu 2016-01-16 17:11:23 -08:00
parent 3d0bf18001
commit 812a866a4e
5 changed files with 5 additions and 5 deletions

View File

@ -372,7 +372,7 @@ class Irc():
def schedulePing(self): def schedulePing(self):
"""Schedules periodic pings in a loop.""" """Schedules periodic pings in a loop."""
self.proto.pingServer() self.proto.ping()
self.pingTimer = threading.Timer(self.pingfreq, self.schedulePing) self.pingTimer = threading.Timer(self.pingfreq, self.schedulePing)
self.pingTimer.daemon = True self.pingTimer.daemon = True

View File

@ -28,7 +28,7 @@ The following functions *must* be implemented by any protocol module within its
- **`handle_events`**`(self, line)` - Handles inbound data (lines of text) from the uplink IRC server. Normally, this will pass commands to other command handlers within the protocol module, while dropping commands that are unrecognized (wildcard handling). But, it's really up to you how to structure your modules. You will want to be able to parse command arguments properly into a list: many protocols send RFC1459-style commands that can be parsed using the [`Protocol.parseArgs()`](https://github.com/GLolol/PyLink/blob/e4fb64aebaf542122c70a8f3a49061386a00b0ca/classes.py#L539) function. - **`handle_events`**`(self, line)` - Handles inbound data (lines of text) from the uplink IRC server. Normally, this will pass commands to other command handlers within the protocol module, while dropping commands that are unrecognized (wildcard handling). But, it's really up to you how to structure your modules. You will want to be able to parse command arguments properly into a list: many protocols send RFC1459-style commands that can be parsed using the [`Protocol.parseArgs()`](https://github.com/GLolol/PyLink/blob/e4fb64aebaf542122c70a8f3a49061386a00b0ca/classes.py#L539) function.
- **`pingServer`**`(self, source=None, target=None)` - Sends a PING to a target server. Periodic PINGs are sent to our uplink automatically by the [`Irc()` - **`ping`**`(self, source=None, target=None)` - Sends a PING to a target server. Periodic PINGs are sent to our uplink automatically by the [`Irc()`
internals](https://github.com/GLolol/PyLink/blob/0.4.0-dev/classes.py#L267-L272); plugins shouldn't have to use this. internals](https://github.com/GLolol/PyLink/blob/0.4.0-dev/classes.py#L267-L272); plugins shouldn't have to use this.
### Outgoing command functions ### Outgoing command functions

View File

@ -254,7 +254,7 @@ class InspIRCdProtocol(TS6BaseProtocol):
self.irc.callHooks([self.irc.sid, 'CHGNAME', self.irc.callHooks([self.irc.sid, 'CHGNAME',
{'target': target, 'newgecos': text}]) {'target': target, 'newgecos': text}])
def pingServer(self, source=None, target=None): def ping(self, source=None, target=None):
"""Sends a PING to a target server. Periodic PINGs are sent to our uplink """Sends a PING to a target server. Periodic PINGs are sent to our uplink
automatically by the Irc() internals; plugins shouldn't have to use this.""" automatically by the Irc() internals; plugins shouldn't have to use this."""
source = source or self.irc.sid source = source or self.irc.sid

View File

@ -224,7 +224,7 @@ class TS6Protocol(TS6BaseProtocol):
raise NotImplementedError("Changing field %r of a client is " raise NotImplementedError("Changing field %r of a client is "
"unsupported by this protocol." % field) "unsupported by this protocol." % field)
def pingServer(self, source=None, target=None): def ping(self, source=None, target=None):
"""Sends a PING to a target server. Periodic PINGs are sent to our uplink """Sends a PING to a target server. Periodic PINGs are sent to our uplink
automatically by the Irc() internals; plugins shouldn't have to use this.""" automatically by the Irc() internals; plugins shouldn't have to use this."""
source = source or self.irc.sid source = source or self.irc.sid

View File

@ -168,7 +168,7 @@ class UnrealProtocol(TS6BaseProtocol):
# Only save our prefix modes in the channel state if our TS is lower than or equal to theirs. # Only save our prefix modes in the channel state if our TS is lower than or equal to theirs.
utils.applyModes(self.irc, channel, changedmodes) utils.applyModes(self.irc, channel, changedmodes)
def pingServer(self, source=None, target=None): def ping(self, source=None, target=None):
"""Sends a PING to a target server. Periodic PINGs are sent to our uplink """Sends a PING to a target server. Periodic PINGs are sent to our uplink
automatically by the Irc() internals; plugins shouldn't have to use this.""" automatically by the Irc() internals; plugins shouldn't have to use this."""
source = source or self.irc.sid source = source or self.irc.sid