summaryrefslogtreecommitdiff
path: root/realtime/rt/__init__.py
diff options
context:
space:
mode:
authormjdenkowski <michael.j.denkowski@gmail.com>2013-09-11 16:20:36 -0400
committermjdenkowski <michael.j.denkowski@gmail.com>2013-09-11 16:20:36 -0400
commitfd3a8481f3ee472272a835a3fd76b765fea75c0a (patch)
tree3c7fd7d1d76d51ea2f413c9973490cd09ad74e2b /realtime/rt/__init__.py
parent71d5744c7dd2e28f20f491bc04afeb5f2f3f64b8 (diff)
Find pycdec
Diffstat (limited to 'realtime/rt/__init__.py')
-rw-r--r--realtime/rt/__init__.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/realtime/rt/__init__.py b/realtime/rt/__init__.py
index 738777f3..fbde8f4d 100644
--- a/realtime/rt/__init__.py
+++ b/realtime/rt/__init__.py
@@ -1,3 +1,18 @@
+# Add pycdec to the Python path if user hasn't
+import os
+import sys
+try:
+ import cdec
+except ImportError as ie:
+ try:
+ pycdec = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), 'python')
+ sys.path.append(pycdec)
+ import cdec
+ except:
+ sys.stderr.write('Error: cannot import pycdec. Please check the cdec/python is built.\n')
+ raise ie
+
+# Regular init imports
from rt import *
import aligner
import decoder