Don't warn if user is not an administrator

master
Dan Howe 6 years ago
parent ba6782d85a
commit 2155e856e1

@ -116,10 +116,7 @@ def get_telemetered_bore(driver, bore_id, start_date, end_date):
def open_browser(download_dir):
# Warn if user does not have admin privileges
if not has_admin():
warnings.warn('This program should be run as an administrator.')
# Set up Firefox to silently download files to specified folder
profile = webdriver.FirefoxProfile()
profile.set_preference('browser.download.folderList', 2)
profile.set_preference('browser.download.manager.showWhenStarting', False)
@ -130,9 +127,11 @@ def open_browser(download_dir):
'application/x-zip-compressed,'
'multipart/x-zip'))
# Create download folder if it does not exist
os.makedirs(download_dir, exist_ok=True)
# Open browser
driver = webdriver.Firefox(firefox_profile=profile)
url = 'https://realtimedata.waternsw.com.au/water.stm'
driver.get(url)

Loading…
Cancel
Save