]> www.vanbest.org Git - motioneye-debian/commitdiff
additional config definition order is now preserved when setting and getting
authorCalin Crisan <ccrisan@gmail.com>
Thu, 9 Jul 2015 20:49:31 +0000 (23:49 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Thu, 9 Jul 2015 20:49:31 +0000 (23:49 +0300)
src/config.py

index bd0f5ba488ef3917b4c8e311ffc395660043c261..ad5d6ff3f90743ab4e9559676a8a456485c6c828 100644 (file)
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>. 
 
+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