From 17f6505ab91c6d27d6a2c242dfce9ea155210d83 Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Wed, 2 Mar 2016 10:40:51 +0200 Subject: [PATCH] change order of pref. for launcher --- reporting/markslider.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/reporting/markslider.py b/reporting/markslider.py index eb9ab6b..42b1a5b 100755 --- a/reporting/markslider.py +++ b/reporting/markslider.py @@ -536,20 +536,6 @@ def launch(reader,opts,offset): if s.find("$!")==-1 and s.find("$>")==-1 and len(urls)==0 and len(images)==0: return - if len(urls)>0: - # Remove ) at the end of url: [name](link) markdown syntax - subprocess.call("xdg-open '%s' &"%(urls[0].rstrip(")"),), - stdout=subprocess.PIPE,stderr=subprocess.PIPE, - shell=True) - return - - if len(images)>0: - image = re.sub('.*\(([^\)]+)\).*', "\\1",images[0]) - subprocess.call("xdg-open '%s' &"%(image,), - stdout=subprocess.PIPE,stderr=subprocess.PIPE, - shell=True) - return - run_command=re.match("(.*)\$!(.*)\$!(.*)",s) show_command=re.match("(.*)\$>(.*)\$>(.*)",s) if show_command != None: @@ -571,6 +557,19 @@ def launch(reader,opts,offset): shell=True,executable="/bin/bash") inkey=getch.get() return + # Open URLS last + if len(urls)>0: + # Remove ) at the end of url: [name](link) markdown syntax + subprocess.call("xdg-open '%s' &"%(urls[0].rstrip(")"),), + stdout=subprocess.PIPE,stderr=subprocess.PIPE, + shell=True) + return + if len(images)>0: + image = re.sub('.*\(([^\)]+)\).*', "\\1",images[0]) + subprocess.call("xdg-open '%s' &"%(image,), + stdout=subprocess.PIPE,stderr=subprocess.PIPE, + shell=True) + return return bc=bc() getch=getch()