aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rwxr-xr-xsrc/app.py14
-rwxr-xr-xsrc/server.py30
2 files changed, 30 insertions, 14 deletions
diff --git a/src/app.py b/src/app.py
index 8dd3b86..6d838e0 100755
--- a/src/app.py
+++ b/src/app.py
@@ -116,7 +116,14 @@ class Response:
def run_do(*args, **kwargs):
- output = subprocess.run(args, stdin=DEVNULL, stdout=PIPE, stderr=STDOUT, universal_newlines=True, **kwargs)
+ output = subprocess.run(
+ args,
+ stdin=DEVNULL,
+ stdout=PIPE,
+ stderr=STDOUT,
+ universal_newlines=True,
+ **kwargs,
+ )
# Include the output in the exception's message:
try:
output.check_returncode()
@@ -330,10 +337,7 @@ class ThermalInfo(Task):
@staticmethod
def _collect_dirs():
root = ThermalInfo.ROOT
- dirs = [
- dir for dir in os.listdir(root)
- if re.match(r'^thermal_zone\d+$', dir)
- ]
+ dirs = [dir for dir in os.listdir(root) if re.match(r'^thermal_zone\d+$', dir)]
dirs = sorted(dirs)
dirs = [os.path.join(root, dir) for dir in dirs]
return dirs
diff --git a/src/server.py b/src/server.py
index 4b32893..e225633 100755
--- a/src/server.py
+++ b/src/server.py
@@ -17,7 +17,6 @@ import traceback
from app import Request, Response
-
DEFAULT_PORT = 18101
@@ -67,14 +66,27 @@ def parse_args(args=None):
if args is None:
args = sys.argv[1:]
parser = argparse.ArgumentParser()
- parser.add_argument('-p', '--port', metavar='PORT',
- type=int, default=DEFAULT_PORT,
- help='set port number')
- parser.add_argument('-n', '--disable-power', action='store_true',
- help='disable reboot/poweroff requests')
- parser.add_argument('-d', '--dir', metavar='DIR',
- default=default_html_dir(),
- help='HTML directory path')
+ parser.add_argument(
+ '-p',
+ '--port',
+ metavar='PORT',
+ type=int,
+ default=DEFAULT_PORT,
+ help='set port number',
+ )
+ parser.add_argument(
+ '-n',
+ '--disable-power',
+ action='store_true',
+ help='disable reboot/poweroff requests',
+ )
+ parser.add_argument(
+ '-d',
+ '--dir',
+ metavar='DIR',
+ default=default_html_dir(),
+ help='HTML directory path',
+ )
return parser.parse_args(args)