Skip to content
Snippets Groups Projects
Commit c482714a authored by Samuel Jones's avatar Samuel Jones
Browse files

Re #0 Added command line arguements to the program

parent 524f8994
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,7 @@ import urllib2 ...@@ -14,6 +14,7 @@ import urllib2
import re import re
import webbrowser import webbrowser
import time import time
import argparse
def crawl_url_for_html_addons(url): def crawl_url_for_html_addons(url):
...@@ -40,7 +41,12 @@ def open_urls(list_of_urls, delay=1): ...@@ -40,7 +41,12 @@ def open_urls(list_of_urls, delay=1):
webbrowser.open(url) 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 = [] all_urls = []
...@@ -89,5 +95,11 @@ all_urls.extend(mantidplot_urls) ...@@ -89,5 +95,11 @@ all_urls.extend(mantidplot_urls)
print("All webpages crawled") print("All webpages crawled")
print("Opening Urls...") 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") print("All URLs opened")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment