black reformatting.
This commit is contained in:
parent
b0a94124d2
commit
7b3c8d2ba8
11 changed files with 31 additions and 39 deletions
|
|
@ -280,7 +280,9 @@ class LiberviaBackend(service.Service):
|
|||
ui_contact_list.ContactList(self)
|
||||
ui_profile_manager.ProfileManager(self)
|
||||
except exceptions.ConfigError as e:
|
||||
log.error(f"Configuration error, please check and fix your configuration: {e}")
|
||||
log.error(
|
||||
f"Configuration error, please check and fix your configuration: {e}"
|
||||
)
|
||||
self.stop(exit_code=C.EXIT_BAD_ARG)
|
||||
except Exception:
|
||||
log.exception(f"Could not initialize backend")
|
||||
|
|
@ -697,7 +699,7 @@ class LiberviaBackend(service.Service):
|
|||
log.debug(_("running app"))
|
||||
reactor.run()
|
||||
|
||||
def stop(self, exit_code: int|None = None):
|
||||
def stop(self, exit_code: int | None = None):
|
||||
log.debug(_("stopping app"))
|
||||
if exit_code:
|
||||
app._exit_code = exit_code
|
||||
|
|
|
|||
|
|
@ -2283,10 +2283,7 @@ class APGateway:
|
|||
log.warning(f"ignoring empty message: {mess_data}")
|
||||
return mess_data
|
||||
|
||||
mb_data = MbData(
|
||||
content = message,
|
||||
service = None
|
||||
)
|
||||
mb_data = MbData(content=message, service=None)
|
||||
if language:
|
||||
mb_data.language = language
|
||||
origin_id = mess_data["extra"].get("origin_id")
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class EmailGWPubsubResource(pubsub.PubSubResource):
|
|||
return defer.ensureDeferred(self.get_nodes(requestor, service, nodeIdentifier))
|
||||
|
||||
async def get_nodes(
|
||||
self, requestor: jid.JID, service: jid.JID, node_id: str|None
|
||||
self, requestor: jid.JID, service: jid.JID, node_id: str | None
|
||||
) -> list[str]:
|
||||
if node_id:
|
||||
# we only return result for requests without node.
|
||||
|
|
|
|||
|
|
@ -590,7 +590,9 @@ class PubsubCache:
|
|||
) -> Tuple[bool, Optional[Tuple[List[dict], dict]]]:
|
||||
# Check if cache is disabled by configuration (checking at runtime to handle
|
||||
# dynamic config changes)
|
||||
from pudb import set_trace; set_trace()
|
||||
from pudb import set_trace
|
||||
|
||||
set_trace()
|
||||
if G.config.common.pubsub_cache_strategy == "no_cache":
|
||||
log.debug("cache disabled in settings")
|
||||
return True, None
|
||||
|
|
|
|||
|
|
@ -55,25 +55,20 @@ from libervia.frontends.tools.jid import JID
|
|||
log.basicConfig(level=log.WARNING, format="[%(name)s] %(message)s")
|
||||
###
|
||||
|
||||
|
||||
class CLISettings(config.FrontendSettings, key="cli"):
|
||||
background: Literal["auto", "dark", "light"] = Field(
|
||||
default="auto", description="Background handling strategy"
|
||||
)
|
||||
image_cmd: str|None = Field(
|
||||
image_cmd: str | None = Field(
|
||||
default=None,
|
||||
description="Command to use to display images. Must be avaialble in path."
|
||||
)
|
||||
editor: str = Field(
|
||||
default = os.getenv("EDITOR", "vi")
|
||||
)
|
||||
editor_args_opt: str|None = Field(
|
||||
default=None
|
||||
description="Command to use to display images. Must be avaialble in path.",
|
||||
)
|
||||
editor: str = Field(default=os.getenv("EDITOR", "vi"))
|
||||
editor_args_opt: str | None = Field(default=None)
|
||||
syntax_ext: dict = Field(default_factory=dict)
|
||||
blog_preview_open_cmd: str|None = Field(
|
||||
default=None
|
||||
)
|
||||
blog_preview_update_cmd: str|None = Field(
|
||||
blog_preview_open_cmd: str | None = Field(default=None)
|
||||
blog_preview_update_cmd: str | None = Field(
|
||||
default_factory=lambda data: data["blog_preview_open_cmd"]
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -769,9 +769,7 @@ class Edit(base.CommandBase, BlogPublishCommon, common.BaseEdit):
|
|||
|
||||
async def start(self):
|
||||
# if there are user defined extension, we use them
|
||||
SYNTAX_EXT.update(
|
||||
self.host.cli_settings.syntax_ext
|
||||
)
|
||||
SYNTAX_EXT.update(self.host.cli_settings.syntax_ext)
|
||||
self.current_syntax = await self.get_current_syntax()
|
||||
|
||||
(
|
||||
|
|
@ -948,9 +946,7 @@ class Preview(base.CommandBase, common.BaseEdit):
|
|||
else:
|
||||
aionotify = None
|
||||
|
||||
SYNTAX_EXT.update(
|
||||
self.host.cli_settings.syntax_ext
|
||||
)
|
||||
SYNTAX_EXT.update(self.host.cli_settings.syntax_ext)
|
||||
|
||||
self.open_cb_cmd = self.cli_settings.blog_preview_open_cmd
|
||||
if self.open_cb_cmd is None:
|
||||
|
|
|
|||
|
|
@ -288,7 +288,9 @@ class BaseEdit(object):
|
|||
|
||||
if len(content) == 0:
|
||||
self.disp("Content is empty, cancelling the edition")
|
||||
if content_file_path.parent != get_tmp_dir(self.host.settings, self.cat_dir):
|
||||
if content_file_path.parent != get_tmp_dir(
|
||||
self.host.settings, self.cat_dir
|
||||
):
|
||||
self.disp(
|
||||
"File are not in SàT temporary hierarchy, we do not remove them",
|
||||
2,
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ from libervia.tui import xmlui
|
|||
from libervia.tui.progress import Progress
|
||||
from libervia.tui.notify import Notify
|
||||
from libervia.tui.keys import action_key_map as a_key
|
||||
|
||||
# from libervia.tui import config
|
||||
from libervia.frontends.tools.misc import InputHistory
|
||||
from libervia.backend.tools.common import dynamic_import
|
||||
|
|
@ -59,7 +60,7 @@ class TUISettings(tools_config.FrontendSettings, key="tui"):
|
|||
|
||||
Note: This feature requires terminal support for bracketed paste mode (ANSI escape
|
||||
sequences).
|
||||
"""
|
||||
""",
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ class TestEmailGatewayComponent:
|
|||
],
|
||||
}
|
||||
},
|
||||
uid=None
|
||||
uid=None,
|
||||
)
|
||||
|
||||
@ed
|
||||
|
|
@ -206,10 +206,7 @@ class TestEmailGatewayComponent:
|
|||
email_gw.client.jid = jid.JID("gateway.example.org")
|
||||
email_gw.storage = MagicMock()
|
||||
email_gw.storage.get = AsyncMock(
|
||||
return_value=Credentials(
|
||||
user_email="user@example.org",
|
||||
**TEST_CREDENTIALS_KW
|
||||
)
|
||||
return_value=Credentials(user_email="user@example.org", **TEST_CREDENTIALS_KW)
|
||||
)
|
||||
|
||||
from_jid = jid.JID("user@example.org")
|
||||
|
|
@ -266,7 +263,7 @@ class TestEmailGatewayComponent:
|
|||
{"": "Hello, world!\n"},
|
||||
None,
|
||||
extra={"headers": {"keywords": "test, example", "urgency": "high"}},
|
||||
uid=None
|
||||
uid=None,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -225,7 +225,8 @@ class TestXEP0176:
|
|||
transport_elt = await xep_0176.jingle_session_init(client, session, content_name)
|
||||
|
||||
expected_transport_elt = xep_0176.build_transport(
|
||||
session["contents"][content_name]["transport_data"]["local_ice_data"], add_trickle=True
|
||||
session["contents"][content_name]["transport_data"]["local_ice_data"],
|
||||
add_trickle=True,
|
||||
)
|
||||
|
||||
assert transport_elt.toXml() == expected_transport_elt.toXml()
|
||||
|
|
@ -245,7 +246,8 @@ class TestXEP0176:
|
|||
)
|
||||
|
||||
expected_transport_elt = xep_0176.build_transport(
|
||||
session["contents"][content_name]["transport_data"]["local_ice_data"], add_trickle=True
|
||||
session["contents"][content_name]["transport_data"]["local_ice_data"],
|
||||
add_trickle=True,
|
||||
)
|
||||
|
||||
assert returned_transport_elt.toXml() == expected_transport_elt.toXml()
|
||||
|
|
|
|||
|
|
@ -67,9 +67,7 @@ class TestPubsubCache:
|
|||
items_ret.callback(([], {}))
|
||||
client.pubsub_client.items = MagicMock(return_value=items_ret)
|
||||
host.memory.storage.get_pubsub_node.return_value = None
|
||||
host.memory.storage.set_pubsub_node.return_value = PubsubNode(
|
||||
sync_state=None
|
||||
)
|
||||
host.memory.storage.set_pubsub_node.return_value = PubsubNode(sync_state=None)
|
||||
with patch.object(host.plugins["PUBSUB_CACHE"], "cache_node") as cache_node:
|
||||
await host.plugins["XEP-0060"].get_items(
|
||||
client,
|
||||
|
|
|
|||
Loading…
Reference in a new issue