summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Wagner <rwagner@mythtv.org>2011-02-16 16:03:44 (GMT)
committer Raymond Wagner <rwagner@mythtv.org>2011-02-16 16:03:44 (GMT)
commit90f48c8ffd9681d79bd5d3c48c6b5e42172c967c (patch)
tree4cf964ee72f520985aa50a737532da1a98fde5e1
parente4145771b82ba81f11921ec89b4b8f4c9b058cd3 (diff)
Alter path sanity check to allow PATH lookup, rather than requiring
absolute paths. (partial cherrypick from b35ddbfee4c51b37d5f4b5600b6125bf6322341d)
-rw-r--r--mythtv/bindings/python/MythTV/static.py2
-rw-r--r--mythtv/bindings/python/MythTV/system.py17
2 files changed, 16 insertions, 3 deletions
diff --git a/mythtv/bindings/python/MythTV/static.py b/mythtv/bindings/python/MythTV/static.py
index c6d1704..11efeb0 100644
--- a/mythtv/bindings/python/MythTV/static.py
+++ b/mythtv/bindings/python/MythTV/static.py
@@ -4,7 +4,7 @@
Contains any static and global variables for MythTV Python Bindings
"""
-OWN_VERSION = (0,24,0,1)
+OWN_VERSION = (0,24,0,2)
SCHEMA_VERSION = 1264
MVSCHEMA_VERSION = 1038
NVSCHEMA_VERSION = 1007
diff --git a/mythtv/bindings/python/MythTV/system.py b/mythtv/bindings/python/MythTV/system.py
index da2eff5..332934d 100644
--- a/mythtv/bindings/python/MythTV/system.py
+++ b/mythtv/bindings/python/MythTV/system.py
@@ -36,8 +36,21 @@ class System( DBCache ):
if path is None:
raise MythError('Invalid input to System()')
self.path = path
- if not os.access(self.path, os.F_OK):
- raise MythFileError('Defined grabber path does not exist.')
+
+ cmd = self.path.split()[0]
+ if self.path.startswith('/'):
+ # test full given path
+ if not os.access(cmd, os.F_OK):
+ raise MythFileError('Defined executable path does not exist.')
+ else:
+ # search command from PATH
+ for folder in os.environ['PATH'].split(':'):
+ if os.access(os.path.join(folder,cmd), os.F_OK):
+ self.path = os.path.join(folder,self.path)
+ break
+ else:
+ raise MythFileError('Defined executable path does not exist.')
+
self.returncode = 0
self.stderr = ''