[ocrfeeder] Add local source path for when in development environment



commit 8336508f99ee5b6192763b9b869faaedde7932cf
Author: Joaquim Rocha <jrocha igalia com>
Date:   Thu Oct 28 08:21:10 2010 +0200

    Add local source path for when in development environment

 ocrfeeder     |    4 ++++
 ocrfeeder-cli |    4 ++++
 setup.py      |    5 +++++
 3 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/ocrfeeder b/ocrfeeder
index b324098..90a8868 100755
--- a/ocrfeeder
+++ b/ocrfeeder
@@ -19,6 +19,10 @@
 ###########################################################################
 
 import sys
+import os
+local_src = os.path.dirname(os.path.abspath(__file__)) + '/src'
+if os.path.exists(local_src):
+    sys.path = [local_src] + sys.path
 
 from ocrfeeder.studio.studioBuilder import Studio
 
diff --git a/ocrfeeder-cli b/ocrfeeder-cli
index 9d3f622..fe79c38 100755
--- a/ocrfeeder-cli
+++ b/ocrfeeder-cli
@@ -21,6 +21,10 @@
 
 import sys
 import os
+local_src = os.path.dirname(os.path.abspath(__file__)) + '/src'
+if os.path.exists(local_src):
+    sys.path = [local_src] + sys.path
+
 import gtk
 import math
 from ocrfeeder.util.cliutils import ArgsRetriever
diff --git a/setup.py b/setup.py
index a1967e3..4fdc0f2 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,11 @@
 #!/usr/bin/env python
 
+import sys
 import os
+local_src = os.path.dirname(os.path.abspath(__file__)) + '/src'
+if os.path.exists(local_src):
+    sys.path = [local_src] + sys.path
+
 from distutils.core import setup
 from ocrfeeder.util import constants
 import glob



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]