3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 03:29:28 +01:00

utils: new splitHostmask function

This commit is contained in:
James Lu 2016-07-17 15:20:48 -07:00
parent c52d542ed8
commit c6ed06ba61

View File

@ -172,6 +172,14 @@ def getDatabaseName(dbname):
dbname += '.db' dbname += '.db'
return dbname return dbname
def splitHostmask(mask):
"""
Returns a nick!user@host hostmask split into three fields: nick, user, and host.
"""
nick, identhost = mask.split('!', 1)
ident, host = identhost.split('@', 1)
return [nick, ident, host]
class ServiceBot(): class ServiceBot():
""" """
PyLink IRC Service class. PyLink IRC Service class.