mirror of
https://github.com/jlu5/PyLink.git
synced 2025-02-17 14:01:03 +01:00
Move detailed version string generation to utils
New function: utils.fullVersion(irc)
This commit is contained in:
parent
23056e97e3
commit
00552a41a7
@ -150,8 +150,7 @@ utils.add_hook(handle_services_login, 'CLIENT_SERVICES_LOGIN')
|
|||||||
def handle_version(irc, source, command, args):
|
def handle_version(irc, source, command, args):
|
||||||
"""Handles requests for the PyLink server version."""
|
"""Handles requests for the PyLink server version."""
|
||||||
# 351 syntax is usually "<server version>. <server hostname> :<anything else you want to add>
|
# 351 syntax is usually "<server version>. <server hostname> :<anything else you want to add>
|
||||||
fullversion = 'PyLink-%s. %s :[protocol:%s]' % (world.version, irc.serverdata['hostname'], irc.protoname)
|
fullversion = utils.fullVersion(irc)
|
||||||
|
|
||||||
irc.proto.numeric(irc.sid, 351, source, fullversion)
|
irc.proto.numeric(irc.sid, 351, source, fullversion)
|
||||||
utils.add_hook(handle_version, 'VERSION')
|
utils.add_hook(handle_version, 'VERSION')
|
||||||
|
|
||||||
|
8
utils.py
8
utils.py
@ -571,3 +571,11 @@ def getDatabaseName(dbname):
|
|||||||
dbname += '-%s' % conf.confname
|
dbname += '-%s' % conf.confname
|
||||||
dbname += '.db'
|
dbname += '.db'
|
||||||
return dbname
|
return dbname
|
||||||
|
|
||||||
|
def fullVersion(irc):
|
||||||
|
"""
|
||||||
|
Returns a detailed version string including the PyLink daemon version,
|
||||||
|
the protocol module in use, and the server hostname.
|
||||||
|
"""
|
||||||
|
fullversion = 'PyLink-%s. %s :[protocol:%s]' % (world.version, irc.serverdata['hostname'], irc.protoname)
|
||||||
|
return fullversion
|
||||||
|
Loading…
x
Reference in New Issue
Block a user