[CalendarServer-changes] [12128] twext/trunk/bin/_twext_preamble.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 12 11:23:03 PDT 2014


Revision: 12128
          http://trac.calendarserver.org//changeset/12128
Author:   wsanchez at apple.com
Date:     2013-12-18 11:02:46 -0800 (Wed, 18 Dec 2013)
Log Message:
-----------
Fix preamble to add source root to sys.path.

Modified Paths:
--------------
    twext/trunk/bin/_twext_preamble.py

Modified: twext/trunk/bin/_twext_preamble.py
===================================================================
--- twext/trunk/bin/_twext_preamble.py	2013-12-18 18:29:24 UTC (rev 12127)
+++ twext/trunk/bin/_twext_preamble.py	2013-12-18 19:02:46 UTC (rev 12128)
@@ -14,9 +14,23 @@
 # limitations under the License.
 ##
 
+from __future__ import print_function
+
 """
-This module is the shared preamble for all calendarserver shell commands to set
-up their environment properly.  It's explicitly not installed along with the
-code, and is used only to initialize the environment for a development checkout
-of the code.
+This module is the shared preamble for all twext shell commands, to
+set up their environment properly.  It's explicitly not installed
+along with the code, and is used only to initialize the environment
+for a development checkout of the code.
 """
+
+import sys
+from os.path import dirname
+
+bindir = dirname(__file__)
+srcroot = dirname(bindir)
+
+sys.path.insert(0, srcroot)
+
+# print("PYTHONPATH:")
+# for path in sys.path:
+#     print("  ", path)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/b2ff0ef0/attachment.html>


More information about the calendarserver-changes mailing list