[Zodb-checkins] SVN: zdaemon/trunk/src/zdaemon/zd Included "../lib/python" in the search path for modules

Yoshito Komatsu ykomatsu at akaumigame.org
Wed Jan 4 10:19:14 EST 2006


Log message for revision 41133:
  Included "../lib/python" in the search path for modules
  so that the scripts can find modules when Zope 3 is installed
  not in the standard path.
  

Changed:
  U   zdaemon/trunk/src/zdaemon/zdctl.py
  U   zdaemon/trunk/src/zdaemon/zdrun.py

-=-
Modified: zdaemon/trunk/src/zdaemon/zdctl.py
===================================================================
--- zdaemon/trunk/src/zdaemon/zdctl.py	2006-01-04 15:16:59 UTC (rev 41132)
+++ zdaemon/trunk/src/zdaemon/zdctl.py	2006-01-04 15:19:13 UTC (rev 41133)
@@ -58,6 +58,14 @@
     scriptdir = dirname(normpath(abspath(sys.argv[0])))
     if basename(scriptdir).lower() == "zdaemon":
         sys.path.append(dirname(scriptdir))
+    here = os.path.dirname(os.path.realpath(__file__))
+    swhome = os.path.dirname(here)
+    for parts in [("src",), ("lib", "python"), ("Lib", "site-packages")]:
+        d = os.path.join(swhome, *(parts + ("zdaemon",)))
+        if os.path.isdir(d):
+            d = os.path.join(swhome, *parts)
+            sys.path.insert(0, d)
+            break
 
 from zdaemon.zdoptions import RunnerOptions
 

Modified: zdaemon/trunk/src/zdaemon/zdrun.py
===================================================================
--- zdaemon/trunk/src/zdaemon/zdrun.py	2006-01-04 15:16:59 UTC (rev 41132)
+++ zdaemon/trunk/src/zdaemon/zdrun.py	2006-01-04 15:19:13 UTC (rev 41133)
@@ -83,6 +83,14 @@
     scriptdir = dirname(normpath(abspath(sys.argv[0])))
     if basename(scriptdir).lower() == "zdaemon":
         sys.path.append(dirname(scriptdir))
+    here = os.path.dirname(os.path.realpath(__file__))
+    swhome = os.path.dirname(here)
+    for parts in [("src",), ("lib", "python"), ("Lib", "site-packages")]:
+        d = os.path.join(swhome, *(parts + ("zdaemon",)))
+        if os.path.isdir(d):
+            d = os.path.join(swhome, *parts)
+            sys.path.insert(0, d)
+            break
 
 from zdaemon.zdoptions import RunnerOptions
 



More information about the Zodb-checkins mailing list