Running black formatter on source files
This commit is contained in:
parent
cd3354e146
commit
f888d080d6
2 changed files with 14 additions and 12 deletions
|
@ -35,8 +35,6 @@ import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import threading
|
import threading
|
||||||
import functools
|
import functools
|
||||||
import logging
|
|
||||||
import sys
|
|
||||||
|
|
||||||
import core.module
|
import core.module
|
||||||
import core.widget
|
import core.widget
|
||||||
|
@ -53,11 +51,11 @@ class Module(core.module.Module):
|
||||||
|
|
||||||
self.__command = self.parameter("command", 'echo "no command configured"')
|
self.__command = self.parameter("command", 'echo "no command configured"')
|
||||||
self.__left_click_command = self.parameter(
|
self.__left_click_command = self.parameter(
|
||||||
"left_click_command",
|
"left_click_command", 'echo "no left_click_command configured"'
|
||||||
'echo "no left_click_command configured"')
|
)
|
||||||
self.__right_click_command = self.parameter(
|
self.__right_click_command = self.parameter(
|
||||||
"right_click_command",
|
"right_click_command", 'echo "no right_click_command configured"'
|
||||||
'echo "no right_click_command configured"')
|
)
|
||||||
self.__async = util.format.asbool(self.parameter("async"))
|
self.__async = util.format.asbool(self.parameter("async"))
|
||||||
|
|
||||||
if self.__async:
|
if self.__async:
|
||||||
|
@ -72,15 +70,17 @@ class Module(core.module.Module):
|
||||||
self.widget,
|
self.widget,
|
||||||
button=core.input.LEFT_MOUSE,
|
button=core.input.LEFT_MOUSE,
|
||||||
cmd=functools.partial(
|
cmd=functools.partial(
|
||||||
self.click_command,
|
self.click_command, command=self.__left_click_command
|
||||||
command=self.__left_click_command))
|
),
|
||||||
|
)
|
||||||
if self.__right_click_command is not None:
|
if self.__right_click_command is not None:
|
||||||
core.input.register(
|
core.input.register(
|
||||||
self.widget,
|
self.widget,
|
||||||
button=core.input.RIGHT_MOUSE,
|
button=core.input.RIGHT_MOUSE,
|
||||||
cmd=functools.partial(
|
cmd=functools.partial(
|
||||||
self.click_command,
|
self.click_command, command=self.__right_click_command
|
||||||
command=self.__right_click_command))
|
),
|
||||||
|
)
|
||||||
|
|
||||||
def set_output(self, value):
|
def set_output(self, value):
|
||||||
self.__output = value
|
self.__output = value
|
||||||
|
|
|
@ -56,12 +56,14 @@ def execute(
|
||||||
try:
|
try:
|
||||||
out, _ = proc.communicate(timeout=timeout)
|
out, _ = proc.communicate(timeout=timeout)
|
||||||
except subprocess.TimeoutExpired as e:
|
except subprocess.TimeoutExpired as e:
|
||||||
logging.warning(f'''
|
logging.warning(
|
||||||
|
f"""
|
||||||
Communication with process pid={proc.pid} hangs for more
|
Communication with process pid={proc.pid} hangs for more
|
||||||
than {timeout} seconds.
|
than {timeout} seconds.
|
||||||
If this is not expected, the process is stale, or
|
If this is not expected, the process is stale, or
|
||||||
you might have run in stdout / stderr deadlock.
|
you might have run in stdout / stderr deadlock.
|
||||||
''')
|
"""
|
||||||
|
)
|
||||||
out, _ = proc.communicate()
|
out, _ = proc.communicate()
|
||||||
if proc.returncode != 0:
|
if proc.returncode != 0:
|
||||||
err = "{} exited with code {}".format(cmd, proc.returncode)
|
err = "{} exited with code {}".format(cmd, proc.returncode)
|
||||||
|
|
Loading…
Add table
Reference in a new issue