Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
pylibs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
domotika
pylibs
Commits
496d4f42
Commit
496d4f42
authored
Jul 19, 2020
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix DictMix missing in py3
parent
fe0f3657
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
convert.py
CorePost/corepost/convert.py
+2
-3
No files found.
CorePost/corepost/convert.py
View file @
496d4f42
...
...
@@ -9,7 +9,6 @@ for JSON/XML/YAML output
import
collections
import
logging
import
json
from
UserDict
import
DictMixin
from
twisted.python
import
log
primitives
=
(
int
,
long
,
float
,
bool
,
str
,
unicode
)
...
...
@@ -20,7 +19,7 @@ def convertForSerialization(obj):
if
type
(
obj
)
in
primitives
:
# no conversion
return
obj
elif
isinstance
(
obj
,
dict
)
or
isinstance
(
obj
,
DictMixin
)
:
elif
isinstance
(
obj
,
dict
):
return
traverseDict
(
obj
)
elif
isClassInstance
(
obj
):
return
convertClassToDict
(
obj
)
...
...
@@ -66,7 +65,7 @@ def convertToJson(obj):
def
generateXml
(
obj
):
"""Generates basic XML from an object that has already been converted for serialization"""
if
isinstance
(
obj
,
dict
)
or
isinstance
(
obj
,
DictMixin
)
:
if
isinstance
(
obj
,
dict
):
return
getXML_dict
(
obj
,
"item"
)
elif
isinstance
(
obj
,
collections
.
Iterable
):
return
"<list>
%
s</list>"
%
getXML
(
obj
,
"item"
)
...
...
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