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.
This commit is contained in:
Goffi 2023-04-08 13:54:42 +02:00
commit 6a6f15707a

View file

@ -230,7 +230,7 @@ class Disco(base.CommandBase):
# 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 @@ class Disco(base.CommandBase):
# 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 @@ class Version(base.CommandBase):
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 @@ class Session(base.CommandBase):
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 @@ class Devices(base.CommandBase):
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: