You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by bu...@apache.org on 2013/12/12 21:23:29 UTC
svn commit: r1550512 - in /uima/sandbox/uima-ducc/trunk/src/main:
admin/ducc_util.py scripts/ducc_base.py
Author: burn
Date: Thu Dec 12 20:23:29 2013
New Revision: 1550512
URL: http://svn.apache.org/r1550512
Log:
UIMA-3497 Make nested scripts get DUCC_HOME from their location
Modified:
uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py
uima/sandbox/uima-ducc/trunk/src/main/scripts/ducc_base.py
Modified: uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py?rev=1550512&r1=1550511&r2=1550512&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py (original)
+++ uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py Thu Dec 12 20:23:29 2013
@@ -40,7 +40,7 @@ from local_hooks import find_other_proce
# simple bootstratp to establish DUCC_HOME and to set the python path so it can
# find the common code in DUCC_HOME/admin
# Infer DUCC_HOME from our location - no longer use a (possibly inaccurate) environment variable
-me = os.path.abspath(sys.argv[0])
+me = os.path.abspath(__file__)
ndx = me.rindex('/')
ndx = me.rindex('/', 0, ndx)
DUCC_HOME = me[:ndx] # split from 0 to ndx
@@ -665,11 +665,10 @@ class DuccUtil(DuccBase):
CMD = CMD + " org.apache.uima.ducc.common.NodeConfiguration "
CMD = CMD + " -v " + allnodes
if ( verbose ):
- CMD = CMD + " -p "
+ CMD = CMD + " -p " + classfile
+ print CMD
else:
- CMD = CMD + " "
- CMD = CMD + classfile
- print CMD
+ CMD = CMD + " " + classfile
rc = os.system(CMD)
if ( rc == 0 ):
print "OK: Class and node definitions validated."
Modified: uima/sandbox/uima-ducc/trunk/src/main/scripts/ducc_base.py
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/src/main/scripts/ducc_base.py?rev=1550512&r1=1550511&r2=1550512&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/src/main/scripts/ducc_base.py (original)
+++ uima/sandbox/uima-ducc/trunk/src/main/scripts/ducc_base.py Thu Dec 12 20:23:29 2013
@@ -254,7 +254,7 @@ class DuccBase:
def __init__(self):
# Infer DUCC_HOME from our location - no longer use a (possibly inaccurate) environment variable
- me = os.path.abspath(sys.argv[0])
+ me = os.path.abspath(__file__)
ndx = me.rindex('/')
ndx = me.rindex('/', 0, ndx)
self.DUCC_HOME = me[:ndx] # split from 0 to ndx