Skip to content

Commit

Permalink
v 1.5.7 fixed github issue #29 - code was calling get_unique_id eve…
Browse files Browse the repository at this point in the history
…n when it was not needed
quandyfactory committed Dec 10, 2014
1 parent 856b693 commit cb2dbd8
Showing 7 changed files with 18 additions and 13 deletions.
11 changes: 9 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -233,12 +233,19 @@ Author
Version
=======

* Version: 1.5.6
* Release Date: 2014-08-18
* Version: 1.5.7
* Release Date: 2014-12-09

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

Version 1.5.7
-------------

* Release Date: 2014-12-09
* Changes:
* Fixed [issue #29](https://github.com/quandyfactory/dicttoxml/issues/24)

Version 1.5.6
-------------

18 changes: 8 additions & 10 deletions dicttoxml.py
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@

from __future__ import unicode_literals

__version__ = '1.5.6'
__version__ = '1.5.7'
version = __version__

from random import randint
@@ -136,11 +136,8 @@ def convert_dict(obj, ids, parent, attr_type):
for key, val in obj.items():
logging.info('Looping inside convert_dict(): key="%s", val="%s", type(val)="%s"' % (key, val, type(val).__name__))

if not ids:
attr = {}
else:
attr = {'id': '%s' % get_unique_id(parent)}

attr = {} if not ids else {'id': '%s' % (get_unique_id(parent)) }

key, attr = make_valid_xml_name(key, attr)

if type(val) in (int, float, long, str, unicode):
@@ -175,12 +172,13 @@ def convert_list(items, ids, parent, attr_type):
logging.info('Inside convert_list()')
output = []
addline = output.append
this_id = get_unique_id(parent)

if ids:
this_id = get_unique_id(parent)

for i, item in enumerate(items):
logging.info('Looping inside convert_list(): item="%s", type="%s"' % (item, type(item).__name__))
attr = {} if ids == False else {
'id': '%s_%s' % (this_id, i+1)
}
attr = {} if not ids else { 'id': '%s_%s' % (this_id, i+1) }
if type(item) in (int, float, long, str, unicode):
addline(convert_kv('item', item, attr_type, attr))
elif hasattr(item, 'isoformat'): # datetime
Binary file removed dist/dict2xml-0.1.tar.gz
Binary file not shown.
Binary file removed dist/dict2xml-0.2.tar.gz
Binary file not shown.
Binary file removed dist/dict2xml-0.3.tar.gz
Binary file not shown.
Binary file removed dist/dict2xml-0.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.5.6'
version = '1.5.7'

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

0 comments on commit cb2dbd8

Please sign in to comment.