diff --git a/src/common/helpers.py b/src/common/helpers.py index 842342dae3e893129f3f728f7353e880446990b8..cd2412b1485ab20c9d84b92fe98bc822520cc6a5 100644 --- a/src/common/helpers.py +++ b/src/common/helpers.py @@ -122,7 +122,7 @@ def parse_resource(resource): '''Perform stringprep on resource and return it''' if resource: try: - from xmpp_stringprep import resourceprep + from xmpp.stringprepare import resourceprep return resourceprep.prepare(unicode(resource)) except UnicodeError: raise InvalidFormat, 'Invalid character in resource.' @@ -134,7 +134,7 @@ def prep(user, server, resource): if user: try: - from xmpp_stringprep import nodeprep + from xmpp.stringprepare import nodeprep user = nodeprep.prepare(unicode(user)) except UnicodeError: raise InvalidFormat, _('Invalid character in username.') @@ -145,14 +145,14 @@ def prep(user, server, resource): raise InvalidFormat, _('Server address required.') else: try: - from xmpp_stringprep import nameprep + from xmpp.stringprepare import nameprep server = nameprep.prepare(unicode(server)) except UnicodeError: raise InvalidFormat, _('Invalid character in hostname.') if resource: try: - from xmpp_stringprep import resourceprep + from xmpp.stringprepare import resourceprep resource = resourceprep.prepare(unicode(resource)) except UnicodeError: raise InvalidFormat, _('Invalid character in resource.') diff --git a/src/common/xmpp_stringprep.py b/src/common/xmpp/stringprepare.py similarity index 99% rename from src/common/xmpp_stringprep.py rename to src/common/xmpp/stringprepare.py index 41887596319336f6f718e973ed0234200176839d..47b1a2d1e78d67884022206b4f72b387c2453837 100644 --- a/src/common/xmpp_stringprep.py +++ b/src/common/xmpp/stringprepare.py @@ -1,5 +1,5 @@ # -*- coding:utf-8 -*- -## src/common/xmpp_stringprep.py +## src/common/xmpp/stringprepare.py ## ## Copyright (C) 2001-2005 Twisted Matrix Laboratories ## Copyright (C) 2005-2007 Yann Leboulanger <asterix AT lagaule.org>