mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-27 21:19:31 +01:00
utils: new splitHostmask function
This commit is contained in:
parent
c52d542ed8
commit
c6ed06ba61
8
utils.py
8
utils.py
@ -172,6 +172,14 @@ def getDatabaseName(dbname):
|
||||
dbname += '.db'
|
||||
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():
|
||||
"""
|
||||
PyLink IRC Service class.
|
||||
|
Loading…
Reference in New Issue
Block a user