From dd07f5ba76e2e68f080a1963ec42ed09c1c7bfc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fit=20=C3=87olako=C4=9Flu?= Date: Fri, 1 May 2020 15:15:42 +0300 Subject: [PATCH] Added title change support --- femtoshare.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/femtoshare.py b/femtoshare.py index 99bd37c..ee14b7a 100755 --- a/femtoshare.py +++ b/femtoshare.py @@ -29,6 +29,7 @@ parser = argparse.ArgumentParser() parser.add_argument("--port", help="local network port to listen on", type=int, default=8000) parser.add_argument("--public", help="listen on remote network interfaces (allows other hosts to see the website; otherwise only this host can see it)", action="store_true") parser.add_argument("--files-dir", help="directory to upload/download files from (prefix with # to specify that the path is relative to the Femtoshare executable)", default="#files") +parser.add_argument("--title", help="specify the name and the title of the app",default="femtoshare") args = parser.parse_args() if args.public: @@ -39,6 +40,10 @@ if args.files_dir.startswith("@"): FILES_DIRECTORY = os.path.join(os.path.dirname(os.path.realpath(__file__)), args.files_dir[1:]) else: FILES_DIRECTORY = args.files_dir +if args.title == "femtoshare": + title = "femtoshare" +else: + title = args.title class FemtoshareRequestHandler(BaseHTTPRequestHandler): server_version = "Femtoshare/{}".format(__version__) @@ -122,7 +127,7 @@ class FemtoshareRequestHandler(BaseHTTPRequestHandler): "\n" + " \n" + " \n" + - " femtoshare\n" + + " {0}\n".format(title) + " \n" + " \n" + " \n" + - "

femtoshare

\n" + + "

{0}

\n".format(title) + "
\n" + ( " \n" +