Skip to content

Commit

Permalink
Merge pull request #65 from collective/fix-sortkey-py3
Browse files Browse the repository at this point in the history
fix AttributeError: 'dict_items' object has no attribute 'sort'
  • Loading branch information
agitator committed May 16, 2019
2 parents ac728f1 + af3e0b8 commit 1f4931b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Changes
[petschki]

- Python 3 compatibility
[petschki]
[petschki, agitator]


1.5.1 (2018-10-25)
Expand Down
7 changes: 1 addition & 6 deletions src/collective/taxonomy/vdex.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,12 @@ def buildPathIndex(self):
def makeSubtree(self, index, table):
termnodes = []

def _sortkey(lng, lngstr):
return lng

for identifier in index.keys():
termnode = etree.Element('term')
identifiernode = etree.Element('termIdentifier')
identifiernode.text = str(identifier)
captionnode = etree.Element('caption')

translations = table[identifier].items()
translations.sort(key=_sortkey)
translations = sorted(table[identifier].items())

for (language, langstring) in translations:
langstringnode = etree.Element('langstring')
Expand Down

0 comments on commit 1f4931b

Please sign in to comment.