diff --git a/downloadversionIRdata.py b/downloadversionIRdata.py index 259ef258d1ffbc83ef3a062c38bf0403a881b567..934c57c5bb570598041b067509bcf7504a8c7b26 100644 --- a/downloadversionIRdata.py +++ b/downloadversionIRdata.py @@ -61,11 +61,24 @@ def get_started(): it opens a weblink to a presentation and as well a flow chart """ print("Welcome") - import webbrowser - webbrowser.open('https://wikis.ipp-hgw.mpg.de/PhysicsW7X/images/9/9f/2019-04-24_20190424_How_to_access_Infrared_Data.pdf', new=2) + link = "https://wikis.ipp-hgw.mpg.de/PhysicsW7X/images/9/9f/2019-04-24_20190424_How_to_access_Infrared_Data.pdf" path=str(repr(__file__)).split("downloadversionIRdata")[0].split("'")[1] - os.startfile(path+"IR_data_access_flow_chart.png") - + image = path + "IR_data_access_flow_chart.png" + try: + import webbrowser + webbrowser.open(link, new=2) + try: + os.startfile(image) + except AttributeError: + # Non-windows os: + webbrowser.open(image) + except Exception: + # When ever that fails, just print the links: + print("Some slides can be found in the wiki:") + print(link) + print("And a flow-chart for getting and using the data can be found here:") + print(image) + def get_latest_version(stream, project="W7X", testmode=False, t_from=None, t_to=None, program=None, verbose=0):