apply black to the whole codebase.
This commit is contained in:
parent
420df3340d
commit
82e2c6efac
13 changed files with 175 additions and 448 deletions
|
|
@ -92,11 +92,8 @@ except ImportError:
|
|||
progressbar = None
|
||||
|
||||
# consts
|
||||
DESCRIPTION = (
|
||||
"""This software is a command line tool for XMPP.
|
||||
Get the latest version at """
|
||||
+ C.APP_URL
|
||||
)
|
||||
DESCRIPTION = """This software is a command line tool for XMPP.
|
||||
Get the latest version at """ + C.APP_URL
|
||||
|
||||
COPYLEFT = """Copyright (C) 2009-2024 Jérôme Poisson, Adrien Cossa
|
||||
This program comes with ABSOLUTELY NO WARRANTY;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ from libervia.frontends.tools import aio, display_servers, webrtc
|
|||
gi.require_versions({"Gst": "1.0", "GstWebRTC": "1.0"})
|
||||
from gi.repository import Gst
|
||||
|
||||
|
||||
ICON_SIZE = QSize(45, 45)
|
||||
BUTTON_SIZE = QSize(50, 50)
|
||||
running = False
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ from rich.text import Text
|
|||
from libervia.frontends.tools import aio
|
||||
from libervia.frontends.tools.webrtc import CallData, WebRTCCall
|
||||
|
||||
|
||||
aio.install_glib_asyncio_iteration()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ gi.require_versions({"Gst": "1.0", "GstWebRTC": "1.0"})
|
|||
|
||||
from gi.repository import Gst
|
||||
|
||||
|
||||
aio.install_glib_asyncio_iteration()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ from libervia.backend.core.i18n import _
|
|||
from libervia.cli import base
|
||||
from libervia.frontends.tools import jid
|
||||
|
||||
|
||||
log = getLogger(__name__)
|
||||
|
||||
__commands__ = ["Account"]
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ from libervia.cli.constants import Const as C
|
|||
from libervia.backend.tools import config
|
||||
from libervia.backend.tools.common import data_format
|
||||
|
||||
|
||||
__commands__ = ["Avatar"]
|
||||
DISPLAY_CMD = ["xdg-open", "xv", "display", "gwenview", "showtell"]
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class Get(base.CommandBase):
|
|||
Text(group.name or "", style="bold"),
|
||||
Text(group.id or "", style="italic"),
|
||||
group.description,
|
||||
"🔒" if group.encrypted else ""
|
||||
"🔒" if group.encrypted else "",
|
||||
)
|
||||
if idx:
|
||||
self.console.print()
|
||||
|
|
@ -77,7 +77,6 @@ class Get(base.CommandBase):
|
|||
|
||||
self.console.print(table)
|
||||
|
||||
|
||||
async def start(self):
|
||||
try:
|
||||
contacts_s = await self.host.bridge.ps_contacts_get(
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ from libervia.cli import base
|
|||
from libervia.cli.constants import Const as C
|
||||
from libervia.frontends.tools import jid
|
||||
|
||||
|
||||
__commands__ = ["Message"]
|
||||
|
||||
RECIPIENTS_ARGS = ["to", "cc", "bcc"]
|
||||
|
|
|
|||
|
|
@ -30,15 +30,13 @@ from libervia.cli import arg_tools
|
|||
from libervia.backend.tools.common.ansi import ANSI as A
|
||||
|
||||
__commands__ = ["Shell"]
|
||||
INTRO = _(
|
||||
"""Welcome to {app_name} shell, the Salut à Toi shell !
|
||||
INTRO = _("""Welcome to {app_name} shell, the Salut à Toi shell !
|
||||
|
||||
This enrironment helps you using several {app_name} commands with similar parameters.
|
||||
|
||||
To quit, just enter "quit" or press C-d.
|
||||
Enter "help" or "?" to know what to do
|
||||
"""
|
||||
).format(app_name=C.APP_NAME)
|
||||
""").format(app_name=C.APP_NAME)
|
||||
|
||||
|
||||
class Shell(base.CommandBase, cmd.Cmd):
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""Standard outputs"""
|
||||
|
||||
|
||||
from libervia.cli.constants import Const as C
|
||||
from libervia.frontends.tools import jid
|
||||
from libervia.backend.tools.common.ansi import ANSI as A
|
||||
|
|
@ -79,7 +78,7 @@ class Simple(object):
|
|||
def messages(self, data):
|
||||
# TODO: handle lang, and non chat message (normal, headline)
|
||||
for mess_data in data:
|
||||
(uid, timestamp, from_jid, to_jid, message, subject, mess_type, extra) = (
|
||||
uid, timestamp, from_jid, to_jid, message, subject, mess_type, extra = (
|
||||
mess_data
|
||||
)
|
||||
time_str = date_utils.date_fmt(
|
||||
|
|
@ -143,9 +142,13 @@ class Json:
|
|||
|
||||
def dump(self, data):
|
||||
if isinstance(data, str):
|
||||
self.host.console.print_json(json=data, indent=None, highlight=False, default=str)
|
||||
self.host.console.print_json(
|
||||
json=data, indent=None, highlight=False, default=str
|
||||
)
|
||||
else:
|
||||
self.host.console.print_json(data=data, indent=None, highlight=False, default=str)
|
||||
self.host.console.print_json(
|
||||
data=data, indent=None, highlight=False, default=str
|
||||
)
|
||||
|
||||
def dump_pretty(self, data):
|
||||
if isinstance(data, str):
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""Standard outputs"""
|
||||
|
||||
|
||||
from libervia.cli.constants import Const as C
|
||||
from libervia.backend.core.i18n import _
|
||||
from libervia.backend.core import log
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""Standard outputs"""
|
||||
|
||||
|
||||
from libervia.cli.constants import Const as C
|
||||
from libervia.backend.core.i18n import _
|
||||
from lxml import etree
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""Standard outputs"""
|
||||
|
||||
|
||||
from libervia.cli.constants import Const as C
|
||||
from libervia.cli import xmlui_manager
|
||||
from libervia.backend.core.log import getLogger
|
||||
|
|
|
|||
Loading…
Reference in a new issue