Use OrderedDict to keep items order from json
This commit is contained in:
parent
c737915efd
commit
4d41e26f9b
|
@ -27,6 +27,7 @@ TODO
|
|||
* fix (in erigo) the label with markup
|
||||
* properties that need to be fixed:
|
||||
- visibility (will be fixed in eo)
|
||||
* scrollable interface, widgets must be changed to always inherit from Scroller
|
||||
* how to manage translations??
|
||||
* what when we create the same widget more than one time ?
|
||||
* Radio.group_add is not a property !!
|
||||
|
@ -39,8 +40,9 @@ TODO
|
|||
"""
|
||||
|
||||
import os
|
||||
import importlib
|
||||
import json
|
||||
import importlib
|
||||
from collections import OrderedDict
|
||||
|
||||
try:
|
||||
basestring # py2
|
||||
|
@ -93,10 +95,12 @@ class ErigoGui(object):
|
|||
|
||||
if json_file is not None:
|
||||
self._print('\n### Generating gui from file: %s' % json_file)
|
||||
self._data = json.load(open(json_file))
|
||||
self._data = json.load(open(json_file),
|
||||
object_pairs_hook=OrderedDict)
|
||||
elif json_string is not None:
|
||||
self._print('\n### Generating gui from string')
|
||||
self._data = json.loads(json_string)
|
||||
self._data = json.loads(json_string,
|
||||
object_pairs_hook=OrderedDict)
|
||||
else:
|
||||
raise RuntimeError('One of "file" or "json_string" is mandatory')
|
||||
|
||||
|
|
Loading…
Reference in New Issue