Skip to content

Commit

Permalink
avoid gnuradio conflicts with bundled interpreter on windows (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
jopohl committed Nov 26, 2017
1 parent 349a994 commit a0d9af4
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/urh/dev/gr/scripts/airspy_recv.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
##################################################

from optparse import OptionParser

import tempfile
import os
import sys

try:
with open(os.path.join(tempfile.gettempdir(), "gnuradio_path.txt"), "r") as f:
gnuradio_path = f.read().strip()

os.environ["PATH"] = os.path.join(gnuradio_path, "bin")
# Append script path at end to prevent conflicts in case of frozen interpreter
sys.path.append(sys.path.pop(0))
sys.path.insert(0, os.path.join(gnuradio_path, "lib", "site-packages"))

except IOError:
Expand Down
2 changes: 2 additions & 0 deletions src/urh/dev/gr/scripts/bladerf_recv.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
gnuradio_path = f.read().strip()

os.environ["PATH"] = os.path.join(gnuradio_path, "bin")
# Append script path at end to prevent conflicts in case of frozen interpreter
sys.path.append(sys.path.pop(0))
sys.path.insert(0, os.path.join(gnuradio_path, "lib", "site-packages"))

except IOError:
Expand Down
2 changes: 2 additions & 0 deletions src/urh/dev/gr/scripts/bladerf_send.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
gnuradio_path = f.read().strip()

os.environ["PATH"] = os.path.join(gnuradio_path, "bin")
# Append script path at end to prevent conflicts in case of frozen interpreter
sys.path.append(sys.path.pop(0))
sys.path.insert(0, os.path.join(gnuradio_path, "lib", "site-packages"))

except IOError:
Expand Down
2 changes: 2 additions & 0 deletions src/urh/dev/gr/scripts/funcube-dongle_recv.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
gnuradio_path = f.read().strip()

os.environ["PATH"] = os.path.join(gnuradio_path, "bin")
# Append script path at end to prevent conflicts in case of frozen interpreter
sys.path.append(sys.path.pop(0))
sys.path.insert(0, os.path.join(gnuradio_path, "lib", "site-packages"))

except IOError:
Expand Down
2 changes: 2 additions & 0 deletions src/urh/dev/gr/scripts/hackrf_recv.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
gnuradio_path = f.read().strip()

os.environ["PATH"] = os.path.join(gnuradio_path, "bin")
# Append script path at end to prevent conflicts in case of frozen interpreter
sys.path.append(sys.path.pop(0))
sys.path.insert(0, os.path.join(gnuradio_path, "lib", "site-packages"))

except IOError:
Expand Down
2 changes: 2 additions & 0 deletions src/urh/dev/gr/scripts/hackrf_send.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
gnuradio_path = f.read().strip()

os.environ["PATH"] = os.path.join(gnuradio_path, "bin")
# Append script path at end to prevent conflicts in case of frozen interpreter
sys.path.append(sys.path.pop(0))
sys.path.insert(0, os.path.join(gnuradio_path, "lib", "site-packages"))

except IOError:
Expand Down
2 changes: 2 additions & 0 deletions src/urh/dev/gr/scripts/rtl-sdr_recv.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
gnuradio_path = f.read().strip()

os.environ["PATH"] = os.path.join(gnuradio_path, "bin")
# Append script path at end to prevent conflicts in case of frozen interpreter
sys.path.append(sys.path.pop(0))
sys.path.insert(0, os.path.join(gnuradio_path, "lib", "site-packages"))

except IOError:
Expand Down
2 changes: 2 additions & 0 deletions src/urh/dev/gr/scripts/sdrplay_recv.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
gnuradio_path = f.read().strip()

os.environ["PATH"] = os.path.join(gnuradio_path, "bin")
# Append script path at end to prevent conflicts in case of frozen interpreter
sys.path.append(sys.path.pop(0))
sys.path.insert(0, os.path.join(gnuradio_path, "lib", "site-packages"))

except IOError:
Expand Down
2 changes: 2 additions & 0 deletions src/urh/dev/gr/scripts/usrp_recv.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
gnuradio_path = f.read().strip()

os.environ["PATH"] = os.path.join(gnuradio_path, "bin")
# Append script path at end to prevent conflicts in case of frozen interpreter
sys.path.append(sys.path.pop(0))
sys.path.insert(0, os.path.join(gnuradio_path, "lib", "site-packages"))

except IOError:
Expand Down
2 changes: 2 additions & 0 deletions src/urh/dev/gr/scripts/usrp_send.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
gnuradio_path = f.read().strip()

os.environ["PATH"] = os.path.join(gnuradio_path, "bin")
# Append script path at end to prevent conflicts in case of frozen interpreter
sys.path.append(sys.path.pop(0))
sys.path.insert(0, os.path.join(gnuradio_path, "lib", "site-packages"))

except IOError:
Expand Down

0 comments on commit a0d9af4

Please sign in to comment.