diff cagou/plugins/plugin_wid_blog.py @ 491:203755bbe0fe

massive refactoring from camelCase -> snake_case. See backend commit log for more details
author Goffi <goffi@goffi.org>
date Sat, 08 Apr 2023 13:44:32 +0200
parents beedff600d2b
children
line wrap: on
line diff
--- a/cagou/plugins/plugin_wid_blog.py	Sat Apr 08 13:34:55 2023 +0200
+++ b/cagou/plugins/plugin_wid_blog.py	Sat Apr 08 13:44:32 2023 +0200
@@ -70,7 +70,7 @@
     size_hint_open = (1, 0.9)
 
     def _publish_cb(self, item_id: str) -> None:
-        G.host.addNote(
+        G.host.add_note(
             _("blog post published"),
             _("your blog post has been published with ID {item_id}").format(
                 item_id=item_id
@@ -79,7 +79,7 @@
         self.blog.load_blog()
 
     def _publish_eb(self, exc: BridgeException) -> None:
-        G.host.addNote(
+        G.host.add_note(
             _("Problem while publish blog post"),
             _("Can't publish blog post at {node!r} from {service}: {problem}").format(
                 node=self.blog.node or G.host.ns_map.get("microblog"),
@@ -105,7 +105,7 @@
         title = title.strip()
         if title:
             mb_data["title_rich"] = title
-        G.host.bridge.mbSend(
+        G.host.bridge.mb_send(
             self.blog.service,
             self.blog.node,
             data_format.serialise(mb_data),
@@ -135,9 +135,9 @@
         quick_widgets.QuickWidget.__init__(self, G.host, target, profiles)
         cagou_widget.CagouWidget.__init__(self)
         search_btn = SearchButton(blog=self)
-        self.headerInputAddExtra(search_btn)
+        self.header_input_add_extra(search_btn)
         new_post_btn = NewPostButton(blog=self)
-        self.headerInputAddExtra(new_post_btn)
+        self.header_input_add_extra(new_post_btn)
         self.load_blog()
 
     def on_kv_post(self, __):
@@ -146,7 +146,7 @@
             node=lambda __, value: self.load_blog(),
         )
 
-    def onHeaderInput(self):
+    def on_header_wid_input(self):
         text = self.header_input.text.strip()
         # for now we only use text as node
         self.node = text
@@ -164,7 +164,7 @@
         self,
         exc: BridgeException,
     ) -> None:
-        G.host.addNote(
+        G.host.add_note(
             _("Problem while getting blog data"),
             _("Can't get blog for {node!r} at {service}: {problem}").format(
                 node=self.node or G.host.ns_map.get("microblog"),
@@ -180,7 +180,7 @@
         """Retrieve a blog and display it"""
         extra = {}
         self.posts_widget.clear_widgets()
-        G.host.bridge.mbGet(
+        G.host.bridge.mb_get(
             self.service,
             self.node,
             20,