Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ensure "sys.path" is properly set.

  • Loading branch information...
commit b8c6495a43d8b5072d40b2db3731fcb9f6a4ed7c 1 parent b1f98d3
@KelSolaar authored
View
19 bin/Umbra 100644 → 100755
@@ -15,6 +15,25 @@
"""
#**********************************************************************************************************************
+#*** External imports.
+#**********************************************************************************************************************
+import os
+import sys
+
+#**********************************************************************************************************************
+#*** Path manipulations.
+#**********************************************************************************************************************
+def _setApplicationPackageDirectory():
+ """
+ This definition sets the Application package directory in the path.
+ """
+
+ applicationPackageDirectory = os.path.normpath(os.path.join(os.path.dirname(__file__), "../"))
+ applicationPackageDirectory not in sys.path and sys.path.append(applicationPackageDirectory)
+
+_setApplicationPackageDirectory()
+
+#**********************************************************************************************************************
#*** Internal imports.
#**********************************************************************************************************************
from umbra.launcher import main
View
8 umbra/engine.py
@@ -41,15 +41,15 @@
#**********************************************************************************************************************
#*** Path manipulations.
#**********************************************************************************************************************
-def _setApplicationPackageDirectory():
+def _setPackageDirectory():
"""
This definition sets the Application package directory in the path.
"""
- applicationPackageDirectory = os.path.normpath(os.path.join(sys.path[0], "../"))
- applicationPackageDirectory not in sys.path and sys.path.append(applicationPackageDirectory)
+ packageDirectory = os.path.normpath(os.path.join(os.path.dirname(__file__), "../"))
+ packageDirectory not in sys.path and sys.path.append(packageDirectory)
-_setApplicationPackageDirectory()
+_setPackageDirectory()
#**********************************************************************************************************************
#*** Dependencies globals manipulation.
View
13 umbra/launcher.py
@@ -21,6 +21,19 @@
import sys
#**********************************************************************************************************************
+#*** Path manipulations.
+#**********************************************************************************************************************
+def _setPackageDirectory():
+ """
+ This definition sets the Application package directory in the path.
+ """
+
+ packageDirectory = os.path.normpath(os.path.join(os.path.dirname(__file__), "../"))
+ packageDirectory not in sys.path and sys.path.append(packageDirectory)
+
+_setPackageDirectory()
+
+#**********************************************************************************************************************
#*** Internal imports.
#**********************************************************************************************************************
import umbra.engine
View
8 umbra/tests/tests.py
@@ -39,18 +39,18 @@
#**********************************************************************************************************************
#*** Module classes and definitions.
#**********************************************************************************************************************
-def _setApplicationPackageDirectory():
+def _setPackageDirectory():
"""
This definition sets the package directory in the path.
:return: Definition success. ( Boolean )
"""
- applicationPackageDirectory = os.path.normpath(os.path.join(sys.path[0], "../"))
- applicationPackageDirectory not in sys.path and sys.path.append(applicationPackageDirectory)
+ packageDirectory = os.path.normpath(os.path.join(os.path.dirname(__file__), "../"))
+ packageDirectory not in sys.path and sys.path.append(packageDirectory)
return True
-_setApplicationPackageDirectory()
+_setPackageDirectory()
def testsSuite():
"""
Please sign in to comment.
Something went wrong with that request. Please try again.