From c482714a0661440b3d3569953ab81fae9a404b50 Mon Sep 17 00:00:00 2001 From: Samuel Jones <samjones714@gmail.com> Date: Wed, 5 Dec 2018 16:32:55 +0000 Subject: [PATCH] Re #0 Added command line arguements to the program --- tools/scripts/OpenMostDocumentationForTesting.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tools/scripts/OpenMostDocumentationForTesting.py b/tools/scripts/OpenMostDocumentationForTesting.py index 3158420fdf5..142efb96c07 100644 --- a/tools/scripts/OpenMostDocumentationForTesting.py +++ b/tools/scripts/OpenMostDocumentationForTesting.py @@ -14,6 +14,7 @@ import urllib2 import re import webbrowser import time +import argparse def crawl_url_for_html_addons(url): @@ -40,7 +41,12 @@ def open_urls(list_of_urls, delay=1): webbrowser.open(url) -main_url = "http://docs.mantidproject.org/nightly/" +parser = argparse.ArgumentParser() +parser.add_argument( + '-d', '--open-tab-delay', type=int, help="Delay between each new page tab in seconds.") +args = parser.parse_args() + +print(args.delay) all_urls = [] @@ -89,5 +95,11 @@ all_urls.extend(mantidplot_urls) print("All webpages crawled") print("Opening Urls...") -open_urls(all_urls) + +delay = args.delay + +if delay is None: + delay = 1 + +open_urls(all_urls, delay) print("All URLs opened") -- GitLab