diff libervia/tui/contact_list.py @ 4270:0d7bb4df2343

Reformatted code base using black.
author Goffi <goffi@goffi.org>
date Wed, 19 Jun 2024 18:44:57 +0200
parents b47f21f2b8fa
children
line wrap: on
line diff
--- a/libervia/tui/contact_list.py	Tue Jun 18 12:06:45 2024 +0200
+++ b/libervia/tui/contact_list.py	Wed Jun 19 18:44:57 2024 +0200
@@ -225,10 +225,10 @@
             self.host.get_notifs(entity, exact_jid=special, profile=self.profile)
         )
         mentions = list(
-                self.host.get_notifs(entity.bare, C.NOTIFY_MENTION, profile=self.profile)
-            )
+            self.host.get_notifs(entity.bare, C.NOTIFY_MENTION, profile=self.profile)
+        )
         if notifs or mentions:
-            attr = 'cl_mention' if mentions else 'cl_notifs'
+            attr = "cl_mention" if mentions else "cl_notifs"
             header = [(attr, "({})".format(len(notifs) + len(mentions))), " "]
         else:
             header = ""
@@ -269,10 +269,12 @@
             if self.contact_list.show_resources:
                 for resource in self.contact_list.getCache(entity, C.CONTACT_RESOURCES):
                     resource_disp = (
-                        "resource_main"
-                        if resource
-                        == self.contact_list.getCache(entity, C.CONTACT_MAIN_RESOURCE)
-                        else "resource",
+                        (
+                            "resource_main"
+                            if resource
+                            == self.contact_list.getCache(entity, C.CONTACT_MAIN_RESOURCE)
+                            else "resource"
+                        ),
                         "\n  " + resource,
                     )
                     markup_extra.append(resource_disp)
@@ -314,7 +316,9 @@
             else:
                 # the special widgets
                 if entity.resource:
-                    widget = self._build_entity_widget(entity, ("resource",), special=True)
+                    widget = self._build_entity_widget(
+                        entity, ("resource",), special=True
+                    )
                 else:
                     widget = self._build_entity_widget(
                         entity,
@@ -333,7 +337,7 @@
             content.append(urwid.Divider("="))
 
         groups = list(self.contact_list._groups)
-        groups.sort(key=lambda x: x.lower() if x else '')
+        groups.sort(key=lambda x: x.lower() if x else "")
         for group in groups:
             data = self.contact_list.get_group_data(group)
             folded = data.get(C.GROUP_DATA_FOLDED, False)