From 7f9ad28a1f7faeb42f5440b34426237913731e7c Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Fri, 11 Sep 2015 14:43:46 +0200 Subject: [PATCH] ChangeLog: Use an ordered dict for items This way we respect the ordering of the original text file instead of a random ordering. --- plugins/ChangeLogPlugin/ChangeLog.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/ChangeLogPlugin/ChangeLog.py b/plugins/ChangeLogPlugin/ChangeLog.py index 4fec7d78ad..d83466f0c6 100644 --- a/plugins/ChangeLogPlugin/ChangeLog.py +++ b/plugins/ChangeLogPlugin/ChangeLog.py @@ -13,6 +13,7 @@ from PyQt5.QtQml import QQmlComponent, QQmlContext from PyQt5.QtCore import QUrl, pyqtSlot, QObject import os.path +import collections catalog = i18nCatalog("cura") @@ -55,7 +56,7 @@ class ChangeLog(Extension, QObject,): return result def loadChangeLogs(self): - self._change_logs = {} + self._change_logs = collections.OrderedDict() with open(os.path.join(PluginRegistry.getInstance().getPluginPath("ChangeLogPlugin"), "ChangeLog.txt"), 'r',-1, "utf-8") as f: open_version = None open_header = None @@ -65,7 +66,7 @@ class ChangeLog(Extension, QObject,): line = line.replace("[","") line = line.replace("]","") open_version = Version(line) - self._change_logs[Version(line)] = {} + self._change_logs[Version(line)] = collections.OrderedDict() elif line.startswith("*"): open_header = line.replace("*","") self._change_logs[open_version][open_header] = []