Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
d1dcd180
Commit
d1dcd180
authored
Mar 20, 2013
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add utils
parent
5c90fe16
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
dream/__init__.py
dream/__init__.py
+6
-0
dream/platform/util.py
dream/platform/util.py
+19
-0
No files found.
dream/__init__.py
0 → 100644
View file @
d1dcd180
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try
:
__import__
(
'pkg_resources'
).
declare_namespace
(
__name__
)
except
ImportError
:
from
pkgutil
import
extend_path
__path__
=
extend_path
(
__path__
,
__name__
)
dream/platform/util.py
0 → 100644
View file @
d1dcd180
def
deunicodeData
(
data
):
if
isinstance
(
data
,
list
):
new_data
=
[]
for
sub_data
in
data
:
new_data
.
append
(
deunicodeData
(
sub_data
))
elif
isinstance
(
data
,
unicode
):
new_data
=
data
.
encode
(
'utf8'
)
elif
isinstance
(
data
,
dict
):
new_data
=
{}
for
key
,
value
in
data
.
iteritems
():
key
=
deunicodeData
(
key
)
value
=
deunicodeData
(
value
)
new_data
[
key
]
=
value
elif
isinstance
(
data
,
(
int
,
float
)):
new_data
=
data
else
:
raise
ValueError
(
"unknow type : %r"
%
(
data
,))
return
new_data
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment