mirror of
https://github.com/matrix-org/pantalaimon.git
synced 2024-10-01 03:35:38 -04:00
pantalaimon: Formatting fixes.
This commit is contained in:
parent
8c0b1f53df
commit
8cf1968f53
@ -164,7 +164,11 @@ def main(context, log_level, config):
|
||||
ui_queue = janus.Queue(loop=loop)
|
||||
|
||||
glib_thread = GlibT(
|
||||
pan_queue.sync_q, ui_queue.sync_q, data_dir, pan_conf.servers.values(), pan_conf
|
||||
pan_queue.sync_q,
|
||||
ui_queue.sync_q,
|
||||
data_dir,
|
||||
pan_conf.servers.values(),
|
||||
pan_conf,
|
||||
)
|
||||
|
||||
glib_fut = loop.run_in_executor(None, glib_thread.run)
|
||||
|
@ -14,8 +14,9 @@
|
||||
|
||||
from importlib import util
|
||||
|
||||
UI_ENABLED = (util.find_spec("gi.repository") is not None
|
||||
and util.find_spec("pydbus") is not None)
|
||||
UI_ENABLED = (
|
||||
util.find_spec("gi.repository") is not None and util.find_spec("pydbus") is not None
|
||||
)
|
||||
|
||||
if UI_ENABLED:
|
||||
from collections import defaultdict
|
||||
@ -65,7 +66,6 @@ if UI_ENABLED:
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
class Control:
|
||||
"""
|
||||
<node>
|
||||
@ -157,7 +157,6 @@ if UI_ENABLED:
|
||||
self.queue.put(message)
|
||||
return message.message_id
|
||||
|
||||
|
||||
class Devices:
|
||||
"""
|
||||
<node>
|
||||
@ -312,12 +311,16 @@ if UI_ENABLED:
|
||||
return message.message_id
|
||||
|
||||
def Unverify(self, pan_user, user_id, device_id):
|
||||
message = DeviceUnverifyMessage(self.message_id, pan_user, user_id, device_id)
|
||||
message = DeviceUnverifyMessage(
|
||||
self.message_id, pan_user, user_id, device_id
|
||||
)
|
||||
self.queue.put(message)
|
||||
return message.message_id
|
||||
|
||||
def Blacklist(self, pan_user, user_id, device_id):
|
||||
message = DeviceBlacklistMessage(self.message_id, pan_user, user_id, device_id)
|
||||
message = DeviceBlacklistMessage(
|
||||
self.message_id, pan_user, user_id, device_id
|
||||
)
|
||||
self.queue.put(message)
|
||||
return message.message_id
|
||||
|
||||
@ -365,7 +368,6 @@ if UI_ENABLED:
|
||||
device.pop("deleted")
|
||||
device_list[device["user_id"]][device["device_id"]] = device
|
||||
|
||||
|
||||
@attr.s
|
||||
class GlibT:
|
||||
receive_queue = attr.ib()
|
||||
|
Loading…
Reference in New Issue
Block a user