Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Weblate
gajim
Commits
5cea6334
Commit
5cea6334
authored
15 years ago
by
steve-e
Browse files
Options
Downloads
Patches
Plain Diff
Move and rename xmpp_stringprep.py
It is more consistent to have this code closer to the xmpp protocol handling.
parent
3fc9c10c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/common/helpers.py
+4
-4
4 additions, 4 deletions
src/common/helpers.py
src/common/xmpp/stringprepare.py
+1
-1
1 addition, 1 deletion
src/common/xmpp/stringprepare.py
with
5 additions
and
5 deletions
src/common/helpers.py
+
4
−
4
View file @
5cea6334
...
...
@@ -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
.
stringprep
are
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
.
stringprep
are
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
.
stringprep
are
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
.
stringprep
are
import
resourceprep
resource
=
resourceprep
.
prepare
(
unicode
(
resource
))
except
UnicodeError
:
raise
InvalidFormat
,
_
(
'
Invalid character in resource.
'
)
...
...
This diff is collapsed.
Click to expand it.
src/common/xmpp
_
stringprep.py
→
src/common/xmpp
/
stringprep
are
.py
+
1
−
1
View file @
5cea6334
# -*- coding:utf-8 -*-
## src/common/xmpp
_
stringprep.py
## src/common/xmpp
/
stringprep
are
.py
##
## Copyright (C) 2001-2005 Twisted Matrix Laboratories
## Copyright (C) 2005-2007 Yann Leboulanger <asterix AT lagaule.org>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment