change order of pref. for launcher

This commit is contained in:
Ville Rantanen
2016-03-02 10:40:51 +02:00
parent b81ef017eb
commit 17f6505ab9

View File

@@ -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: if s.find("$!")==-1 and s.find("$>")==-1 and len(urls)==0 and len(images)==0:
return 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) run_command=re.match("(.*)\$!(.*)\$!(.*)",s)
show_command=re.match("(.*)\$>(.*)\$>(.*)",s) show_command=re.match("(.*)\$>(.*)\$>(.*)",s)
if show_command != None: if show_command != None:
@@ -571,6 +557,19 @@ def launch(reader,opts,offset):
shell=True,executable="/bin/bash") shell=True,executable="/bin/bash")
inkey=getch.get() inkey=getch.get()
return 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 return
bc=bc() bc=bc()
getch=getch() getch=getch()