summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2008-06-17 12:56:34 +0800
committerMatthew Newhook <matthew@zeroc.com>2008-06-17 12:56:34 +0800
commit4e40e22bfb7f2e8dce8859ab2104b91882b55f61 (patch)
treefefeb0fe8664378544f956db5acc59dc72a6707a /py
parentremove double build in the interceptor test. (diff)
downloadice-4e40e22bfb7f2e8dce8859ab2104b91882b55f61.tar.bz2
ice-4e40e22bfb7f2e8dce8859ab2104b91882b55f61.tar.xz
ice-4e40e22bfb7f2e8dce8859ab2104b91882b55f61.zip
http://bugzilla/bugzilla/show_bug.cgi?id=3265
- Simplified the python implementation of Ice.getSliceDir - Added ruby implementation of Ice.getSliceDir - Adjusted demos & tests to use Ice.getSliceDir appropriately.
Diffstat (limited to 'py')
-rwxr-xr-xpy/demo/Ice/bidir/Client.py2
-rwxr-xr-xpy/demo/Ice/bidir/Server.py2
-rw-r--r--py/python/Ice.py31
-rwxr-xr-xpy/test/Ice/adapterDeactivation/Client.py7
-rwxr-xr-xpy/test/Ice/adapterDeactivation/Collocated.py7
-rwxr-xr-xpy/test/Ice/adapterDeactivation/Server.py7
-rwxr-xr-xpy/test/Ice/binding/Client.py7
-rwxr-xr-xpy/test/Ice/binding/Server.py7
-rwxr-xr-xpy/test/Ice/blobject/Client.py7
-rwxr-xr-xpy/test/Ice/blobject/Server.py7
-rwxr-xr-xpy/test/Ice/checksum/Client.py15
-rwxr-xr-xpy/test/Ice/checksum/Server.py15
-rwxr-xr-xpy/test/Ice/custom/Client.py7
-rwxr-xr-xpy/test/Ice/custom/Server.py7
-rwxr-xr-xpy/test/Ice/exceptions/Client.py7
-rwxr-xr-xpy/test/Ice/exceptions/Collocated.py7
-rwxr-xr-xpy/test/Ice/exceptions/Server.py7
-rwxr-xr-xpy/test/Ice/exceptions/ServerAMD.py7
-rwxr-xr-xpy/test/Ice/facets/Client.py7
-rwxr-xr-xpy/test/Ice/facets/Collocated.py7
-rwxr-xr-xpy/test/Ice/facets/Server.py7
-rwxr-xr-xpy/test/Ice/faultTolerance/Client.py7
-rwxr-xr-xpy/test/Ice/faultTolerance/Server.py7
-rwxr-xr-xpy/test/Ice/inheritance/Client.py7
-rwxr-xr-xpy/test/Ice/inheritance/Collocated.py7
-rwxr-xr-xpy/test/Ice/inheritance/Server.py7
-rwxr-xr-xpy/test/Ice/location/Client.py15
-rwxr-xr-xpy/test/Ice/location/Server.py15
-rwxr-xr-xpy/test/Ice/objects/Client.py7
-rwxr-xr-xpy/test/Ice/objects/Collocated.py7
-rwxr-xr-xpy/test/Ice/objects/Server.py7
-rwxr-xr-xpy/test/Ice/operations/Client.py16
-rwxr-xr-xpy/test/Ice/operations/Collocated.py16
-rwxr-xr-xpy/test/Ice/operations/Server.py16
-rwxr-xr-xpy/test/Ice/operations/ServerAMD.py15
-rwxr-xr-xpy/test/Ice/proxy/Client.py16
-rwxr-xr-xpy/test/Ice/proxy/Collocated.py16
-rwxr-xr-xpy/test/Ice/proxy/Server.py15
-rwxr-xr-xpy/test/Ice/proxy/ServerAMD.py15
-rwxr-xr-xpy/test/Ice/retry/Client.py16
-rwxr-xr-xpy/test/Ice/retry/Server.py15
-rwxr-xr-xpy/test/Ice/servantLocator/Client.py7
-rwxr-xr-xpy/test/Ice/servantLocator/Collocated.py7
-rwxr-xr-xpy/test/Ice/servantLocator/Server.py7
-rwxr-xr-xpy/test/Ice/servantLocator/ServerAMD.py7
-rwxr-xr-xpy/test/Ice/slicing/exceptions/Client.py7
-rwxr-xr-xpy/test/Ice/slicing/exceptions/Server.py8
-rwxr-xr-xpy/test/Ice/slicing/exceptions/ServerAMD.py7
-rwxr-xr-xpy/test/Ice/slicing/objects/Client.py7
-rwxr-xr-xpy/test/Ice/slicing/objects/Server.py7
-rwxr-xr-xpy/test/Ice/slicing/objects/ServerAMD.py7
-rwxr-xr-xpy/test/Ice/timeout/Client.py17
-rwxr-xr-xpy/test/Ice/timeout/Server.py15
53 files changed, 43 insertions, 479 deletions
diff --git a/py/demo/Ice/bidir/Client.py b/py/demo/Ice/bidir/Client.py
index 258d18447ba..916431c60ad 100755
--- a/py/demo/Ice/bidir/Client.py
+++ b/py/demo/Ice/bidir/Client.py
@@ -12,7 +12,7 @@ import os, sys, Ice
slice_dir = Ice.getSliceDir()
if not slice_dir:
- print sys.argv[0] + ': Slice directory not found. Define ICE_HOME.'
+ print sys.argv[0] + ': Slice directory not found.'
sys.exit(1)
Ice.loadSlice('-I' + slice_dir + ' Callback.ice')
diff --git a/py/demo/Ice/bidir/Server.py b/py/demo/Ice/bidir/Server.py
index 9b5c3db5ffe..4d030437966 100755
--- a/py/demo/Ice/bidir/Server.py
+++ b/py/demo/Ice/bidir/Server.py
@@ -12,7 +12,7 @@ import os, sys, traceback, threading, Ice
slice_dir = Ice.getSliceDir()
if not slice_dir:
- print sys.argv[0] + ': Slice directory not found. Define ICE_HOME.'
+ print sys.argv[0] + ': Slice directory not found.'
sys.exit(1)
Ice.loadSlice('-I' + slice_dir + ' Callback.ice')
diff --git a/py/python/Ice.py b/py/python/Ice.py
index 2e8caa6267c..1682b85b302 100644
--- a/py/python/Ice.py
+++ b/py/python/Ice.py
@@ -103,14 +103,6 @@ class UserException(Exception):
#
def getSliceDir():
#
- # Check for <ICE_HOME>/slice first.
- #
- if os.environ.has_key("ICE_HOME"):
- dir = os.path.join(os.environ["ICE_HOME"], "slice")
- if os.path.exists(dir):
- return dir
-
- #
# Get the parent of the directory containing this file (Ice.py).
#
pyHome = os.path.join(os.path.dirname(__file__), "..")
@@ -133,28 +125,11 @@ def getSliceDir():
iceVer = stringVersion()
- #
- # Check platform-specific locations.
- #
- if sys.platform[:6] == "cygwin" or sys.platform == "win32":
- dir = os.path.join("\\", "Ice-" + iceVer, "slice")
- if os.path.exists(dir):
- return dir
- dir = os.path.join("C:\\", "Ice-" + iceVer, "slice")
- if os.path.exists(dir):
- return dir
- else:
- if sys.platform[:5] == "linux":
- #
- # Check the default RPM location.
- #
- dir = os.path.join("/", "usr", "share", "Ice-" + iceVer, "slice")
- if os.path.exists(dir):
- return dir
+ if sys.platform[:5] == "linux":
#
- # Check in /opt.
+ # Check the default RPM location.
#
- dir = os.path.join("/", "opt", "Ice-" + iceVer, "slice")
+ dir = os.path.join("/", "usr", "share", "Ice-" + iceVer, "slice")
if os.path.exists(dir):
return dir
diff --git a/py/test/Ice/adapterDeactivation/Client.py b/py/test/Ice/adapterDeactivation/Client.py
index 30027f180b2..1abcd543953 100755
--- a/py/test/Ice/adapterDeactivation/Client.py
+++ b/py/test/Ice/adapterDeactivation/Client.py
@@ -10,13 +10,6 @@
import os, sys
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
import Test, AllTests
diff --git a/py/test/Ice/adapterDeactivation/Collocated.py b/py/test/Ice/adapterDeactivation/Collocated.py
index d9d33612bff..fa8e650c8c2 100755
--- a/py/test/Ice/adapterDeactivation/Collocated.py
+++ b/py/test/Ice/adapterDeactivation/Collocated.py
@@ -10,13 +10,6 @@
import os, sys, traceback, time
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
import Test, TestI, AllTests
diff --git a/py/test/Ice/adapterDeactivation/Server.py b/py/test/Ice/adapterDeactivation/Server.py
index fba85833131..563c4bfd2eb 100755
--- a/py/test/Ice/adapterDeactivation/Server.py
+++ b/py/test/Ice/adapterDeactivation/Server.py
@@ -9,13 +9,6 @@
import os, sys, traceback, time
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
import Test, TestI
diff --git a/py/test/Ice/binding/Client.py b/py/test/Ice/binding/Client.py
index ceb94b83a78..3ddbb1cf5d1 100755
--- a/py/test/Ice/binding/Client.py
+++ b/py/test/Ice/binding/Client.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
diff --git a/py/test/Ice/binding/Server.py b/py/test/Ice/binding/Server.py
index 39b5e5d211c..412d5c18eb8 100755
--- a/py/test/Ice/binding/Server.py
+++ b/py/test/Ice/binding/Server.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
import Test, TestI
diff --git a/py/test/Ice/blobject/Client.py b/py/test/Ice/blobject/Client.py
index b402d0e8145..33fd79c3f94 100755
--- a/py/test/Ice/blobject/Client.py
+++ b/py/test/Ice/blobject/Client.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
import Test
diff --git a/py/test/Ice/blobject/Server.py b/py/test/Ice/blobject/Server.py
index af986ad5dd3..2db1fb2ea7b 100755
--- a/py/test/Ice/blobject/Server.py
+++ b/py/test/Ice/blobject/Server.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
diff --git a/py/test/Ice/checksum/Client.py b/py/test/Ice/checksum/Client.py
index 446b41fe545..11b4d7f38cb 100755
--- a/py/test/Ice/checksum/Client.py
+++ b/py/test/Ice/checksum/Client.py
@@ -10,20 +10,9 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
-
-#
-# Get Slice directory.
-#
-slice_dir = os.path.join(os.path.join(toplevel, "..", "slice"))
-if not os.path.exists(slice_dir):
+slice_dir = Ice.getSliceDir()
+if not slice_dir:
print sys.argv[0] + ': Slice directory not found.'
sys.exit(1)
diff --git a/py/test/Ice/checksum/Server.py b/py/test/Ice/checksum/Server.py
index c2f72db5dfd..36f1f490d45 100755
--- a/py/test/Ice/checksum/Server.py
+++ b/py/test/Ice/checksum/Server.py
@@ -10,20 +10,9 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
-
-#
-# Get Slice directory.
-#
-slice_dir = os.path.join(os.path.join(toplevel, "..", "slice"))
-if not os.path.exists(slice_dir):
+slice_dir = Ice.getSliceDir()
+if not slice_dir:
print sys.argv[0] + ': Slice directory not found.'
sys.exit(1)
diff --git a/py/test/Ice/custom/Client.py b/py/test/Ice/custom/Client.py
index b2b2e281a4f..34f5c7f822c 100755
--- a/py/test/Ice/custom/Client.py
+++ b/py/test/Ice/custom/Client.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
import Test, AllTests
diff --git a/py/test/Ice/custom/Server.py b/py/test/Ice/custom/Server.py
index 8a2f638971e..7c74dcf52a6 100755
--- a/py/test/Ice/custom/Server.py
+++ b/py/test/Ice/custom/Server.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
import Test
diff --git a/py/test/Ice/exceptions/Client.py b/py/test/Ice/exceptions/Client.py
index af419d19e1d..775d7a06658 100755
--- a/py/test/Ice/exceptions/Client.py
+++ b/py/test/Ice/exceptions/Client.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
import AllTests
diff --git a/py/test/Ice/exceptions/Collocated.py b/py/test/Ice/exceptions/Collocated.py
index 50aab50055f..773e9e57927 100755
--- a/py/test/Ice/exceptions/Collocated.py
+++ b/py/test/Ice/exceptions/Collocated.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
import Test, TestI, AllTests
diff --git a/py/test/Ice/exceptions/Server.py b/py/test/Ice/exceptions/Server.py
index f89adc3b362..32892b87638 100755
--- a/py/test/Ice/exceptions/Server.py
+++ b/py/test/Ice/exceptions/Server.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
import Test, TestI
diff --git a/py/test/Ice/exceptions/ServerAMD.py b/py/test/Ice/exceptions/ServerAMD.py
index 38580006f7a..ef7d3f42bef 100755
--- a/py/test/Ice/exceptions/ServerAMD.py
+++ b/py/test/Ice/exceptions/ServerAMD.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('TestAMD.ice')
import Test
diff --git a/py/test/Ice/facets/Client.py b/py/test/Ice/facets/Client.py
index 91623582c73..5245c80d072 100755
--- a/py/test/Ice/facets/Client.py
+++ b/py/test/Ice/facets/Client.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
diff --git a/py/test/Ice/facets/Collocated.py b/py/test/Ice/facets/Collocated.py
index ca9e6dc665c..d91bf2acebc 100755
--- a/py/test/Ice/facets/Collocated.py
+++ b/py/test/Ice/facets/Collocated.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
import Test, TestI, AllTests
diff --git a/py/test/Ice/facets/Server.py b/py/test/Ice/facets/Server.py
index dbe3b98c7f5..2d7c49b7c2c 100755
--- a/py/test/Ice/facets/Server.py
+++ b/py/test/Ice/facets/Server.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
import Test, TestI
diff --git a/py/test/Ice/faultTolerance/Client.py b/py/test/Ice/faultTolerance/Client.py
index a0640c58c20..1e71c934eea 100755
--- a/py/test/Ice/faultTolerance/Client.py
+++ b/py/test/Ice/faultTolerance/Client.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice, AllTests
def test(b):
diff --git a/py/test/Ice/faultTolerance/Server.py b/py/test/Ice/faultTolerance/Server.py
index e753c4fbb6a..5d6b01c5ae0 100755
--- a/py/test/Ice/faultTolerance/Server.py
+++ b/py/test/Ice/faultTolerance/Server.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
import Test
diff --git a/py/test/Ice/inheritance/Client.py b/py/test/Ice/inheritance/Client.py
index 1c68ab740a9..2ea77ac8141 100755
--- a/py/test/Ice/inheritance/Client.py
+++ b/py/test/Ice/inheritance/Client.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
import AllTests
diff --git a/py/test/Ice/inheritance/Collocated.py b/py/test/Ice/inheritance/Collocated.py
index 202292cf7bc..647807b8fb5 100755
--- a/py/test/Ice/inheritance/Collocated.py
+++ b/py/test/Ice/inheritance/Collocated.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
import Test, TestI, AllTests
diff --git a/py/test/Ice/inheritance/Server.py b/py/test/Ice/inheritance/Server.py
index 0ea27904b8c..b02542b73b5 100755
--- a/py/test/Ice/inheritance/Server.py
+++ b/py/test/Ice/inheritance/Server.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
import Test, TestI
diff --git a/py/test/Ice/location/Client.py b/py/test/Ice/location/Client.py
index 6c673ae57c5..ae305aa3c48 100755
--- a/py/test/Ice/location/Client.py
+++ b/py/test/Ice/location/Client.py
@@ -10,20 +10,9 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
-
-#
-# Get Slice directory.
-#
-slice_dir = os.path.join(os.path.join(toplevel, "..", "slice"))
-if not os.path.exists(slice_dir):
+slice_dir = Ice.getSliceDir()
+if not slice_dir:
print sys.argv[0] + ': Slice directory not found.'
sys.exit(1)
diff --git a/py/test/Ice/location/Server.py b/py/test/Ice/location/Server.py
index 4f7c5870c5b..7b76f74d9f0 100755
--- a/py/test/Ice/location/Server.py
+++ b/py/test/Ice/location/Server.py
@@ -10,20 +10,9 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
-
-#
-# Get Slice directory.
-#
-slice_dir = os.path.join(os.path.join(toplevel, "..", "slice"))
-if not os.path.exists(slice_dir):
+slice_dir = Ice.getSliceDir()
+if not slice_dir:
print sys.argv[0] + ': Slice directory not found.'
sys.exit(1)
diff --git a/py/test/Ice/objects/Client.py b/py/test/Ice/objects/Client.py
index 073a47e6c54..f5fb5b7b5e9 100755
--- a/py/test/Ice/objects/Client.py
+++ b/py/test/Ice/objects/Client.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
Ice.loadSlice('ClientPrivate.ice')
diff --git a/py/test/Ice/objects/Collocated.py b/py/test/Ice/objects/Collocated.py
index 9db84e6d90c..7067f40b2db 100755
--- a/py/test/Ice/objects/Collocated.py
+++ b/py/test/Ice/objects/Collocated.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
Ice.loadSlice('ClientPrivate.ice')
diff --git a/py/test/Ice/objects/Server.py b/py/test/Ice/objects/Server.py
index 7aee9423d4a..4f7577f9e5f 100755
--- a/py/test/Ice/objects/Server.py
+++ b/py/test/Ice/objects/Server.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
Ice.loadSlice('ServerPrivate.ice')
diff --git a/py/test/Ice/operations/Client.py b/py/test/Ice/operations/Client.py
index 9a0c6494b99..e4a3fd608f4 100755
--- a/py/test/Ice/operations/Client.py
+++ b/py/test/Ice/operations/Client.py
@@ -10,22 +10,12 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
-#
-# Get Slice directory.
-#
-slice_dir = os.path.join(os.path.join(toplevel, "..", "slice"))
-if not os.path.exists(slice_dir):
+import Ice
+slice_dir = Ice.getSliceDir()
+if not slice_dir:
print sys.argv[0] + ': Slice directory not found.'
sys.exit(1)
-import Ice
Ice.loadSlice('-I' + slice_dir + ' Test.ice')
import AllTests
diff --git a/py/test/Ice/operations/Collocated.py b/py/test/Ice/operations/Collocated.py
index cdd3503654e..92df3f66ed5 100755
--- a/py/test/Ice/operations/Collocated.py
+++ b/py/test/Ice/operations/Collocated.py
@@ -10,22 +10,12 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
-#
-# Get Slice directory.
-#
-slice_dir = os.path.join(os.path.join(toplevel, "..", "slice"))
-if not os.path.exists(slice_dir):
+import Ice
+slice_dir = Ice.getSliceDir()
+if not slice_dir:
print sys.argv[0] + ': Slice directory not found.'
sys.exit(1)
-import Ice
Ice.loadSlice('-I' + slice_dir + ' Test.ice')
import Test, TestI, AllTests
diff --git a/py/test/Ice/operations/Server.py b/py/test/Ice/operations/Server.py
index f23901880c4..a29df353b22 100755
--- a/py/test/Ice/operations/Server.py
+++ b/py/test/Ice/operations/Server.py
@@ -9,21 +9,9 @@
# **********************************************************************
import os, sys, traceback
-
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
-
-#
-# Get Slice directory.
-#
-slice_dir = os.path.join(os.path.join(toplevel, "..", "slice"))
-if not os.path.exists(slice_dir):
+slice_dir = Ice.getSliceDir()
+if not slice_dir:
print sys.argv[0] + ': Slice directory not found.'
sys.exit(1)
diff --git a/py/test/Ice/operations/ServerAMD.py b/py/test/Ice/operations/ServerAMD.py
index 5a1cf52631b..b1510246cc3 100755
--- a/py/test/Ice/operations/ServerAMD.py
+++ b/py/test/Ice/operations/ServerAMD.py
@@ -10,20 +10,9 @@
import os, sys, traceback, threading
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
-
-#
-# Get Slice directory.
-#
-slice_dir = os.path.join(os.path.join(toplevel, "..", "slice"))
-if not os.path.exists(slice_dir):
+slice_dir = Ice.getSliceDir()
+if not slice_dir:
print sys.argv[0] + ': Slice directory not found.'
sys.exit(1)
diff --git a/py/test/Ice/proxy/Client.py b/py/test/Ice/proxy/Client.py
index 070df3ac032..d3493a01eca 100755
--- a/py/test/Ice/proxy/Client.py
+++ b/py/test/Ice/proxy/Client.py
@@ -10,22 +10,12 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
-#
-# Get Slice directory.
-#
-slice_dir = os.path.join(os.path.join(toplevel, "..", "slice"))
-if not os.path.exists(slice_dir):
+import Ice
+slice_dir = Ice.getSliceDir()
+if not slice_dir:
print sys.argv[0] + ': Slice directory not found.'
sys.exit(1)
-import Ice
Ice.loadSlice('-I' + slice_dir + ' Test.ice')
import AllTests
diff --git a/py/test/Ice/proxy/Collocated.py b/py/test/Ice/proxy/Collocated.py
index cdd3503654e..92df3f66ed5 100755
--- a/py/test/Ice/proxy/Collocated.py
+++ b/py/test/Ice/proxy/Collocated.py
@@ -10,22 +10,12 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
-#
-# Get Slice directory.
-#
-slice_dir = os.path.join(os.path.join(toplevel, "..", "slice"))
-if not os.path.exists(slice_dir):
+import Ice
+slice_dir = Ice.getSliceDir()
+if not slice_dir:
print sys.argv[0] + ': Slice directory not found.'
sys.exit(1)
-import Ice
Ice.loadSlice('-I' + slice_dir + ' Test.ice')
import Test, TestI, AllTests
diff --git a/py/test/Ice/proxy/Server.py b/py/test/Ice/proxy/Server.py
index 67d8a99ebc1..d953a8cd44e 100755
--- a/py/test/Ice/proxy/Server.py
+++ b/py/test/Ice/proxy/Server.py
@@ -10,20 +10,9 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
-
-#
-# Get Slice directory.
-#
-slice_dir = os.path.join(os.path.join(toplevel, "..", "slice"))
-if not os.path.exists(slice_dir):
+slice_dir = Ice.getSliceDir()
+if not slice_dir:
print sys.argv[0] + ': Slice directory not found.'
sys.exit(1)
diff --git a/py/test/Ice/proxy/ServerAMD.py b/py/test/Ice/proxy/ServerAMD.py
index 0f7bc95d964..8247a527a06 100755
--- a/py/test/Ice/proxy/ServerAMD.py
+++ b/py/test/Ice/proxy/ServerAMD.py
@@ -10,20 +10,9 @@
import os, sys, traceback, time
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
-
-#
-# Get Slice directory.
-#
-slice_dir = os.path.join(os.path.join(toplevel, "..", "slice"))
-if not os.path.exists(slice_dir):
+slice_dir = Ice.getSliceDir()
+if not slice_dir:
print sys.argv[0] + ': Slice directory not found.'
sys.exit(1)
diff --git a/py/test/Ice/retry/Client.py b/py/test/Ice/retry/Client.py
index c951e0e95e1..d55ec75dbe7 100755
--- a/py/test/Ice/retry/Client.py
+++ b/py/test/Ice/retry/Client.py
@@ -10,22 +10,12 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
-#
-# Get Slice directory.
-#
-slice_dir = os.path.join(os.path.join(toplevel, "..", "slice"))
-if not os.path.exists(slice_dir):
+import Ice
+slice_dir = Ice.getSliceDir()
+if not slice_dir:
print sys.argv[0] + ': Slice directory not found.'
sys.exit(1)
-import Ice
Ice.loadSlice('-I' + slice_dir + ' Test.ice')
import AllTests
diff --git a/py/test/Ice/retry/Server.py b/py/test/Ice/retry/Server.py
index 421936558a6..4ad4a4a03c1 100755
--- a/py/test/Ice/retry/Server.py
+++ b/py/test/Ice/retry/Server.py
@@ -10,20 +10,9 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
-
-#
-# Get Slice directory.
-#
-slice_dir = os.path.join(os.path.join(toplevel, "..", "slice"))
-if not os.path.exists(slice_dir):
+slice_dir = Ice.getSliceDir()
+if not slice_dir:
print sys.argv[0] + ': Slice directory not found.'
sys.exit(1)
diff --git a/py/test/Ice/servantLocator/Client.py b/py/test/Ice/servantLocator/Client.py
index d89bcd2360f..cf17c8437bd 100755
--- a/py/test/Ice/servantLocator/Client.py
+++ b/py/test/Ice/servantLocator/Client.py
@@ -10,13 +10,6 @@
import os, sys
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
import Test, AllTests
diff --git a/py/test/Ice/servantLocator/Collocated.py b/py/test/Ice/servantLocator/Collocated.py
index 1cd88fe9f5e..5d4a6455f28 100755
--- a/py/test/Ice/servantLocator/Collocated.py
+++ b/py/test/Ice/servantLocator/Collocated.py
@@ -10,13 +10,6 @@
import os, sys, traceback, time
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
import Test, TestI, AllTests
diff --git a/py/test/Ice/servantLocator/Server.py b/py/test/Ice/servantLocator/Server.py
index 08abc51e980..54989423a63 100755
--- a/py/test/Ice/servantLocator/Server.py
+++ b/py/test/Ice/servantLocator/Server.py
@@ -10,13 +10,6 @@
import os, sys, traceback, time
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('Test.ice')
import Test, TestI
diff --git a/py/test/Ice/servantLocator/ServerAMD.py b/py/test/Ice/servantLocator/ServerAMD.py
index 92a3e9155bb..5e3ba8c5035 100755
--- a/py/test/Ice/servantLocator/ServerAMD.py
+++ b/py/test/Ice/servantLocator/ServerAMD.py
@@ -10,13 +10,6 @@
import os, sys, traceback, time
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('TestAMD.ice')
import Test, TestAMDI
diff --git a/py/test/Ice/slicing/exceptions/Client.py b/py/test/Ice/slicing/exceptions/Client.py
index 01c3a6979e7..d274b4f4a83 100755
--- a/py/test/Ice/slicing/exceptions/Client.py
+++ b/py/test/Ice/slicing/exceptions/Client.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice, AllTests
def run(args, communicator):
diff --git a/py/test/Ice/slicing/exceptions/Server.py b/py/test/Ice/slicing/exceptions/Server.py
index 9e4e6ccc796..97623902213 100755
--- a/py/test/Ice/slicing/exceptions/Server.py
+++ b/py/test/Ice/slicing/exceptions/Server.py
@@ -9,14 +9,6 @@
# **********************************************************************
import os, sys, traceback
-
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('-I. --all ServerPrivate.ice')
import Test
diff --git a/py/test/Ice/slicing/exceptions/ServerAMD.py b/py/test/Ice/slicing/exceptions/ServerAMD.py
index e3ffecca749..5f51a6aa828 100755
--- a/py/test/Ice/slicing/exceptions/ServerAMD.py
+++ b/py/test/Ice/slicing/exceptions/ServerAMD.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('-I. --all ServerPrivateAMD.ice')
import Test
diff --git a/py/test/Ice/slicing/objects/Client.py b/py/test/Ice/slicing/objects/Client.py
index 01c3a6979e7..d274b4f4a83 100755
--- a/py/test/Ice/slicing/objects/Client.py
+++ b/py/test/Ice/slicing/objects/Client.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice, AllTests
def run(args, communicator):
diff --git a/py/test/Ice/slicing/objects/Server.py b/py/test/Ice/slicing/objects/Server.py
index b7d6ee15d47..5543d0c831e 100755
--- a/py/test/Ice/slicing/objects/Server.py
+++ b/py/test/Ice/slicing/objects/Server.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('-I. --all ServerPrivate.ice Forward.ice')
import Test
diff --git a/py/test/Ice/slicing/objects/ServerAMD.py b/py/test/Ice/slicing/objects/ServerAMD.py
index 54860e7cd1c..46c2f133a84 100755
--- a/py/test/Ice/slicing/objects/ServerAMD.py
+++ b/py/test/Ice/slicing/objects/ServerAMD.py
@@ -10,13 +10,6 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
Ice.loadSlice('-I. --all ServerPrivateAMD.ice Forward.ice')
import Test
diff --git a/py/test/Ice/timeout/Client.py b/py/test/Ice/timeout/Client.py
index bdbb599c5dd..00a29ee9dd4 100755
--- a/py/test/Ice/timeout/Client.py
+++ b/py/test/Ice/timeout/Client.py
@@ -10,22 +10,11 @@
import os, sys, traceback
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
-#
-# Get Slice directory.
-#
-slice_dir = os.path.join(os.path.join(toplevel, "..", "slice"))
-if not os.path.exists(slice_dir):
+import Ice
+slice_dir = Ice.getSliceDir()
+if not slice_dir:
print sys.argv[0] + ': Slice directory not found.'
sys.exit(1)
-
-import Ice
Ice.loadSlice('-I' + slice_dir + ' Test.ice')
import AllTests
diff --git a/py/test/Ice/timeout/Server.py b/py/test/Ice/timeout/Server.py
index 40058144efe..631c6aea27e 100755
--- a/py/test/Ice/timeout/Server.py
+++ b/py/test/Ice/timeout/Server.py
@@ -10,20 +10,9 @@
import os, sys, traceback, time, threading
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
- break
-else:
- raise "can't find toplevel directory!"
-
import Ice
-
-#
-# Get Slice directory.
-#
-slice_dir = os.path.join(os.path.join(toplevel, "..", "slice"))
-if not os.path.exists(slice_dir):
+slice_dir = Ice.getSliceDir()
+if not slice_dir:
print sys.argv[0] + ': Slice directory not found.'
sys.exit(1)