From: Calin Crisan Date: Thu, 9 Jul 2015 20:49:31 +0000 (+0300) Subject: additional config definition order is now preserved when setting and getting X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=defd882fa52d9209840ecca3be105ce30f2e8036;p=motioneye-debian additional config definition order is now preserved when setting and getting --- diff --git a/src/config.py b/src/config.py index bd0f5ba..ad5d6ff 100644 --- a/src/config.py +++ b/src/config.py @@ -15,6 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +import collections import datetime import errno import logging @@ -1673,7 +1674,7 @@ def _get_additional_config(data, camera_id=None): (sections, configs) = get_additional_structure(camera=bool(camera_id)) get_funcs = set([c.get('get') for c in configs.itervalues() if c.get('get')]) - get_func_values = dict((f, f(*args)) for f in get_funcs) + get_func_values = collections.OrderedDict((f, f(*args)) for f in get_funcs) for name, section in sections.iteritems(): if not section.get('get'): @@ -1701,7 +1702,7 @@ def _set_additional_config(data, camera_id=None): (sections, configs) = get_additional_structure(camera=bool(camera_id)) - set_func_values = {} + set_func_values = collections.OrderedDict() for name, section in sections.iteritems(): if not section.get('set'): continue