diff sat_frontends/jp/cmd_info.py @ 4037:524856bd7b19

massive refactoring to switch from camelCase to snake_case: historically, Libervia (SàT before) was using camelCase as allowed by PEP8 when using a pre-PEP8 code, to use the same coding style as in Twisted. However, snake_case is more readable and it's better to follow PEP8 best practices, so it has been decided to move on full snake_case. Because Libervia has a huge codebase, this ended with a ugly mix of camelCase and snake_case. To fix that, this patch does a big refactoring by renaming every function and method (including bridge) that are not coming from Twisted or Wokkel, to use fully snake_case. This is a massive change, and may result in some bugs.
author Goffi <goffi@goffi.org>
date Sat, 08 Apr 2023 13:54:42 +0200
parents 9c76678a39e2
children 4b842c1fb686
line wrap: on
line diff
--- a/sat_frontends/jp/cmd_info.py	Fri Apr 07 15:18:39 2023 +0200
+++ b/sat_frontends/jp/cmd_info.py	Sat Apr 08 13:54:42 2023 +0200
@@ -230,7 +230,7 @@
         # infos
         if infos_requested:
             try:
-                infos = await self.host.bridge.discoInfos(
+                infos = await self.host.bridge.disco_infos(
                     jid,
                     node=self.args.node,
                     use_cache=self.args.use_cache,
@@ -251,7 +251,7 @@
         # items
         if items_requested:
             try:
-                items = await self.host.bridge.discoItems(
+                items = await self.host.bridge.disco_items(
                     jid,
                     node=self.args.node,
                     use_cache=self.args.use_cache,
@@ -298,7 +298,7 @@
         jids = await self.host.check_jids([self.args.jid])
         jid = jids[0]
         try:
-            data = await self.host.bridge.getSoftwareVersion(jid, self.host.profile)
+            data = await self.host.bridge.software_version_get(jid, self.host.profile)
         except Exception as e:
             self.disp(_("error while trying to get version: {e}").format(e=e), error=True)
             self.host.quit(C.EXIT_BRIDGE_ERRBACK)
@@ -340,7 +340,7 @@
 
     async def start(self):
         try:
-            data = await self.host.bridge.sessionInfosGet(self.host.profile)
+            data = await self.host.bridge.session_infos_get(self.host.profile)
         except Exception as e:
             self.disp(_("Error getting session infos: {e}").format(e=e), error=True)
             self.host.quit(C.EXIT_BRIDGE_ERRBACK)
@@ -362,7 +362,7 @@
 
     async def start(self):
         try:
-            data = await self.host.bridge.devicesInfosGet(
+            data = await self.host.bridge.devices_infos_get(
                 self.args.jid, self.host.profile
             )
         except Exception as e: