Repository: pimutils/khal
Pull request #858 (2019-03-30 16:32:07)

Fix/852


Patch:
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 45dc5b3..42d9d6d 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -7,6 +7,14 @@ Package maintainers and users who have to manually update their installation
 may want to subscribe to `GitHub's tag feed
 <https://github.com/geier/khal/tags.atom>`_.
 
+
+0.10.1
+======
+2019-03-30
+
+* FIX error with the new color priority system and `discover` calendar type
+* FIX search results in ikhal are ordered, same as in `khal search`
+
 0.10.0
 ======
 2019-03-25
diff --git a/khal/settings/utils.py b/khal/settings/utils.py
index ca03794..ed20432 100644
--- a/khal/settings/utils.py
+++ b/khal/settings/utils.py
@@ -226,7 +226,8 @@ def config_checks(
         calendar = {'path': vdir,
                     'color': _get_color_from_vdir(vdir),
                     'type': _get_vdir_type(vdir),
-                    'readonly': False
+                    'readonly': False,
+                    'priority': 10,
                     }
 
         # get color from config if not defined in vdir
diff --git a/khal/ui/__init__.py b/khal/ui/__init__.py
index 7deb3fe..f37a763 100644
--- a/khal/ui/__init__.py
+++ b/khal/ui/__init__.py
@@ -1120,7 +1120,7 @@ class ClassicView(Pane):
     def _search(self, search_term):
         """search for events matching `search_term"""
         self.window.backtrack()
-        events = list(self.collection.search(search_term))
+        events = sorted(self.collection.search(search_term))
         event_list = []
         event_list.extend([
             urwid.AttrMap(


Test patch:
diff --git a/tests/settings_test.py b/tests/settings_test.py
index 037abac..a45fcf0 100644
--- a/tests/settings_test.py
+++ b/tests/settings_test.py
@@ -225,60 +225,70 @@ def test_config_checks(metavdirs):
                 'path': '/cal3/home',
                 'readonly': False,
                 'type': 'calendar',
+                'priority': 10,
             },
             'my calendar': {
                 'color': 'dark blue',
                 'path': '/cal1/public',
                 'readonly': False,
                 'type': 'calendar',
+                'priority': 10,
             },
             'my private calendar': {
                 'color': '#FF00FF',
                 'path': '/cal1/private',
                 'readonly': False,
                 'type': 'calendar',
+                'priority': 10,
             },
             'public': {
                 'color': None,
                 'path': '/cal2/public',
                 'readonly': False,
                 'type': 'calendar',
+                'priority': 10,
             },
             'public1': {
                 'color': None,
                 'path': '/cal3/public',
                 'readonly': False,
                 'type': 'calendar',
+                'priority': 10,
             },
             'work': {
                 'color': None,
                 'path': '/cal3/work',
                 'readonly': False,
                 'type': 'calendar',
+                'priority': 10,
             },
             'cfgcolor': {
                 'color': 'dark blue',
                 'path': '/cal4/cfgcolor',
                 'readonly': False,
                 'type': 'calendar',
+                'priority': 10,
             },
             'dircolor': {
                 'color': 'dark blue',
                 'path': '/cal4/dircolor',
                 'readonly': False,
                 'type': 'calendar',
+                'priority': 10,
             },
             'cfgcolor_again': {
                 'color': 'dark blue',
                 'path': '/cal4/cfgcolor_again',
                 'readonly': False,
                 'type': 'calendar',
+                'priority': 10,
             },
             'cfgcolor_once_more': {
                 'color': 'dark blue',
                 'path': '/cal4/cfgcolor_once_more',
                 'readonly': False,
                 'type': 'calendar',
+                'priority': 10,
             },
 
         },