Skip to content

Commit

Permalink
v 1.7.4 fixed issue #46
Browse files Browse the repository at this point in the history
  • Loading branch information
quandyfactory committed Jul 8, 2016
1 parent 62bf37b commit 2016fe9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 14 deletions.
11 changes: 9 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,19 @@ Author
Version
=======

* Version: 1.7.3
* Release Date: 2016-06-14
* Version: 1.7.4
* Release Date: 2016-07-08

Revision History
================

Version 1.7.4
-------------

* Release Date: 2016-07-08
* Changes:
* Fixed [bug #46](https://github.com/quandyfactory/dicttoxml/issues/46) on github. Thanks to [robbincatz](https://github.com/robbincatz) for identifying and reporting the issue.

Version 1.7.3
-------------

Expand Down
26 changes: 15 additions & 11 deletions dicttoxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from __future__ import unicode_literals

__version__ = '1.7.3'
__version__ = '1.7.4'
version = __version__

from random import randint
Expand Down Expand Up @@ -266,8 +266,8 @@ def convert_list(items, ids, parent, attr_type, item_func, cdata):
this_id = get_unique_id(parent)

for i, item in enumerate(items):
LOG.info('Looping inside convert_list(): item="%s", type="%s"' % (
unicode_me(item), type(item).__name__)
LOG.info('Looping inside convert_list(): item="%s", item_name="%s", type="%s"' % (
unicode_me(item), item_name, type(item).__name__)
)
attr = {} if not ids else { 'id': '%s_%s' % (this_id, i+1) }
if isinstance(item, numbers.Number) or type(item) in (str, unicode):
Expand All @@ -281,29 +281,33 @@ def convert_list(items, ids, parent, attr_type, item_func, cdata):

elif isinstance(item, dict):
if not attr_type:
addline('<%s>%s</item>' % (
addline('<%s>%s</%s>' % (
item_name,
convert_dict(item, ids, parent, attr_type, item_func, cdata),
item_name,
convert_dict(item, ids, parent, attr_type, item_func, cdata)
)
)
else:
addline('<%s type="dict">%s</item>' % (
addline('<%s type="dict">%s</%s>' % (
item_name,
convert_dict(item, ids, parent, attr_type, item_func, cdata),
item_name,
convert_dict(item, ids, parent, attr_type, item_func, cdata)
)
)

elif isinstance(item, collections.Iterable):
if not attr_type:
addline('<%s %s>%s</item>' % (
addline('<%s %s>%s</%s>' % (
item_name, make_attrstring(attr),
convert_list(item, ids, 'item', attr_type, item_func, cdata)
convert_list(item, ids, item_name, attr_type, item_func, cdata),
item_name,
)
)
else:
addline('<%s type="list"%s>%s</item>' % (
addline('<%s type="list"%s>%s</%s>' % (
item_name, make_attrstring(attr),
convert_list(item, ids, 'item', attr_type, item_func, cdata)
convert_list(item, ids, item_name, attr_type, item_func, cdata),
item_name,
)
)

Expand Down
Binary file added dist/dicttoxml-1.7.4.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from distutils.core import setup

version = '1.7.3'
version = '1.7.4'

with open('README.markdown') as readme:
long_description = readme.read()
Expand Down

0 comments on commit 2016fe9

Please sign in to comment.