[Zope-Checkins] SVN: zdaemon/branches/jim-env/src/zdaemon/ Finished adding support for setting environment variables.

Jim Fulton jim at zope.com
Mon Jan 8 14:19:36 EST 2007


Log message for revision 71825:
  Finished adding support for setting environment variables.
  

Changed:
  U   zdaemon/branches/jim-env/src/zdaemon/README.txt
  U   zdaemon/branches/jim-env/src/zdaemon/component.xml
  U   zdaemon/branches/jim-env/src/zdaemon/tests/tests.py

-=-
Modified: zdaemon/branches/jim-env/src/zdaemon/README.txt
===================================================================
--- zdaemon/branches/jim-env/src/zdaemon/README.txt	2007-01-08 18:48:35 UTC (rev 71824)
+++ zdaemon/branches/jim-env/src/zdaemon/README.txt	2007-01-08 19:19:35 UTC (rev 71825)
@@ -27,6 +27,10 @@
 kill signal
     Send a signal to the daemon process
 
+reopen_transcript
+    Reopen the transcript log. See the discussion of the transacriot
+    log below.
+
 help command
     Get help on a command
 
@@ -137,8 +141,6 @@
     >>> system("./zdaemon -Cconf stop")
     daemon process stopped
 
-
-
 Environment Variables
 ---------------------
 
@@ -146,7 +148,6 @@
 a program.  Perhaps the most common case for this is setting
 LD_LIBRARY_PATH so that dynamically loaded libraries can be found.
 
-
     >>> open('conf', 'w').write(
     ... '''
     ... <runner>
@@ -154,14 +155,25 @@
     ...   socket-name /tmp/demo.zdsock
     ... </runner>
     ... <environment>
-    ...   LD_LIBRARY_PATH = /home/foo/lib
-    ...   HOME = /home/foo
+    ...   LD_LIBRARY_PATH /home/foo/lib
+    ...   HOME /home/foo
     ... </environment>
     ... ''')
 
     >>> system("./zdaemon -Cconf fg")
+    env
+    USER=jim
+    HOME=/home/foo
+    LOGNAME=jim
+    USERNAME=jim
+    TERM=dumb
+    PATH=/home/jim/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin
+    EMACS=t
+    LANG=en_US.UTF-8
+    SHELL=/bin/bash
+    EDITOR=emacs
+    LD_LIBRARY_PATH=/home/foo/lib
 
-
 Reference Documentation
 -----------------------
 

Modified: zdaemon/branches/jim-env/src/zdaemon/component.xml
===================================================================
--- zdaemon/branches/jim-env/src/zdaemon/component.xml	2007-01-08 18:48:35 UTC (rev 71824)
+++ zdaemon/branches/jim-env/src/zdaemon/component.xml	2007-01-08 19:19:35 UTC (rev 71825)
@@ -272,7 +272,7 @@
 
   </sectiontype>
 
-  <sectiontype name="environment">
+  <sectiontype name="environment" keytype="string">
     <key name="+"
          attribute="mapping"
          required="no"

Modified: zdaemon/branches/jim-env/src/zdaemon/tests/tests.py
===================================================================
--- zdaemon/branches/jim-env/src/zdaemon/tests/tests.py	2007-01-08 18:48:35 UTC (rev 71824)
+++ zdaemon/branches/jim-env/src/zdaemon/tests/tests.py	2007-01-08 19:19:35 UTC (rev 71825)
@@ -98,6 +98,11 @@
     print o.read(),
 
 
+def checkenv(match):
+    match = [a for a in match.group(1).split('\n')[:-1]
+             if a.split('=')[0] in ('HOME', 'LD_LIBRARY_PATH')]
+    match.sort()
+    return '\n'.join(match) + '\n'
 
 def test_suite():
     return unittest.TestSuite((
@@ -112,6 +117,7 @@
             setUp=setUp, tearDown=tearDown,
             checker=renormalizing.RENormalizing([
                 (re.compile('pid=\d+'), 'pid=NNN'),
+                (re.compile('^env\n((\w+=[^\n]*\n)+)$'), checkenv),
                 ])
         ),
         ))



More information about the Zope-Checkins mailing list