mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-01 01:09:22 +01:00
utils: remove deprecated is* functions
This commit is contained in:
parent
a30921eeb8
commit
ed5d46e28a
@ -1543,8 +1543,6 @@ class PyLinkNetworkCoreWithUtils(PyLinkNetworkCore):
|
||||
# This is protocol specific, so stub it here in the base class.
|
||||
raise NotImplementedError
|
||||
|
||||
utils._proto_utils_class = PyLinkNetworkCoreWithUtils # Used by compatibility wrappers
|
||||
|
||||
class IRCNetwork(PyLinkNetworkCoreWithUtils):
|
||||
S2S_BUFSIZE = 510
|
||||
|
||||
|
36
utils.py
36
utils.py
@ -21,7 +21,6 @@ from pylinkirc import protocols, plugins
|
||||
PLUGIN_PREFIX = plugins.__name__ + '.'
|
||||
PROTOCOL_PREFIX = protocols.__name__ + '.'
|
||||
NORMALIZEWHITESPACE_RE = re.compile(r'\s+')
|
||||
_proto_utils_class = None # Set by classes.py when loaded
|
||||
|
||||
class NotAuthorizedError(Exception):
|
||||
"""
|
||||
@ -55,41 +54,6 @@ def add_hook(func, command, priority=100):
|
||||
world.hooks[command].sort(key=lambda pair: pair[0], reverse=True)
|
||||
return func
|
||||
|
||||
# DEPRECATED
|
||||
def isNick(s, nicklen=None):
|
||||
"""Returns whether the string given is a valid nick.
|
||||
|
||||
Deprecated since 2.0: use irc.is_nick() instead."""
|
||||
|
||||
log.warning('utils.isNick() is deprecated since PyLink 2.0, use irc.is_nick() instead.')
|
||||
return _proto_utils_class.is_nick(s, nicklen=nicklen)
|
||||
|
||||
# DEPRECATED
|
||||
def isChannel(s):
|
||||
"""Returns whether the string given is a valid channel name.
|
||||
|
||||
Deprecated since 2.0: use irc.is_channel() instead."""
|
||||
|
||||
log.warning('utils.isChannel() is deprecated since PyLink 2.0, use irc.is_channel() instead.')
|
||||
return _proto_utils_class.is_channel(s)
|
||||
|
||||
# DEPRECATED
|
||||
def isServerName(s):
|
||||
"""Returns whether the string given is a valid server name.
|
||||
|
||||
Deprecated since 2.0: use irc.is_server_name() instead."""
|
||||
|
||||
log.warning('utils.isServerName() is deprecated since PyLink 2.0, use irc.is_server_name() instead.')
|
||||
return _proto_utils_class.is_server_name(s)
|
||||
|
||||
# DEPRECATED
|
||||
def isHostmask(text):
|
||||
"""Returns whether the given text is a valid hostmask.
|
||||
|
||||
Deprecated since 2.0: use irc.is_hostmask() instead."""
|
||||
log.warning('utils.isHostmask() is deprecated since PyLink 2.0, use irc.is_hostmask() instead.')
|
||||
return _proto_utils_class.is_hostmask(text)
|
||||
|
||||
def expand_path(path):
|
||||
"""
|
||||
Returns a path expanded with environment variables and home folders (~) expanded, in that order."""
|
||||
|
Loading…
Reference in New Issue
Block a user