[Checkins] SVN: zc.z3monitor/trunk/src/zc/z3monitor/ New optional ``address`` product-config option to bind to a specific adapter

Adam Groszer agroszer at gmail.com
Sun Jan 17 10:52:05 EST 2010


Log message for revision 108197:
  New optional ``address`` product-config option to bind to a specific adapter
  

Changed:
  U   zc.z3monitor/trunk/src/zc/z3monitor/CHANGES.txt
  U   zc.z3monitor/trunk/src/zc/z3monitor/README.txt
  U   zc.z3monitor/trunk/src/zc/z3monitor/__init__.py

-=-
Modified: zc.z3monitor/trunk/src/zc/z3monitor/CHANGES.txt
===================================================================
--- zc.z3monitor/trunk/src/zc/z3monitor/CHANGES.txt	2010-01-17 15:44:35 UTC (rev 108196)
+++ zc.z3monitor/trunk/src/zc/z3monitor/CHANGES.txt	2010-01-17 15:52:04 UTC (rev 108197)
@@ -2,6 +2,14 @@
 Change History
 ==============
 
+0.7.1 (unreleased)
+==================
+
+Features
+--------
+
+* New optional ``address`` product-config option to bind to a specific adapter
+
 0.7.0 (2008-09-14)
 ==================
 

Modified: zc.z3monitor/trunk/src/zc/z3monitor/README.txt
===================================================================
--- zc.z3monitor/trunk/src/zc/z3monitor/README.txt	2010-01-17 15:44:35 UTC (rev 108196)
+++ zc.z3monitor/trunk/src/zc/z3monitor/README.txt	2010-01-17 15:52:04 UTC (rev 108197)
@@ -24,6 +24,14 @@
         port 8888
     </product-config>
 
+Optionally you can include an ``address`` parameter to bind to a specific
+adapter::
+
+    <product-config zc.z3monitor>
+        port 8888
+        address 127.0.0.1
+    </product-config>
+
 To include the default commands of zc.monitor and zc.z3monitor, simply include
 the configure.zcml from this package::
 

Modified: zc.z3monitor/trunk/src/zc/z3monitor/__init__.py
===================================================================
--- zc.z3monitor/trunk/src/zc/z3monitor/__init__.py	2010-01-17 15:44:35 UTC (rev 108196)
+++ zc.z3monitor/trunk/src/zc/z3monitor/__init__.py	2010-01-17 15:52:04 UTC (rev 108197)
@@ -172,7 +172,12 @@
             db.setActivityMonitor(ZODB.ActivityMonitor.ActivityMonitor())
 
     port = int(config['port'])
-    zc.monitor.start(int(config['port']))
+    try:
+        address = config['address']
+        zc.monitor.start(port, address = address)
+    except KeyError:
+        #being backwards compatible here and not passing address if not given
+        zc.monitor.start(port)
 
 @zope.component.adapter(
     zope.traversing.interfaces.IContainmentRoot,



More information about the checkins mailing list