pantalaimon: Formatting fixes.

This commit is contained in:
Damir Jelić 2019-07-22 12:24:15 +02:00
parent 8c0b1f53df
commit 8cf1968f53
2 changed files with 14 additions and 8 deletions

View File

@ -164,7 +164,11 @@ def main(context, log_level, config):
ui_queue = janus.Queue(loop=loop) ui_queue = janus.Queue(loop=loop)
glib_thread = GlibT( 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) glib_fut = loop.run_in_executor(None, glib_thread.run)

View File

@ -14,8 +14,9 @@
from importlib import util from importlib import util
UI_ENABLED = (util.find_spec("gi.repository") is not None UI_ENABLED = (
and util.find_spec("pydbus") is not None) util.find_spec("gi.repository") is not None and util.find_spec("pydbus") is not None
)
if UI_ENABLED: if UI_ENABLED:
from collections import defaultdict from collections import defaultdict
@ -65,7 +66,6 @@ if UI_ENABLED:
return ret return ret
class Control: class Control:
""" """
<node> <node>
@ -157,7 +157,6 @@ if UI_ENABLED:
self.queue.put(message) self.queue.put(message)
return message.message_id return message.message_id
class Devices: class Devices:
""" """
<node> <node>
@ -312,12 +311,16 @@ if UI_ENABLED:
return message.message_id return message.message_id
def Unverify(self, pan_user, user_id, device_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) self.queue.put(message)
return message.message_id return message.message_id
def Blacklist(self, pan_user, user_id, device_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) self.queue.put(message)
return message.message_id return message.message_id
@ -365,7 +368,6 @@ if UI_ENABLED:
device.pop("deleted") device.pop("deleted")
device_list[device["user_id"]][device["device_id"]] = device device_list[device["user_id"]][device["device_id"]] = device
@attr.s @attr.s
class GlibT: class GlibT:
receive_queue = attr.ib() receive_queue = attr.ib()