From aca157b70d2c534ef7c34177a4b731786f74c7cc Mon Sep 17 00:00:00 2001 From: Simon Murray Date: Wed, 26 Sep 2018 16:43:06 +0100 Subject: [PATCH] Better Address Notification Returns a full URL path as well as the host and port to use. Fixes #1 --- src/run | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/run b/src/run index b6d8793..1f1db9c 100755 --- a/src/run +++ b/src/run @@ -93,6 +93,15 @@ def init_repo(args): os.chdir(ANTORA_HOME + '/' + BASE_REPO) Executor.execute(['antora', PLAYBOOK]) + # Calculate the URL to report back to the user + with open(MODULE_REPO_PATH + args.path + '/antora.yml') as filedesc: + module = yaml.load(filedesc.read()) + + page, _ = os.path.splitext(module['start_page'].split(':')[1]) + url = module['name'] + '/' + module['version'] + '/' + page + '.html' + + logging.info('Serving content on http://localhost:8080/%s', url) + def init_httpd(): """Start the HTTP daemon when the vhost directory is created""" @@ -104,7 +113,7 @@ def init_httpd(): def init_slumber(): """Sleep until we are killed""" - logging.info('Serving content on http://localhost:8080, press Ctl+C to exit ...') + logging.info('Press Ctl+C to exit ...') while True: time.sleep(10)