blob: d27db3abbcf82feab5320813893fa9646353790c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
--- a/src/rmdPrefsWidget.py 2008-11-23 16:09:14.000000000 +0100
+++ b/src/rmdPrefsWidget.py 2010-05-24 16:23:30.255865721 +0200
@@ -302,9 +302,29 @@
def remPort(self,lwi):
self.jack_lsp_listSave.takeItem(self.jack_lsp_listSave.row(lwi))
+ def which(self,program):
+ import os
+ def is_exe(fpath):
+ return os.path.exists(fpath) and os.access(fpath, os.X_OK)
+
+ fpath, fname = os.path.split(program)
+ if fpath:
+ if is_exe(program):
+ return program
+ else:
+ for path in os.environ["PATH"].split(os.pathsep):
+ exe_file = os.path.join(path, program)
+ if is_exe(exe_file):
+ return exe_file
+
+ return None
+
def __runJackLSP__(self,button=None):
self.ports=[]
failed=0
+ if self.which('jack_lsp') == None:
+ self.jack_button.setEnabled(False)
+ return
(stdin,stdout,stderr)=os.popen3(['jack_lsp'],'t')
ports=stdout.readlines()
stdin.close()
|