If it's running from the build tree, insert ../ at the head of sys.path. Useful for testing purposes.

This commit is contained in:
Alessio Treglia 2011-12-08 01:50:44 +01:00
parent 7055c1555e
commit a3b5177e92
5 changed files with 43 additions and 2 deletions

View File

@ -22,6 +22,14 @@ import sys
import os
import time
import signal
try:
import imp
imp.find_module('laditools')
except ImportError:
# Running from the build tree?
sys.path.insert(0, os.path.join(sys.path[0], os.pardir))
import laditools
pipe_filename = "/dev/shm/g15log.pipe"

View File

@ -22,10 +22,18 @@
import pygtk
pygtk.require ('2.0')
import gtk
import laditools
import gobject
import sys
try:
import imp
imp.find_module('laditools')
except ImportError:
# Running from the build tree?
sys.path.insert(0, os.path.join(sys.path[0], os.pardir))
import laditools
jack = laditools.jack_configure()
def check_ladish():

View File

@ -26,6 +26,15 @@ from signal import SIGTERM
import termios
import tty
try:
import imp
imp.find_module('laditools')
except ImportError:
# Running from the build tree?
sys.path.insert(0, os.path.join(sys.path[0], os.pardir))
import laditools
try:
from gobject import timeout_add
import pygtk

View File

@ -22,6 +22,14 @@ import pygtk
pygtk.require('2.0')
import gtk
from gobject import timeout_add
try:
import imp
imp.find_module('laditools')
except ImportError:
# Running from the build tree?
sys.path.insert(0, os.path.join(sys.path[0], os.pardir))
import laditools
# Default configuration

View File

@ -21,9 +21,17 @@
import sys
import os
from wmdocklib import wmoo, pywmhelpers
import laditools
import time
try:
import imp
imp.find_module('laditools')
except ImportError:
# Running from the build tree?
sys.path.insert(0, os.path.join(sys.path[0], os.pardir))
import laditools
import pygtk
pygtk.require('2.0')
import gtk