[Zope-Checkins] SVN: Zope/trunk/lib/python/AccessControl/Permissions.py - Forward port missing change from 2.7 branch. Humm, 1 year, 22 weeks ago, according to: http://thread.gmane.org/gmane.comp.web

2005-04-04 Thread Sidnei da Silva
Log message for revision 29877:
  
  - Forward port missing change from 2.7 branch. Humm, 1 year, 22 weeks ago, 
according to: http://thread.gmane.org/gmane.comp.web.zope.cvs/11080
  

Changed:
  U   Zope/trunk/lib/python/AccessControl/Permissions.py

-=-
Modified: Zope/trunk/lib/python/AccessControl/Permissions.py
===
--- Zope/trunk/lib/python/AccessControl/Permissions.py  2005-04-04 15:39:55 UTC 
(rev 29876)
+++ Zope/trunk/lib/python/AccessControl/Permissions.py  2005-04-05 00:35:58 UTC 
(rev 29877)
@@ -68,3 +68,6 @@
 view_history='View History'
 view_management_screens='View management screens'
 copy_or_move='Copy or Move'
+webdav_access='WebDAV access'
+webdav_lock_items='WebDAV Lock items'
+webdav_unlock_items='WebDAV Unlock items'

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] CVS: Packages/ZEO - component.xml:1.4.6.1 mkzeoinst.py:1.18.8.4 runzeo.py:1.15.6.5

2005-04-12 Thread Sidnei da Silva
Update of /cvs-repository/Packages/ZEO
In directory cvs.zope.org:/tmp/cvs-serv13625

Modified Files:
  Tag: Zope-2_7-branch
component.xml mkzeoinst.py runzeo.py 
Log Message:

* Borrow Zope's 'Signal' mechanism for Windows, if available, to
  implement clean shutdown and log rotation handlers for Windows.
* Back to creating a .PID for ZEO, so external programs that wish to set
  the 'signal' can get the PID and therefore derive the signal name.
  Currently only necessary on Windows but created on all platforms which
  implement os.getpid(), as long as the 'pid-filename' option is set,
  or the 'INSTANCE_HOME' environment variable can be found.


=== Packages/ZEO/component.xml 1.4 = 1.4.6.1 ===
--- Packages/ZEO/component.xml:1.4  Fri May 30 15:20:57 2003
+++ Packages/ZEO/component.xml  Tue Apr 12 22:54:54 2005
@@ -93,6 +93,15 @@
   /description
 /key
 
+key name=pid-filename datatype=existing-dirpath
+ required=no
+  description
+The full path to the file in which to write the ZEO server's Process ID
+at startup. If omitted, $INSTANCE/var/ZEO.pid is used.
+  /description
+  metadefault$INSTANCE/var/ZEO.pid (or $clienthome/ZEO.pid)/metadefault
+/key
+
   /sectiontype
 
 /component


=== Packages/ZEO/mkzeoinst.py 1.18.8.3 = 1.18.8.4 ===
--- Packages/ZEO/mkzeoinst.py:1.18.8.3  Wed Feb 18 17:10:14 2004
+++ Packages/ZEO/mkzeoinst.py   Tue Apr 12 22:54:54 2005
@@ -47,6 +47,7 @@
   address %(port)d
   read-only false
   invalidation-queue-size 100
+  # pid-filename $INSTANCE/var/ZEO.pid
   # monitor-address PORT
   # transaction-timeout SECONDS
 /zeo


=== Packages/ZEO/runzeo.py 1.15.6.4 = 1.15.6.5 ===
--- Packages/ZEO/runzeo.py:1.15.6.4 Wed Jan 14 14:07:00 2004
+++ Packages/ZEO/runzeo.py  Tue Apr 12 22:54:54 2005
@@ -48,6 +48,11 @@
 obj = ZConfig.datatypes.SocketAddress(arg)
 return obj.family, obj.address
 
+def windows_shutdown_handler():
+# Called by the signal mechanism on Windows to perform shutdown.
+import asyncore
+asyncore.close_all()
+
 class ZEOOptionsMixin:
 
 storages = None
@@ -95,6 +100,8 @@
  None, 'auth-database=')
 self.add('auth_realm', 'zeo.authentication_realm',
  None, 'auth-realm=')
+self.add('pid_file', 'zeo.pid_filename',
+ None, 'pid-file=')
 
 class ZEOOptions(ZDOptions, ZEOOptionsMixin):
 
@@ -117,6 +124,7 @@
 self.setup_default_logging()
 self.check_socket()
 self.clear_socket()
+self.make_pidfile()
 try:
 self.open_storages()
 self.setup_signals()
@@ -125,6 +133,7 @@
 finally:
 self.close_storages()
 self.clear_socket()
+self.remove_pidfile()
 
 def setup_default_logging(self):
 if self.options.config_logger is not None:
@@ -175,6 +184,8 @@
 method is called without additional arguments.
 
 if os.name != posix:
+if os.name == nt:
+self.setup_win32_signals()
 return
 if hasattr(signal, 'SIGXFSZ'):
 signal.signal(signal.SIGXFSZ, signal.SIG_IGN) # Special case
@@ -186,6 +197,27 @@
 method()
 signal.signal(sig, wrapper)
 
+def setup_win32_signals(self):
+# Borrow the Zope Signals package win32 support, if available.
+# Signals does a check/log for the availability of pywin32.
+try:
+import Signals.Signals
+except ImportError:
+debug(Signals package not found. 
+  Windows-specific signal handler 
+  will *not* be installed.)
+return
+SignalHandler = Signals.Signals.SignalHandler
+if SignalHandler is not None: # may be None if no pywin32.
+SignalHandler.registerHandler(signal.SIGTERM,
+  windows_shutdown_handler)
+SignalHandler.registerHandler(signal.SIGINT,
+  windows_shutdown_handler)
+# Can use the log rotate handler too.
+from Signals.Signals import logfileRotateHandler
+SIGUSR2 = 12 # not in signal module on Windows.
+SignalHandler.registerHandler(SIGUSR2, logfileRotateHandler)
+
 def create_server(self):
 from ZEO.StorageServer import StorageServer
 self.server = StorageServer(
@@ -232,6 +264,53 @@
 except: # Keep going
 exception(failed to close storage %r % name)
 
+def _get_pidfile(self):
+pidfile = self.options.pid_file
+# 'pidfile' is marked as not required.
+if not pidfile:
+# Try to find a reasonable location if the pidfile is not
+# set. If we are running in a Zope environment, we can
+# safely assume INSTANCE_HOME.
+instance_home = os.environ.get(INSTANCE_HOME)
+if not 

[Zope-Checkins] CVS: Zope/skel/bin - zopeservice.py.in:1.1.2.10

2005-04-12 Thread Sidnei da Silva
Update of /cvs-repository/Zope/skel/bin
In directory cvs.zope.org:/tmp/cvs-serv27740/skel/bin

Modified Files:
  Tag: Zope-2_7-branch
zopeservice.py.in 
Log Message:

Major service enhancements.  Service cleanly shuts down child, and if child
fails the tail of the process output (which generally contains a traceback)
is
written to the event log.

Minor tweaks to the Windows build 'clean' process and documentation tweaks.


=== Zope/skel/bin/zopeservice.py.in 1.1.2.9 = 1.1.2.10 ===
--- Zope/skel/bin/zopeservice.py.in:1.1.2.9 Thu Dec 16 13:08:39 2004
+++ Zope/skel/bin/zopeservice.py.in Tue Apr 12 23:41:34 2005
@@ -38,8 +38,9 @@
 
   install : Installs the service
 
-  update : Updates the service, use this when you change
-   the service class implementation 
+  update : Updates the service.  Use this if you change any
+   configuration settings and need the service to be
+   re-registered.
 
   remove : Removes the service
 
@@ -53,13 +54,9 @@
 
   debug : Runs the service in debug mode
 
-You can view the usage options by running ntservice.py without any
+You can view the usage options by running this module without any
 arguments.
 
-Note: you may have to register the Python service program first,
-
-  win32\PythonService.exe /register
-
   Starting Zope
 
 Start Zope by clicking the 'start' button in the services control
@@ -74,19 +71,17 @@
 
   Event logging
 
-Zope events are logged to the NT application event log. Use the
-event viewer to keep track of Zope events.
+Service related events (such as startup, shutdown, or errors executing
+the Zope process) are logged to the NT application event log. Use the
+event viewer to see these events.
 
-Note: to successfully run this script, the Zope software home needs to be on
-the PYTHONPATH.
-
+Zope Events are still written to the Zope event logs.
 
-import os.path
-from os.path import dirname as dn
-import sys
+
+import sys, os
 
 # these are replacements from mkzopeinstance
-PYTHONW = r'PYTHONW'
+PYTHON = r'PYTHON'
 SOFTWARE_HOME=r'SOFTWARE_HOME'
 INSTANCE_HOME = r'INSTANCE_HOME'
 ZOPE_HOME = r'ZOPE_HOME'
@@ -95,17 +90,35 @@
 CONFIG_FILE= os.path.join(INSTANCE_HOME, 'etc', 'zope.conf')
 PYTHONSERVICE_EXE=r'%s\bin\PythonService.exe' % ZOPE_HOME
 
-os.environ['PYTHONPATH'] = SOFTWARE_HOME
+# Setup the environment, so sub-processes see these variables
+parts = os.environ.get(PYTHONPATH, ).split(os.pathsep)
+if SOFTWARE_HOME not in parts:
+parts = filter(None, [SOFTWARE_HOME] + parts)
+os.environ[PYTHONPATH] = os.pathsep.join(parts)
+os.environ[INSTANCE_HOME] = INSTANCE_HOME
+
+# Ensure SOFTWARE_HOME is on our current sys.path so we can import the
+# nt_svcutils package.
+if SOFTWARE_HOME not in sys.path:
+sys.path.insert(0, SOFTWARE_HOME)
 
 from nt_svcutils.service import Service
 
 servicename = 'Zope_%s' % str(hash(INSTANCE_HOME.lower()))
 
 class InstanceService(Service):
-start_cmd = '%s %s -C %s' % (PYTHONW, ZOPE_RUN, CONFIG_FILE)
 _svc_name_ = servicename
 _svc_display_name_ = 'Zope instance at %s' % INSTANCE_HOME
-_exe_name_ = PYTHONSERVICE_EXE
+# _svc_description_ can also be set (but what to say isn't clear!)
+# If the exe we expect is not there, let the service framework search
+# for it.  This will be true for people running from source builds and
+# relying on pre-installed pythonservice.exe.
+# Note this is only used at install time, not runtime.
+if os.path.isfile(PYTHONSERVICE_EXE):
+_exe_name_ = PYTHONSERVICE_EXE
+
+process_runner = PYTHON
+process_args = '%s -C %s' % (ZOPE_RUN, CONFIG_FILE)
 
 if __name__ == '__main__':
 import win32serviceutil

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] CVS: Zope/lib/python/nt_svcutils - service.py:1.1.2.3

2005-04-13 Thread Sidnei da Silva
Update of /cvs-repository/Zope/lib/python/nt_svcutils
In directory cvs.zope.org:/tmp/cvs-serv6352

Modified Files:
  Tag: Zope-2_7-branch
service.py 
Log Message:

- Don't kill the service if we can't write to the event log


=== Zope/lib/python/nt_svcutils/service.py 1.1.2.2 = 1.1.2.3 ===
--- Zope/lib/python/nt_svcutils/service.py:1.1.2.2  Tue Apr 12 23:41:34 2005
+++ Zope/lib/python/nt_svcutils/service.py  Wed Apr 13 21:47:48 2005
@@ -93,24 +93,35 @@
 
 def logmsg(self, event):
 # log a service event using servicemanager.LogMsg
-from servicemanager import LogMsg, EVENTLOG_INFORMATION_TYPE
-LogMsg(EVENTLOG_INFORMATION_TYPE, event,
-   (self._svc_name_,  (%s) % self._svc_display_name_))
+try:
+servicemanager.LogMsg(servicemanager.EVENTLOG_INFORMATION_TYPE,
+  event,
+  (self._svc_name_,
+(%s) % self._svc_display_name_))
+except win32api.error, details:
+# Failed to write a log entry - most likely problem is
+# that the event log is full.  We don't want this to kill us
+print FAILED to write INFO event, event, :, details
+
+def _dolog(self, func, msg):
+try:
+fullmsg = %s (%s): %s % \
+  (self._svc_name_, self._svc_display_name_, msg)
+func(fullmsg)
+except win32api.error, details:
+# Failed to write a log entry - most likely problem is
+# that the event log is full.  We don't want this to kill us
+print FAILED to write event log entry:, details
+print msg
 
 def info(self, s):
-from servicemanager import LogInfoMsg
-LogInfoMsg(%s (%s): %s %
-   (self._svc_name_, self._svc_display_name_, s))
+self._dolog(servicemanager.LogInfoMsg, s)
 
 def warning(self, s):
-from servicemanager import LogWarningMsg
-LogWarningMsg(%s (%s): %s %
-  (self._svc_name_, self._svc_display_name_, s))
+self._dolog(servicemanager.LogWarningMsg, s)
 
 def error(self, s):
-from servicemanager import LogErrorMsg
-LogErrorMsg(%s (%s): %s %
-(self._svc_name_, self._svc_display_name_, s))
+self._dolog(servicemanager.LogErrorMsg, s)
 
 def SvcDoRun(self):
 # indicate to Zope that the process is daemon managed (restartable)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/ Major service enhancements. Service cleanly shuts down child, and if child

2005-04-13 Thread Sidnei da Silva
Log message for revision 29975:
  
  Major service enhancements.  Service cleanly shuts down child, and if child
  fails the tail of the process output (which generally contains a traceback)
  is
  written to the event log.
  
  Minor tweaks to the Windows build 'clean' process and documentation tweaks.
  
  Don't kill the service if we can't write to the event log
  

Changed:
  U   Zope/trunk/doc/INSTALL.txt
  A   Zope/trunk/doc/WINDOWS.txt
  U   Zope/trunk/inst/Makefile.win.in
  U   Zope/trunk/inst/configure.py
  U   Zope/trunk/lib/python/nt_svcutils/service.py
  U   Zope/trunk/skel/bin/runzope.bat.in
  U   Zope/trunk/skel/bin/zopeservice.py.in
  U   Zope/trunk/utilities/mkzopeinstance.py

-=-
Modified: Zope/trunk/doc/INSTALL.txt
===
--- Zope/trunk/doc/INSTALL.txt  2005-04-14 01:57:47 UTC (rev 29974)
+++ Zope/trunk/doc/INSTALL.txt  2005-04-14 02:00:15 UTC (rev 29975)
@@ -3,6 +3,9 @@
 
   Welcome to Zope!  This document describes building and installing
   Zope on UNIX and Linux.
+  
+  See WINDOWS.txt for information about Windows.  See the PLATFORMS
+  directory for notes about various other platforms.
 
 System requirements when building from source
 

Added: Zope/trunk/doc/WINDOWS.txt
===
--- Zope/trunk/doc/WINDOWS.txt  2005-04-14 01:57:47 UTC (rev 29974)
+++ Zope/trunk/doc/WINDOWS.txt  2005-04-14 02:00:15 UTC (rev 29975)
@@ -0,0 +1,69 @@
+How to build and install Zope from source code on Windows.
+--
+These instructions appear to work for 2.7 and the trunk:
+
+* Ensure you have the correct MSVC version installed for the
+  version of Python you will be using.
+  
+* Install (or build from sources) Python
+  http://www.python.org
+  
+* Install (or build from sources) the Python for Windows extensions
+  http://sourceforge.net/projects/pywin32/
+
+* Unpack the Zope source distribution or pull from CVS.  Change
+  to that directory.
+
+* Execute:
+  % python.exe inst\configure.py
+  It should say something like:
+  
+   - Zope top-level binary directory will be c:\Zope-2.7.
+   - Makefile written.
+  
+   Next, run the Visual C++ batch file VCVARS32.bat and then nmake.
+
+  (run 'configure.py --help' to see how to change things)
+
+* 'makefile' will have ben created.  As instructed, execute 'nmake'.  
+  If the build succeeds, the last message printed should be:
+   Zope built.  Next, do 'nmake install'.
+
+* As instructed, execute 'nmake install'.  A few warnings will be generated, 
+  but they can be ignored.  The last message in the build process should be:
+   Zope binaries installed successfully.
+
+* If you are running from CVS, the build may fail:
+  See http://collector.zope.org/Zope/1530
+   running install_data
+   error: can't copy 'version.txt': no matching files
+   NMAKE : fatal error U1077: 'e:\src\python-2.3-cvs\pcbuild\python.exe' : 
return code '0x1'
+   Stop.
+
+  If you see this error, edit setup.py and comment the line referencing 
+  'version.txt'
+
+* Zope itself has now been installed.  We need to create an instance.  Run:
+  % python.exe {install_path}\bin\mkzopeinstance.py
+  
+  We will be prompted, via the console, for the instance directory and 
+  username/password for the admin user.
+
+* We are now ready to start zope.  Run:
+  % {zope_instance}\run_zope.bat.
+  Zope should start with nice log messages being printed to
+  stdout.  When Zope is ready, you should see:
+   --
+   2004-10-13T12:27:58 INFO(0) Zope Ready to handle requests
+  
+  Press Ctrl+C to stop this instance of the server.
+
+* Optionally, install as a Windows service.  Execute:
+  % python {zope_instance}\zope_service.py
+  to see the valid options.  You may want something like:
+  % python {zope_instance}\zope_service.py --startup=auto install
+
+  Once installed, it can be started any number of ways:
+  - python {zope_instance}\zope_service.py start
+  - Control Panel
+  - net start service_short_name (eg, net start Zope_-1227678699


Property changes on: Zope/trunk/doc/WINDOWS.txt
___
Name: svn:eol-style
   + native

Modified: Zope/trunk/inst/Makefile.win.in
===
--- Zope/trunk/inst/Makefile.win.in 2005-04-14 01:57:47 UTC (rev 29974)
+++ Zope/trunk/inst/Makefile.win.in 2005-04-14 02:00:15 UTC (rev 29975)
@@ -31,15 +31,15 @@
 XCOPY=xcopy /i /s /e /y
 COPY=copy
 
-.PHONY: clean install build unbuild
-.PHONY: default
-
 default: build
 # default: The default step (invoked when make is called without a target)
@ echo.
@ echo Zope built.  Next, do 'nmake install'.
-   @ echo
+   @ echo.
 
+.PHONY: clean install build unbuild
+.PHONY: default
+
 # build:   Do whatever 'setup.py build' implies
 build:
$(PYTHON) $(BASE_DIR)\setup.py \
@@ -47,7 +47,7 

[Zope-Checkins] SVN: Zope/trunk/lib/python/ZConfig/components/logger/loghandler.py * Implement a file handler with 'rotate'. This closes the file, attempts

2005-04-13 Thread Sidnei da Silva
Log message for revision 29977:
  
  * Implement a file handler with 'rotate'.  This closes the file, attempts
a rename to {filename}.last, then reopens the original name.  This
then makes the log available for another process to perform the rotation
logic on. This log handler is only installed on the Windows
platform, where you can't rename an open file.
  

Changed:
  U   Zope/trunk/lib/python/ZConfig/components/logger/loghandler.py

-=-
Modified: Zope/trunk/lib/python/ZConfig/components/logger/loghandler.py
===
--- Zope/trunk/lib/python/ZConfig/components/logger/loghandler.py   
2005-04-14 02:01:49 UTC (rev 29976)
+++ Zope/trunk/lib/python/ZConfig/components/logger/loghandler.py   
2005-04-14 02:08:52 UTC (rev 29977)
@@ -13,7 +13,7 @@
 
 Handlers which can plug into a PEP 282 logger.
 
-import os.path
+import os
 import sys
 
 from logging import Handler, StreamHandler
@@ -42,7 +42,28 @@
 self.close()
 self.stream = open(self.baseFilename, self.mode)
 
+class Win32FileHandler(FileHandler):
+File-based log handler for Windows that supports an additional 'rotate'
+method.  reopen() is generally useless since Windows cannot do a move on
+an open file.
+
+def rotate(self, rotateFilename=None):
+if not rotateFilename:
+rotateFilename = self.baseFilename + .last
+error = None
+self.close()
+try:
+os.rename(self.baseFilename, rotateFilename)
+except OSError:
+pass
 
+self.stream = open(self.baseFilename, self.mode)
+
+if os.name == nt:
+# Make it the default for Windows - we install a 'reopen' handler that
+# tries to rotate the logfile.
+FileHandler = Win32FileHandler
+
 class NullHandler(Handler):
 Handler that does nothing.
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] CVS: Zope/inst - Makefile.win.in:1.6.2.5

2005-04-21 Thread Sidnei da Silva
Update of /cvs-repository/Zope/inst
In directory cvs.zope.org:/tmp/cvs-serv16981

Modified Files:
  Tag: Zope-2_7-branch
Makefile.win.in 
Log Message:

- A quote too much there


=== Zope/inst/Makefile.win.in 1.6.2.4 = 1.6.2.5 ===
--- Zope/inst/Makefile.win.in:1.6.2.4   Wed Apr 13 01:36:26 2005
+++ Zope/inst/Makefile.win.in   Thu Apr 21 10:10:19 2005
@@ -59,7 +59,7 @@
 
 # version_txt: create a version file in lib/python/version.txt
 version_txt:
-   echo Zope $(MAJOR_VERSION).$(MINOR_VERSION)-$(RELEASE_TAG) \
+   echo Zope $(MAJOR_VERSION).$(MINOR_VERSION)-$(RELEASE_TAG) \
   $(BASE_DIR)/lib/python/version.txt
 
 # clean:   Delete the build files and any binaries/bytecode files in
@@ -67,6 +67,6 @@
 clean: unbuild
$(CD) $(BASE_DIR)
-$(RM) /s *.pyc *.pyo *.dll *.o *.obj *.pyd
-
+   -$(RM) (BASE_DIR)/lib/python/version.txt
 
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/ZServer/ - Make it so webdav-source server is distinguishable from the default http server in the ZMI and event.log

2005-05-20 Thread Sidnei da Silva
Log message for revision 30467:
  
  - Make it so webdav-source server is distinguishable from the default http 
server in the ZMI and event.log
  

Changed:
  U   Zope/trunk/lib/python/ZServer/HTTPServer.py
  U   Zope/trunk/lib/python/ZServer/datatypes.py

-=-
Modified: Zope/trunk/lib/python/ZServer/HTTPServer.py
===
--- Zope/trunk/lib/python/ZServer/HTTPServer.py 2005-05-20 15:56:59 UTC (rev 
30466)
+++ Zope/trunk/lib/python/ZServer/HTTPServer.py 2005-05-20 17:23:05 UTC (rev 
30467)
@@ -380,8 +380,8 @@
 class zhttp_server(http_server):
 http server
 
-SERVER_IDENT='Zope/%s ZServer/%s' % (ZOPE_VERSION,ZSERVER_VERSION)
-
+SERVER_IDENT = 'Zope/%s ZServer/%s' % (ZOPE_VERSION, ZSERVER_VERSION)
+server_protocol = 'HTTP'
 channel_class = zhttp_channel
 shutup=0
 
@@ -389,16 +389,17 @@
 self.shutup=1
 http_server.__init__(self, ip, port, resolver, logger_object)
 self.shutup=0
-self.log_info('HTTP server started at %s\n'
+self.log_info('%s server started at %s\n'
   '\tHostname: %s\n\tPort: %d' % (
-time.ctime(time.time()),
-self.server_name,
-self.server_port
-))
+self.server_protocol,
+time.ctime(time.time()),
+self.server_name,
+self.server_port
+))
 
 def clean_shutdown_control(self,phase,time_in_this_phase):
 if phase==2:
-self.log_info('closing HTTP to new connections')
+self.log_info('closing %s to new connections' % 
self.server_protocol)
 self.close()
 
 def log_info(self, message, type='info'):
@@ -418,3 +419,6 @@
 # override asyncore limits for nt's listen queue size
 self.accepting = 1
 return self.socket.listen (num)
+
+class zwebdav_server(zhttp_server):
+server_protocol = 'WebDAV'

Modified: Zope/trunk/lib/python/ZServer/datatypes.py
===
--- Zope/trunk/lib/python/ZServer/datatypes.py  2005-05-20 15:56:59 UTC (rev 
30466)
+++ Zope/trunk/lib/python/ZServer/datatypes.py  2005-05-20 17:23:05 UTC (rev 
30467)
@@ -58,27 +58,29 @@
 
 
 class HTTPServerFactory(ServerFactory):
+
 def __init__(self, section):
+from ZServer import HTTPServer
 if not section.address:
 raise ZConfig.ConfigurationError(
 No 'address' settings found 
 within the 'http-server' or 'webdav-source-server' section)
 ServerFactory.__init__(self, section.address)
+self.server_class = HTTPServer.zhttp_server
 self.force_connection_close = section.force_connection_close
 # webdav-source-server sections won't have webdav_source_clients:
 webdav_clients = getattr(section, webdav_source_clients, None)
 self.webdav_source_clients = webdav_clients
 
 def create(self):
-from ZServer import HTTPServer
 from ZServer.AccessLogger import access_logger
 handler = self.createHandler()
 handler._force_connection_close = self.force_connection_close
 if self.webdav_source_clients:
 handler.set_webdav_source_clients(self.webdav_source_clients)
-server = HTTPServer.zhttp_server(ip=self.ip, port=self.port,
- resolver=self.dnsresolver,
- logger_object=access_logger)
+server = self.server_class(ip=self.ip, port=self.port,
+   resolver=self.dnsresolver,
+   logger_object=access_logger)
 server.install_handler(handler)
 return server
 
@@ -88,6 +90,12 @@
 
 
 class WebDAVSourceServerFactory(HTTPServerFactory):
+
+def __init__(self, section):
+from ZServer import HTTPServer
+HTTPServerFactory.__init__(self, section)
+self.server_class = HTTPServer.zwebdav_server
+
 def createHandler(self):
 from ZServer.WebDAVSrcHandler import WebDAVSrcHandler
 return WebDAVSrcHandler(self.module, '', self.cgienv)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] CVS: Zope/lib/python/ZServer - HTTPServer.py:1.46.2.5 datatypes.py:1.2.8.3

2005-05-20 Thread Sidnei da Silva
Update of /cvs-repository/Zope/lib/python/ZServer
In directory cvs.zope.org:/tmp/cvs-serv16993

Modified Files:
  Tag: Zope-2_7-branch
HTTPServer.py datatypes.py 
Log Message:

- Make it so webdav-source server is distinguishable from the default http 
server in the ZMI and event.log


=== Zope/lib/python/ZServer/HTTPServer.py 1.46.2.4 = 1.46.2.5 ===
--- Zope/lib/python/ZServer/HTTPServer.py:1.46.2.4  Wed Dec  1 18:01:48 2004
+++ Zope/lib/python/ZServer/HTTPServer.py   Fri May 20 13:39:52 2005
@@ -380,8 +380,8 @@
 class zhttp_server(http_server):
 http server
 
-SERVER_IDENT='Zope/%s ZServer/%s' % (ZOPE_VERSION,ZSERVER_VERSION)
-
+SERVER_IDENT = 'Zope/%s ZServer/%s' % (ZOPE_VERSION, ZSERVER_VERSION)
+server_protocol = 'HTTP'
 channel_class = zhttp_channel
 shutup=0
 
@@ -389,16 +389,17 @@
 self.shutup=1
 http_server.__init__(self, ip, port, resolver, logger_object)
 self.shutup=0
-self.log_info('HTTP server started at %s\n'
+self.log_info('%s server started at %s\n'
   '\tHostname: %s\n\tPort: %d' % (
-time.ctime(time.time()),
-self.server_name,
-self.server_port
-))
+self.server_protocol,
+time.ctime(time.time()),
+self.server_name,
+self.server_port
+))
 
 def clean_shutdown_control(self,phase,time_in_this_phase):
 if phase==2:
-self.log_info('closing HTTP to new connections')
+self.log_info('closing %s to new connections' % 
self.server_protocol)
 self.close()
 
 def log_info(self, message, type='info'):
@@ -418,3 +419,6 @@
 # override asyncore limits for nt's listen queue size
 self.accepting = 1
 return self.socket.listen (num)
+
+class zwebdav_server(zhttp_server):
+server_protocol = 'WebDAV'


=== Zope/lib/python/ZServer/datatypes.py 1.2.8.2 = 1.2.8.3 ===
--- Zope/lib/python/ZServer/datatypes.py:1.2.8.2Fri May 28 02:13:23 2004
+++ Zope/lib/python/ZServer/datatypes.pyFri May 20 13:39:53 2005
@@ -53,26 +53,27 @@
 
 class HTTPServerFactory(ServerFactory):
 def __init__(self, section):
+from ZServer import HTTPServer
 if not section.address:
 raise ZConfig.ConfigurationError(
 No 'address' settings found 
 within the 'http-server' or 'webdav-source-server' section)
 ServerFactory.__init__(self, section.address)
+self.server_class = HTTPServer.zhttp_server
 self.force_connection_close = section.force_connection_close
 # webdav-source-server sections won't have webdav_source_clients:
 webdav_clients = getattr(section, webdav_source_clients, None)
 self.webdav_source_clients = webdav_clients
 
 def create(self):
-from ZServer import HTTPServer
 from ZServer.AccessLogger import access_logger
 handler = self.createHandler()
 handler._force_connection_close = self.force_connection_close
 if self.webdav_source_clients:
 handler.set_webdav_source_clients(self.webdav_source_clients)
-server = HTTPServer.zhttp_server(ip=self.host, port=self.port,
- resolver=self.dnsresolver,
- logger_object=access_logger)
+server = self.server_class(ip=self.host, port=self.port,
+   resolver=self.dnsresolver,
+   logger_object=access_logger)
 server.install_handler(handler)
 return server
 
@@ -82,6 +83,11 @@
 
 
 class WebDAVSourceServerFactory(HTTPServerFactory):
+def __init__(self, section):
+from ZServer import HTTPServer
+HTTPServerFactory.__init__(self, section)
+self.server_class = HTTPServer.zwebdav_server
+
 def createHandler(self):
 from ZServer.WebDAVSrcHandler import WebDAVSrcHandler
 return WebDAVSrcHandler(self.module, '', self.cgienv)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] CVS: Zope/doc - CHANGES.txt:1.625.2.332

2005-05-20 Thread Sidnei da Silva
Update of /cvs-repository/Zope/doc
In directory cvs.zope.org:/tmp/cvs-serv18142/doc

Modified Files:
  Tag: Zope-2_7-branch
CHANGES.txt 
Log Message:

- Note about the change


=== Zope/doc/CHANGES.txt 1.625.2.331 = 1.625.2.332 ===
--- Zope/doc/CHANGES.txt:1.625.2.331Tue May 17 14:10:41 2005
+++ Zope/doc/CHANGES.txtFri May 20 13:43:58 2005
@@ -3,15 +3,18 @@
   This file contains change information for the current Zope release.
   Change information for previous versions of Zope can be found in the
   file HISTORY.txt.
-  
+
 
   after Zope 2.7.6 (unreleased)
 
 Bugs fixed
 
+  - Made WebDAV server distinguishable from the default HTTP
+server both in the ZMI and in event.log.
+
   - Collector #1784: fixed handling of multiple attributes in ZCTextIndex
 
-  - Collector #1751: Improved error reporting reporting during the 
+  - Collector #1751: Improved error reporting reporting during the
 startup phase
 
   - Collector #1745: Fixed ZSQL error KeyError 'query'
@@ -22,8 +25,8 @@
 
 Bugs fixed
 
-  - The previous fix to ZopeUndo/Prefix.py for collector #1726 
-introduced a new bug. This is fixed, but in order to avoid 
+  - The previous fix to ZopeUndo/Prefix.py for collector #1726
+introduced a new bug. This is fixed, but in order to avoid
 bug #1726 in a ZEO environment, you should upgrade the
 ZEO server to at least ZODB 3.2.8 (ships with Zope 2.7.6 final).
 For details, see the ZODB 3.2.8 NEWS file.
@@ -51,9 +54,9 @@
   - Collector #1460: Backported test for this bug (which was *not*
 present on the Zope 2.7 branch).
 
-  - Collector #1726: Transactions from a folder /foo would incorrectly 
+  - Collector #1726: Transactions from a folder /foo would incorrectly
 appear in the Undo management screen for a folder /foobar.
-Fixed so that a prefix must be considered as a path. 
+Fixed so that a prefix must be considered as a path.
 
   - ZPublisher would fail to recognize a XML-RPC request if the
 content-type header included a 'charset' parameter.
@@ -160,7 +163,7 @@
   - Collector #1657: Don't break host-based virtual hosting when
 purging an HTTP accelerator cache.
 
-  - Collector: #1651: removed compiler warning 
+  - Collector: #1651: removed compiler warning
 
   Zope 2.7.4 final (2005/01/15)
 
@@ -180,7 +183,7 @@
   Zope 2.7.4 RC 2 (2005/01/07)
 
 Bugs fixed
-  
+
   - Collector #1407: fixed XML escaping problem introduced in 2.7.4 b1
 
   - moved Docutils back to lib/python/docutils
@@ -210,7 +213,7 @@
 
 Bugs fixed
 
-  - Collector #1617: fixed unchecked buffer accesses and unchecked 
+  - Collector #1617: fixed unchecked buffer accesses and unchecked
 Python API calls in cAccessControl.c (thanks to Tim Peters)
 
   Zope 2.7.4 beta 1 (2004/12/02)
@@ -228,7 +231,7 @@
 
   - The REQUEST now contains a new entry ACTUAL_URL which contains the
 full URL without query string as it appears within the location bar of
-the browser. The key has been added to provide a single key that is 
+the browser. The key has been added to provide a single key that is
 available for vhosted and non-vhosted installations.
 
   - Collector #1605: VHM did not quote URLs

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] CVS: Packages/webdav - Resource.py:1.55.10.10

2005-06-21 Thread Sidnei da Silva
Update of /cvs-repository/Packages/webdav
In directory cvs.zope.org:/tmp/cvs-serv30574/lib/python/webdav

Modified Files:
  Tag: Zope-2_7-branch
Resource.py 
Log Message:

  - WebDAV COPY and MOVE did not call '_notifyOfCopyTo' and
'_postCopy' hooks like it was done in
OFS.CopySupport. Additionally added
'manage_changeOwnershipType' to make MOVE behave even closer
to OFS.CopySupport.


=== Packages/webdav/Resource.py 1.55.10.9 = 1.55.10.10 ===
--- Packages/webdav/Resource.py:1.55.10.9   Wed Dec 22 18:29:30 2004
+++ Packages/webdav/Resource.py Tue Jun 21 11:27:30 2005
@@ -377,6 +377,7 @@
 else:
 raise Locked, 'Destination is locked.'
 
+self._notifyOfCopyTo(parent, op=0)
 ob = self._getCopy(parent)
 ob._setId(name)
 
@@ -389,6 +390,7 @@
 parent._delObject(name)
 parent._setObject(name, ob)
 ob = parent._getOb(name)
+ob._postCopy(parent, op=0)
 ob.manage_afterClone(ob)
 # We remove any locks from the copied object because webdav clients
 # don't track the lock status and the lock token for copied resources
@@ -485,7 +487,12 @@
 raise PreconditionFailed, 'Source is locked and no '\
   'condition was passed in.'
 
-ob=aq_base(self._getCopy(parent))
+# try to make ownership explicit so that it gets carried
+# along to the new location if needed.
+self.manage_changeOwnershipType(explicit=1)
+
+self._notifyOfCopyTo(parent, op=1)
+ob = aq_base(self._getCopy(parent))
 self.aq_parent._delObject(absattr(self.id))
 ob._setId(name)
 if existing:
@@ -493,6 +500,12 @@
 self.dav__validate(object, 'DELETE', REQUEST)
 parent._delObject(name)
 parent._setObject(name, ob)
+ob = parent._getOb(name)
+ob._postCopy(parent, op=1)
+
+# try to make ownership implicit if possible
+ob.manage_changeOwnershipType(explicit=0)
+
 RESPONSE.setStatus(existing and 204 or 201)
 if not existing:
 RESPONSE.setHeader('Location', dest)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] CVS: Zope/doc - CHANGES.txt:1.625.2.338

2005-06-21 Thread Sidnei da Silva
Update of /cvs-repository/Zope/doc
In directory cvs.zope.org:/tmp/cvs-serv30574/doc

Modified Files:
  Tag: Zope-2_7-branch
CHANGES.txt 
Log Message:

  - WebDAV COPY and MOVE did not call '_notifyOfCopyTo' and
'_postCopy' hooks like it was done in
OFS.CopySupport. Additionally added
'manage_changeOwnershipType' to make MOVE behave even closer
to OFS.CopySupport.


=== Zope/doc/CHANGES.txt 1.625.2.337 = 1.625.2.338 ===
--- Zope/doc/CHANGES.txt:1.625.2.337Sun Jun 12 20:41:06 2005
+++ Zope/doc/CHANGES.txtTue Jun 21 11:27:29 2005
@@ -14,6 +14,12 @@
 
 Bugs fixed
 
+  - WebDAV COPY and MOVE did not call '_notifyOfCopyTo' and
+'_postCopy' hooks like it was done in
+OFS.CopySupport. Additionally added
+'manage_changeOwnershipType' to make MOVE behave even closer
+to OFS.CopySupport.
+
   - Collector #1548: Fix 'httplib' usage in ZPublisher.Client.
 
   - Collector #1797: when a File/Image object returned a 304 response

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/ Forward-port fix from 2.7:

2005-06-21 Thread Sidnei da Silva
Log message for revision 30875:
  
  Forward-port fix from 2.7:
  
- WebDAV COPY and MOVE did not call '_notifyOfCopyTo' and
  '_postCopy' hooks like it was done in
  OFS.CopySupport. Additionally added
  'manage_changeOwnershipType' to make MOVE behave even closer
  to OFS.CopySupport.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/webdav/Resource.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2005-06-21 10:28:34 UTC (rev 30874)
+++ Zope/trunk/doc/CHANGES.txt  2005-06-21 15:30:24 UTC (rev 30875)
@@ -39,6 +39,12 @@
   - Collector #1808: manage_convertIndexes no longer tries to change the
 index types causing some trouble with CMF.
 
+  - WebDAV COPY and MOVE did not call '_notifyOfCopyTo' and
+'_postCopy' hooks like it was done in
+OFS.CopySupport. Additionally added
+'manage_changeOwnershipType' to make MOVE behave even closer
+to OFS.CopySupport.
+
   - Collector #1548: Fix 'httplib' usage in ZPublisher.Client.
 
   - Collector #1792: applied patch for broken ZClasses

Modified: Zope/trunk/lib/python/webdav/Resource.py
===
--- Zope/trunk/lib/python/webdav/Resource.py2005-06-21 10:28:34 UTC (rev 
30874)
+++ Zope/trunk/lib/python/webdav/Resource.py2005-06-21 15:30:24 UTC (rev 
30875)
@@ -373,6 +373,7 @@
 else:
 raise Locked, 'Destination is locked.'
 
+self._notifyOfCopyTo(parent, op=0)
 ob = self._getCopy(parent)
 ob._setId(name)
 
@@ -385,6 +386,7 @@
 parent._delObject(name)
 parent._setObject(name, ob)
 ob = parent._getOb(name)
+ob._postCopy(parent, op=0)
 ob.manage_afterClone(ob)
 # We remove any locks from the copied object because webdav clients
 # don't track the lock status and the lock token for copied resources
@@ -481,7 +483,12 @@
 raise PreconditionFailed, 'Source is locked and no '\
   'condition was passed in.'
 
-ob=aq_base(self._getCopy(parent))
+# try to make ownership explicit so that it gets carried
+# along to the new location if needed.
+self.manage_changeOwnershipType(explicit=1)
+
+self._notifyOfCopyTo(parent, op=1)
+ob = aq_base(self._getCopy(parent))
 self.aq_parent._delObject(absattr(self.id))
 ob._setId(name)
 if existing:
@@ -489,6 +496,12 @@
 self.dav__validate(object, 'DELETE', REQUEST)
 parent._delObject(name)
 parent._setObject(name, ob)
+ob = parent._getOb(name)
+ob._postCopy(parent, op=1)
+
+# try to make ownership implicit if possible
+ob.manage_changeOwnershipType(explicit=0)
+
 RESPONSE.setStatus(existing and 204 or 201)
 if not existing:
 RESPONSE.setHeader('Location', dest)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/lib/python/Products/Five/browserconfigure.py - Missing import

2005-09-21 Thread Sidnei da Silva
Log message for revision 38562:
  
  - Missing import
  

Changed:
  U   Zope/branches/Zope-2_8-branch/lib/python/Products/Five/browserconfigure.py

-=-
Modified: 
Zope/branches/Zope-2_8-branch/lib/python/Products/Five/browserconfigure.py
===
--- Zope/branches/Zope-2_8-branch/lib/python/Products/Five/browserconfigure.py  
2005-09-22 01:44:39 UTC (rev 38561)
+++ Zope/branches/Zope-2_8-branch/lib/python/Products/Five/browserconfigure.py  
2005-09-22 02:55:46 UTC (rev 38562)
@@ -27,6 +27,7 @@
 from zope.publisher.interfaces.browser import IBrowserRequest
 from zope.app.publisher.browser.viewmeta import pages as zope_app_pages
 from zope.app.publisher.browser.viewmeta import view as zope_app_view
+from zope.app.publisher.browser.viewmeta import providesCallable
 from zope.app.publisher.browser.globalbrowsermenuservice import\
  menuItemDirective
 from zope.app.component.metaconfigure import handler
@@ -261,9 +262,9 @@
 cname = str(name)
 except:
 cname = GeneratedClass
-
+
 newclass = makeClass(cname, bases, cdict)
-
+
 _handle_for(_context, for_)
 
 if self.provides is not None:

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] CVS: Packages/OFS - Image.py:1.145.2.13

2005-10-12 Thread Sidnei da Silva
Update of /cvs-repository/Packages/OFS
In directory cvs.zope.org:/tmp/cvs-serv12347/lib/python/OFS

Modified Files:
  Tag: Zope-2_7-branch
Image.py 
Log Message:

  - OFS.Image.manage_FTPget() would str() it's .data attribute,
potentially loading the whole file in memory as a
string. Changed to use RESPONSE.write() iterating through the
Pdata chain, just like index_html().


=== Packages/OFS/Image.py 1.145.2.12 = 1.145.2.13 ===
--- Packages/OFS/Image.py:1.145.2.12Fri Jun  3 12:15:00 2005
+++ Packages/OFS/Image.py   Wed Oct 12 17:27:06 2005
@@ -218,7 +218,7 @@
 return True
 
 ranges = HTTPRangeSupport.expandRanges(ranges, self.size)
-
+
 if len(ranges) == 1:
 # Easy case, set extra header and return partial set.
 start, end = ranges[0]
@@ -401,10 +401,10 @@
 return result
 
 self.ZCacheable_set(None)
-
+
 data=self.data
 if type(data) is type(''):
-RESPONSE.setBase(None) 
+RESPONSE.setBase(None)
 return data
 
 while data is not None:
@@ -597,6 +597,8 @@
 
 def manage_FTPget(self):
 Return body for ftp.
+RESPONSE = self.REQUEST.RESPONSE
+
 if self.ZCacheable_isCachingEnabled():
 result = self.ZCacheable_get(default=None)
 if result is not None:
@@ -605,9 +607,19 @@
 # from FileCacheManager.
 # the content-length is required here by HTTPResponse, even
 # though FTP doesn't use it.
-self.REQUEST.RESPONSE.setHeader('Content-Length', self.size)
+RESPONSE.setHeader('Content-Length', self.size)
 return result
-return str(self.data)
+
+data = self.data
+if type(data) is type(''):
+RESPONSE.setBase(None)
+return data
+
+while data is not None:
+RESPONSE.write(data.data)
+data = data.next
+
+return ''
 
 manage_addImageForm=DTMLFile('dtml/imageAdd',globals(),
  Kind='Image',kind='image')

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] CVS: Zope/doc - CHANGES.txt:1.625.2.363

2005-10-12 Thread Sidnei da Silva
Update of /cvs-repository/Zope/doc
In directory cvs.zope.org:/tmp/cvs-serv12347/doc

Modified Files:
  Tag: Zope-2_7-branch
CHANGES.txt 
Log Message:

  - OFS.Image.manage_FTPget() would str() it's .data attribute,
potentially loading the whole file in memory as a
string. Changed to use RESPONSE.write() iterating through the
Pdata chain, just like index_html().


=== Zope/doc/CHANGES.txt 1.625.2.362 = 1.625.2.363 ===
--- Zope/doc/CHANGES.txt:1.625.2.362Tue Oct 11 11:00:35 2005
+++ Zope/doc/CHANGES.txtWed Oct 12 17:27:06 2005
@@ -13,6 +13,11 @@
 
 Bugs fixed
 
+  - OFS.Image.manage_FTPget() would str() it's .data attribute,
+potentially loading the whole file in memory as a
+string. Changed to use RESPONSE.write() iterating through the
+Pdata chain, just like index_html().
+
   - Collector #1914: Harden 'call_with_ns' (in
 'Products.PageTemplates.ZRPythonExpr') against namespaces from other
 callers than page templates.

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/publication-refactor/lib/python/ZPublisher/ - Implemented traverseName method and changed BaseRequest to use a (singleton) publication object

2005-12-12 Thread Sidnei da Silva
Log message for revision 40746:
  
  - Implemented traverseName method and changed BaseRequest to use a 
(singleton) publication object
  

Changed:
  U   Zope/branches/publication-refactor/lib/python/ZPublisher/BaseRequest.py
  U   Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py

-=-
Modified: 
Zope/branches/publication-refactor/lib/python/ZPublisher/BaseRequest.py
===
--- Zope/branches/publication-refactor/lib/python/ZPublisher/BaseRequest.py 
2005-12-12 18:50:08 UTC (rev 40745)
+++ Zope/branches/publication-refactor/lib/python/ZPublisher/BaseRequest.py 
2005-12-12 18:50:34 UTC (rev 40746)
@@ -14,13 +14,14 @@
 
 $Id$
 
-from urllib import quote
+
 import xmlrpc
+from urllib import quote
+from zope.publisher.interfaces import NotFound
+
 from zExceptions import Forbidden
+from ZPublisher.Publication import get_publication
 
-from zope.event import notify
-from zope.app.publication.interfaces import EndRequestEvent
-
 UNSPECIFIED_ROLES=''
 
 try:
@@ -81,11 +82,13 @@
 if other is None: other=kw
 else: other.update(kw)
 self.other=other
+self.publication = get_publication()
 
 def close(self):
 self.other.clear()
-self._held=None
-notify(EndRequestEvent(None, self))
+self._held = None
+self.publication = None
+self.publication.endRequest(self, None)
 
 def processInputs(self):
 Do any input processing that could raise errors
@@ -155,7 +158,7 @@
 
 def __contains__(self, key):
 return self.has_key(key)
-
+
 def keys(self):
 keys = {}
 keys.update(self.common)
@@ -231,28 +234,14 @@
 no_acquire_flag=0
 
 URL=request['URL']
-parents=request['PARENTS']
-object=parents[-1]
+parents = request['PARENTS']
 del parents[:]
 
-roles = getRoles(None, None, object, UNSPECIFIED_ROLES)
-
-# if the top object has a __bobo_traverse__ method, then use it
-# to possibly traverse to an alternate top-level object.
-if hasattr(object,'__bobo_traverse__'):
-try:
-object=object.__bobo_traverse__(request)
-roles = getRoles(None, None, object, UNSPECIFIED_ROLES)
-except: pass
-
 if not path and not method:
 return response.forbiddenError(self['URL'])
 
-# Traverse the URL to find the object:
-if hasattr(object, '__of__'):
-# Try to bind the top-level object to the request
-# This is how you get 'self.REQUEST'
-object=object.__of__(RequestContainer(REQUEST=request))
+object = self.publication.getApplication(self)
+roles = getRoles(None, None, object, UNSPECIFIED_ROLES)
 parents.append(object)
 
 steps=self.steps
@@ -270,9 +259,7 @@
 # We build parents in the wrong order, so we
 # need to make sure we reverse it when we're doe.
 while 1:
-bpth = getattr(object, '__before_publishing_traverse__', None)
-if bpth is not None:
-bpth(object, self)
+self.publication.callTraversalHooks(self, object)
 
 path = request.path = request['TraversalRequestNameStack']
 # Check for method:
@@ -318,48 +305,16 @@
   Object name begins with an underscore at: %s % URL)
 else: return response.forbiddenError(entry_name)
 
-if hasattr(object,'__bobo_traverse__'):
-try:
-subobject=object.__bobo_traverse__(request,entry_name)
-if type(subobject) is type(()) and len(subobject)  1:
-# Add additional parents into the path
-parents[-1:] = list(subobject[:-1])
-object, subobject = subobject[-2:]
-except (AttributeError, KeyError):
-if debug_mode:
-return response.debugError(
-Cannot locate object at: %s % URL)
-else:
-return response.notFoundError(URL)
-else:
-try:
-# Note - no_acquire_flag is necessary to support
-# things like DAV.  We have to make sure
-# that the target object is not acquired
-# if the request_method is other than GET
-# or POST. Otherwise, you could never use
-# PUT to add a new object named 'test' if
-# an object 'test' existed above it in the
-# heirarchy -- you'd always get the
-# existing object :(
+try:
+

[Zope-Checkins] SVN: Zope/branches/publication-refactor/lib/python/ZPublisher/ - Make Publish.py use the new IPublication object

2005-12-12 Thread Sidnei da Silva
Log message for revision 40750:
  
  - Make Publish.py use the new IPublication object
  

Changed:
  U   Zope/branches/publication-refactor/lib/python/ZPublisher/BaseRequest.py
  U   Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py
  U   Zope/branches/publication-refactor/lib/python/ZPublisher/Publish.py

-=-
Modified: 
Zope/branches/publication-refactor/lib/python/ZPublisher/BaseRequest.py
===
--- Zope/branches/publication-refactor/lib/python/ZPublisher/BaseRequest.py 
2005-12-12 18:57:23 UTC (rev 40749)
+++ Zope/branches/publication-refactor/lib/python/ZPublisher/BaseRequest.py 
2005-12-12 19:16:05 UTC (rev 40750)
@@ -20,7 +20,6 @@
 from zope.publisher.interfaces import NotFound
 
 from zExceptions import Forbidden
-from ZPublisher.Publication import get_publication
 
 UNSPECIFIED_ROLES=''
 
@@ -81,9 +80,13 @@
 
 if other is None: other=kw
 else: other.update(kw)
-self.other=other
-self.publication = get_publication()
+self.other = other
+# Publication will be set by ZPublisher.Publish, publish().
+self.publication = None
 
+def setPublication(self, publication):
+self.publication = publication
+
 def close(self):
 self.other.clear()
 self._held = None

Modified: 
Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py
===
--- Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py 
2005-12-12 18:57:23 UTC (rev 40749)
+++ Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py 
2005-12-12 19:16:05 UTC (rev 40750)
@@ -99,12 +99,9 @@
 
 def afterCall(self, request, ob):
 # Last part of ZPublisher.Publish.{publish, publish_module_standard},
-# commit the transaction and call 'bobo_after' hook if one was
-# provided.
+# commit the transaction.
 if self.transactions_manager:
 self.transactions_manager.commit()
-if self.bobo_after is not None:
-self.bobo_after()
 
 def endRequest(self, request, ob):
 # End the request the Zope 3-way, by firing an event.
@@ -122,11 +119,14 @@
 if self.transactions_manager:
 self.transactions_manager.recordMetaData(ob, request)
 
+def _abort(self):
+if self.transactions_manager:
+self.transactions_manager.abort()
+
 def handleException(self, object, request, exc_info, retry_allowed=True):
 # Some exception handling from ZPublisher.Publish.publish().
 if self.err_hook is None:
-if transactions_manager:
-transactions_manager.abort()
+self._abort()
 raise
 
 # If an err_hook was registered, use it.
@@ -145,8 +145,7 @@
  exc_info[2],
  )
 finally:
-if self.transactions_manager:
-self.transactions_manager.abort()
+self._abort()
 
 # XXX After this code, in ZPublisher.Publish.publish(), Zope 2
 # does a 'Retry' if a 'Retry' exception happens and the
@@ -199,8 +198,10 @@
 raise NotFound(ob, name)
 
 _publication = None
-def get_publication(module_name):
+def get_publication(module_name=None):
 global _publication
+if module_name is None:
+module_name = Zope2
 if _publication is None:
-_publication = ZopePublication(db=None, module_name=Zope2)
+_publication = ZopePublication(db=None, module_name=module_name)
 return _publication

Modified: Zope/branches/publication-refactor/lib/python/ZPublisher/Publish.py
===
--- Zope/branches/publication-refactor/lib/python/ZPublisher/Publish.py 
2005-12-12 18:57:23 UTC (rev 40749)
+++ Zope/branches/publication-refactor/lib/python/ZPublisher/Publish.py 
2005-12-12 19:16:05 UTC (rev 40750)
@@ -59,67 +59,70 @@
 _default_realm = realm
 
 def publish(request, module_name, after_list, debug=0,
-# Optimize:
+# Optimize (now unused).
 call_object=call_object,
 missing_name=missing_name,
 dont_publish_class=dont_publish_class,
 mapply=mapply,
 ):
 
-(bobo_before, bobo_after, object, realm, debug_mode, err_hook,
- validated_hook, transactions_manager)= get_module_info(module_name)
+# We assume the publication object returned is the one in
+# ZPublisher.Publication here so we don't bother using accessors
+# and poke directly into the variables.
+from ZPublisher.Publication import get_publication
+publication = get_publication(module_name)
+request.setPublication(publication)
 
-parents=None
-response=None
+# BBB: bobo_after hooks are called from 

[Zope-Checkins] SVN: Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py - Inline before_publishing_traverse handling and then fire the event

2005-12-12 Thread Sidnei da Silva
Log message for revision 40757:
  
  - Inline before_publishing_traverse handling and then fire the event
  

Changed:
  U   Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py

-=-
Modified: 
Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py
===
--- Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py 
2005-12-12 21:07:07 UTC (rev 40756)
+++ Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py 
2005-12-12 21:23:59 UTC (rev 40757)
@@ -20,8 +20,6 @@
 from zope.publisher.interfaces import NotFound, IPublicationRequest
 from zope.app.publication.interfaces import EndRequestEvent
 from zope.app.publication.interfaces import BeforeTraverseEvent
-from zope.app.publication.interfaces import IBeforeTraverseEvent
-from zope.app.testing import ztapi
 
 from ZPublisher.Publish import Retry
 from ZPublisher.Publish import get_module_info, call_object
@@ -59,8 +57,12 @@
 self.transactions_manager.begin()
 
 def callTraversalHooks(self, request, ob):
-# Call __before_publishing_traverse__ hooks the Zope 3-way by
-# firing an event.
+# Call __before_publishing_traverse__ hooks
+bpth = getattr(ob, '__before_publishing_traverse__', None)
+if bpth is not None:
+bpth(ob, request)
+
+# And then fire an event
 notify(BeforeTraverseEvent(ob, request))
 
 def afterTraversal(self, request, ob):
@@ -219,14 +221,3 @@
 _publications[module_name] = ZopePublication(db=None,
  module_name=module_name)
 return _publications[module_name]
-
-def bptSubscriber(event):
-ob = event.object
-request = event.request
-bpth = getattr(ob, '__before_publishing_traverse__', None)
-if bpth is not None:
-bpth(ob, request)
-
-# XXX Move to zcml.
-ztapi.subscribe([IBeforeTraverseEvent], None, bptSubscriber)
-

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] Re: SVN: Zope/branches/publication-refactor/lib/python/ZPublisher/Publi - Checkpoint before I dig into refactoring BaseRequest.py and Publish.py

2005-12-13 Thread Sidnei da Silva
On Tue, Dec 13, 2005 at 12:31:54PM +0100, Philipp von Weitershausen wrote:
| Sidnei da Silva wrote:
|  Log message for revision 40742:
|
|- Checkpoint before I dig into refactoring BaseRequest.py and Publish.py
|
|  
|  Changed:
|A   
Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py
| 
| I suggest following Zope 3's package-and-module naming convention (lower
| case) for all the files we add to Zope 2 from now on.

IMHO, that is silly if we are adding new modules to existing packages. For new
packages I agree.

-- 
Sidnei da Silva
Enfold Systems, LLC.
http://enfoldsystems.com
___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/publication-refactor/lib/python/ - Another checkpoint. Enough majik to render the quickstart page, not much else.

2005-12-13 Thread Sidnei da Silva
Log message for revision 40775:
  
  - Another checkpoint. Enough majik to render the quickstart page, not much 
else.
  

Changed:
  _U  Zope/branches/publication-refactor/lib/python/
  U   Zope/branches/publication-refactor/lib/python/Products/Five/configure.zcml
  U   Zope/branches/publication-refactor/lib/python/Products/Five/meta.zcml
  U   Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py
  U   Zope/branches/publication-refactor/lib/python/Zope2/Startup/__init__.py
  U   Zope/branches/publication-refactor/lib/python/Zope2/Startup/handlers.py
  U   Zope/branches/publication-refactor/lib/python/Zope2/Startup/zopeschema.xml

-=-

Property changes on: Zope/branches/publication-refactor/lib/python
___
Name: svn:externals
   - ZConfigsvn://svn.zope.org/repos/main/ZConfig/tags/ZConfig-2.3.1
BTrees svn://svn.zope.org/repos/main/ZODB/tags/3.6.0b4/src/BTrees
persistent svn://svn.zope.org/repos/main/ZODB/tags/3.6.0b4/src/persistent
ThreadedAsync  svn://svn.zope.org/repos/main/ZODB/tags/3.6.0b4/src/ThreadedAsync
transactionsvn://svn.zope.org/repos/main/ZODB/tags/3.6.0b4/src/transaction
ZEOsvn://svn.zope.org/repos/main/ZODB/tags/3.6.0b4/src/ZEO
ZODB   svn://svn.zope.org/repos/main/ZODB/tags/3.6.0b4/src/ZODB
ZopeUndo   svn://svn.zope.org/repos/main/ZODB/tags/3.6.0b4/src/ZopeUndo
zdaemon-r 39732 svn://svn.zope.org/repos/main/zdaemon/trunk/src/zdaemon
pytz   -r 40549 svn://svn.zope.org/repos/main/Zope3/trunk/src/pytz
zodbcode   -r 40549 svn://svn.zope.org/repos/main/Zope3/trunk/src/zodbcode
ClientCookie   -r 40549 
svn://svn.zope.org/repos/main/Zope3/trunk/src/ClientCookie
mechanize  -r 40549 svn://svn.zope.org/repos/main/Zope3/trunk/src/mechanize

   + ZConfigsvn://svn.zope.org/repos/main/ZConfig/tags/ZConfig-2.3.1
BTrees svn://svn.zope.org/repos/main/ZODB/tags/3.6.0b4/src/BTrees
persistent svn://svn.zope.org/repos/main/ZODB/tags/3.6.0b4/src/persistent
ThreadedAsync  svn://svn.zope.org/repos/main/ZODB/tags/3.6.0b4/src/ThreadedAsync
transactionsvn://svn.zope.org/repos/main/ZODB/tags/3.6.0b4/src/transaction
ZEOsvn://svn.zope.org/repos/main/ZODB/tags/3.6.0b4/src/ZEO
ZODB   svn://svn.zope.org/repos/main/ZODB/tags/3.6.0b4/src/ZODB
ZopeUndo   svn://svn.zope.org/repos/main/ZODB/tags/3.6.0b4/src/ZopeUndo
zdaemon-r 39732 svn://svn.zope.org/repos/main/zdaemon/trunk/src/zdaemon
pytz   -r 40549 svn://svn.zope.org/repos/main/Zope3/trunk/src/pytz
zodbcode   -r 40549 svn://svn.zope.org/repos/main/Zope3/trunk/src/zodbcode
ClientCookie   -r 40549 
svn://svn.zope.org/repos/main/Zope3/trunk/src/ClientCookie
mechanize  -r 40549 svn://svn.zope.org/repos/main/Zope3/trunk/src/mechanize
twisted
svn://svn.twistedmatrix.com/svn/Twisted/branches/releases/2.1.x/twisted


Modified: 
Zope/branches/publication-refactor/lib/python/Products/Five/configure.zcml
===
--- Zope/branches/publication-refactor/lib/python/Products/Five/configure.zcml  
2005-12-13 17:56:02 UTC (rev 40774)
+++ Zope/branches/publication-refactor/lib/python/Products/Five/configure.zcml  
2005-12-14 00:10:45 UTC (rev 40775)
@@ -15,6 +15,14 @@
   include package=zope.app.event /
   include package=zope.app.traversing /
 
+  publisher
+  name=Zope2-HTTP
+  factory=ZPublisher.Publication.Zope2HTTPFactory
+  methods=*
+  mimetypes=*
+  priority=0
+  /
+
   !-- do 'traditional' traversing by default; needed by ZPT --
   adapter
   for=*

Modified: Zope/branches/publication-refactor/lib/python/Products/Five/meta.zcml
===
--- Zope/branches/publication-refactor/lib/python/Products/Five/meta.zcml   
2005-12-13 17:56:02 UTC (rev 40774)
+++ Zope/branches/publication-refactor/lib/python/Products/Five/meta.zcml   
2005-12-14 00:10:45 UTC (rev 40775)
@@ -172,4 +172,7 @@
   !-- load the i18n:registerTranslations directive --
   include package=zope.app.i18n file=meta.zcml /
 
+  !-- load the zope:publisher directive --
+  include package=zope.app.publication file=meta.zcml /
+
 /configure

Modified: 
Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py
===
--- Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py 
2005-12-13 17:56:02 UTC (rev 40774)
+++ Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py 
2005-12-14 00:10:45 UTC (rev 40775)
@@ -12,14 +12,22 @@
 ##
 __version__='$Revision$'[11:-2]
 
+import re
 import sys
 import transaction
+
 from zope.event import notify
+from zope.component import queryUtility
 from zope.interface import implements
 from zope.publisher.interfaces import 

[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ - Collector #1976: FTP STOR command would load the file being

2005-12-16 Thread Sidnei da Silva
Log message for revision 40805:
  
- Collector #1976: FTP STOR command would load the file being
  uploaded in memory. Changed to use a TemporaryFile.
  

Changed:
  U   Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
  U   Zope/branches/Zope-2_8-branch/lib/python/ZServer/FTPRequest.py
  U   Zope/branches/Zope-2_8-branch/lib/python/ZServer/FTPServer.py

-=-
Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
===
--- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt   2005-12-16 11:58:29 UTC 
(rev 40804)
+++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt   2005-12-16 12:28:10 UTC 
(rev 40805)
@@ -26,6 +26,9 @@
 
 Bugs Fixed
 
+  - Collector #1976: FTP STOR command would load the file being
+uploaded in memory. Changed to use a TemporaryFile.
+
   - Collector #1904: On Mac OS X avoid a spurious OSError when
 zopectl exits.
 

Modified: Zope/branches/Zope-2_8-branch/lib/python/ZServer/FTPRequest.py
===
--- Zope/branches/Zope-2_8-branch/lib/python/ZServer/FTPRequest.py  
2005-12-16 11:58:29 UTC (rev 40804)
+++ Zope/branches/Zope-2_8-branch/lib/python/ZServer/FTPRequest.py  
2005-12-16 12:28:10 UTC (rev 40805)
@@ -27,7 +27,7 @@
 class FTPRequest(HTTPRequest):
 
 def __init__(self, path, command, channel, response, stdin=None,
- environ=None,globbing=None,recursive=0):
+ environ=None, globbing=None, recursive=0, size=None):
 
 # we need to store the globbing information to pass it
 # to the ZPublisher and the manage_FTPlist function
@@ -35,9 +35,12 @@
 self.globbing = globbing
 self.recursive= recursive
 
-if stdin is None: stdin=StringIO()
+if stdin is None:
+size = 0
+stdin = StringIO()
+
 if environ is None:
-environ=self._get_env(path, command, channel, stdin)
+environ = self._get_env(path, command, channel, stdin, size)
 
 self._orig_env=environ
 HTTPRequest.__init__(self, stdin, environ, response, clean=1)
@@ -61,7 +64,7 @@
  )
 return r
 
-def _get_env(self, path, command, channel, stdin):
+def _get_env(self, path, command, channel, stdin, size):
 Returns a CGI style environment
 env={}
 env['SCRIPT_NAME']='/%s' % channel.module
@@ -109,9 +112,10 @@
 env['QUERY_STRING']='id=%snew_id=%s' % (args[0],args[1])
 
 elif command=='STOR':
-env['PATH_INFO']=self._join_paths(channel.path, path)
-env['REQUEST_METHOD']='PUT'
-env['CONTENT_LENGTH']=len(stdin.getvalue())
+env['PATH_INFO'] = self._join_paths(channel.path, path)
+env['REQUEST_METHOD'] = 'PUT'
+env['CONTENT_LENGTH'] = long(size)
+
 else:
 env['PATH_INFO']=self._join_paths(channel.path, path, command)
 

Modified: Zope/branches/Zope-2_8-branch/lib/python/ZServer/FTPServer.py
===
--- Zope/branches/Zope-2_8-branch/lib/python/ZServer/FTPServer.py   
2005-12-16 11:58:29 UTC (rev 40804)
+++ Zope/branches/Zope-2_8-branch/lib/python/ZServer/FTPServer.py   
2005-12-16 12:28:10 UTC (rev 40805)
@@ -352,7 +352,7 @@
 # Right now we are limited in the errors we can issue, since
 # we agree to accept the file before checking authorization
 
-fd=ContentReceiver(self.stor_callback, line[1])
+fd = ContentReceiver(self.stor_callback, line[1])
 self.respond (
 '150 Opening %s connection for %s' % (
 self.type_map[self.current_mode],
@@ -361,14 +361,15 @@
 )
 self.make_recv_channel(fd)
 
-def stor_callback(self,path,data):
+def stor_callback(self, path, data, size):
 'callback to do the STOR, after we have the input'
-response=make_response(self, self.stor_completion)
-request=FTPRequest(path,'STOR',self,response,stdin=data)
-handle(self.module,request,response)
+response = make_response(self, self.stor_completion)
+request = FTPRequest(path, 'STOR', self, response,
+ stdin=data, size=size)
+handle(self.module, request, response)
 
-def stor_completion(self,response):
-status=response.getStatus()
+def stor_completion(self, response):
+status = response.getStatus()
 
 if status in (200, 201, 204, 302):
 self.client_dc.channel.respond('226 Transfer complete.')
@@ -559,19 +560,21 @@
 Write-only file object used to receive data from FTP
 
 def __init__(self,callback,*args):
-self.data=StringIO()
-self.callback=callback
-self.args=args
+from tempfile import TemporaryFile
+self.data = TemporaryFile('w+b')
+self.callback 

[Zope-Checkins] SVN: Zope/branches/2.9/ - Collector #1976: FTP STOR command would load the file being

2005-12-16 Thread Sidnei da Silva
Log message for revision 40806:
  
   - Collector #1976: FTP STOR command would load the file being
 uploaded in memory. Changed to use a TemporaryFile.
  

Changed:
  U   Zope/branches/2.9/doc/CHANGES.txt
  U   Zope/branches/2.9/lib/python/ZServer/FTPRequest.py
  U   Zope/branches/2.9/lib/python/ZServer/FTPServer.py

-=-
Modified: Zope/branches/2.9/doc/CHANGES.txt
===
--- Zope/branches/2.9/doc/CHANGES.txt   2005-12-16 12:28:10 UTC (rev 40805)
+++ Zope/branches/2.9/doc/CHANGES.txt   2005-12-16 12:49:12 UTC (rev 40806)
@@ -27,6 +27,9 @@
 
 Bugs fixed
 
+ - Collector #1976: FTP STOR command would load the file being
+   uploaded in memory. Changed to use a TemporaryFile.
+
  - OFS ObjectManager: Fixed list_imports() to tolerate missing
import directories.
 

Modified: Zope/branches/2.9/lib/python/ZServer/FTPRequest.py
===
--- Zope/branches/2.9/lib/python/ZServer/FTPRequest.py  2005-12-16 12:28:10 UTC 
(rev 40805)
+++ Zope/branches/2.9/lib/python/ZServer/FTPRequest.py  2005-12-16 12:49:12 UTC 
(rev 40806)
@@ -27,7 +27,7 @@
 class FTPRequest(HTTPRequest):
 
 def __init__(self, path, command, channel, response, stdin=None,
- environ=None,globbing=None,recursive=0):
+ environ=None, globbing=None, recursive=0, size=None):
 
 # we need to store the globbing information to pass it
 # to the ZPublisher and the manage_FTPlist function
@@ -35,9 +35,12 @@
 self.globbing = globbing
 self.recursive= recursive
 
-if stdin is None: stdin=StringIO()
+if stdin is None:
+size = 0
+stdin = StringIO()
+
 if environ is None:
-environ=self._get_env(path, command, channel, stdin)
+environ = self._get_env(path, command, channel, stdin, size)
 
 self._orig_env=environ
 HTTPRequest.__init__(self, stdin, environ, response, clean=1)
@@ -61,7 +64,7 @@
  )
 return r
 
-def _get_env(self, path, command, channel, stdin):
+def _get_env(self, path, command, channel, stdin, size):
 Returns a CGI style environment
 env={}
 env['SCRIPT_NAME']='/%s' % channel.module
@@ -109,9 +112,10 @@
 env['QUERY_STRING']='id=%snew_id=%s' % (args[0],args[1])
 
 elif command=='STOR':
-env['PATH_INFO']=self._join_paths(channel.path, path)
-env['REQUEST_METHOD']='PUT'
-env['CONTENT_LENGTH']=len(stdin.getvalue())
+env['PATH_INFO'] = self._join_paths(channel.path, path)
+env['REQUEST_METHOD'] = 'PUT'
+env['CONTENT_LENGTH'] = long(size)
+
 else:
 env['PATH_INFO']=self._join_paths(channel.path, path, command)
 

Modified: Zope/branches/2.9/lib/python/ZServer/FTPServer.py
===
--- Zope/branches/2.9/lib/python/ZServer/FTPServer.py   2005-12-16 12:28:10 UTC 
(rev 40805)
+++ Zope/branches/2.9/lib/python/ZServer/FTPServer.py   2005-12-16 12:49:12 UTC 
(rev 40806)
@@ -352,7 +352,7 @@
 # Right now we are limited in the errors we can issue, since
 # we agree to accept the file before checking authorization
 
-fd=ContentReceiver(self.stor_callback, line[1])
+fd = ContentReceiver(self.stor_callback, line[1])
 self.respond (
 '150 Opening %s connection for %s' % (
 self.type_map[self.current_mode],
@@ -361,14 +361,15 @@
 )
 self.make_recv_channel(fd)
 
-def stor_callback(self,path,data):
+def stor_callback(self, path, data, size):
 'callback to do the STOR, after we have the input'
-response=make_response(self, self.stor_completion)
-request=FTPRequest(path,'STOR',self,response,stdin=data)
-handle(self.module,request,response)
+response = make_response(self, self.stor_completion)
+request = FTPRequest(path, 'STOR', self, response,
+ stdin=data, size=size)
+handle(self.module, request, response)
 
-def stor_completion(self,response):
-status=response.getStatus()
+def stor_completion(self, response):
+status = response.getStatus()
 
 if status in (200, 201, 204, 302):
 self.client_dc.channel.respond('226 Transfer complete.')
@@ -559,19 +560,21 @@
 Write-only file object used to receive data from FTP
 
 def __init__(self,callback,*args):
-self.data=StringIO()
-self.callback=callback
-self.args=args
+from tempfile import TemporaryFile
+self.data = TemporaryFile('w+b')
+self.callback = callback
+self.args = args
 
 def write(self,data):
 self.data.write(data)
 
 def close(self):
+size = self.data.tell()
 

[Zope-Checkins] SVN: Zope/trunk/ - Collector #1976: FTP STOR command would load the file being

2005-12-16 Thread Sidnei da Silva
Log message for revision 40807:
  
   - Collector #1976: FTP STOR command would load the file being
 uploaded in memory. Changed to use a TemporaryFile.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/ZServer/FTPRequest.py
  U   Zope/trunk/lib/python/ZServer/FTPServer.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2005-12-16 12:49:12 UTC (rev 40806)
+++ Zope/trunk/doc/CHANGES.txt  2005-12-16 12:49:26 UTC (rev 40807)
@@ -120,6 +120,9 @@
 
 Bugs Fixed
 
+  - Collector #1976: FTP STOR command would load the file being
+uploaded in memory. Changed to use a TemporaryFile.
+
   - OFS ObjectManager: Fixed list_imports() to tolerate missing
 import directories.
 

Modified: Zope/trunk/lib/python/ZServer/FTPRequest.py
===
--- Zope/trunk/lib/python/ZServer/FTPRequest.py 2005-12-16 12:49:12 UTC (rev 
40806)
+++ Zope/trunk/lib/python/ZServer/FTPRequest.py 2005-12-16 12:49:26 UTC (rev 
40807)
@@ -27,7 +27,7 @@
 class FTPRequest(HTTPRequest):
 
 def __init__(self, path, command, channel, response, stdin=None,
- environ=None,globbing=None,recursive=0):
+ environ=None, globbing=None, recursive=0, size=None):
 
 # we need to store the globbing information to pass it
 # to the ZPublisher and the manage_FTPlist function
@@ -35,9 +35,12 @@
 self.globbing = globbing
 self.recursive= recursive
 
-if stdin is None: stdin=StringIO()
+if stdin is None:
+size = 0
+stdin = StringIO()
+
 if environ is None:
-environ=self._get_env(path, command, channel, stdin)
+environ = self._get_env(path, command, channel, stdin, size)
 
 self._orig_env=environ
 HTTPRequest.__init__(self, stdin, environ, response, clean=1)
@@ -61,7 +64,7 @@
  )
 return r
 
-def _get_env(self, path, command, channel, stdin):
+def _get_env(self, path, command, channel, stdin, size):
 Returns a CGI style environment
 env={}
 env['SCRIPT_NAME']='/%s' % channel.module
@@ -109,9 +112,10 @@
 env['QUERY_STRING']='id=%snew_id=%s' % (args[0],args[1])
 
 elif command=='STOR':
-env['PATH_INFO']=self._join_paths(channel.path, path)
-env['REQUEST_METHOD']='PUT'
-env['CONTENT_LENGTH']=len(stdin.getvalue())
+env['PATH_INFO'] = self._join_paths(channel.path, path)
+env['REQUEST_METHOD'] = 'PUT'
+env['CONTENT_LENGTH'] = long(size)
+
 else:
 env['PATH_INFO']=self._join_paths(channel.path, path, command)
 

Modified: Zope/trunk/lib/python/ZServer/FTPServer.py
===
--- Zope/trunk/lib/python/ZServer/FTPServer.py  2005-12-16 12:49:12 UTC (rev 
40806)
+++ Zope/trunk/lib/python/ZServer/FTPServer.py  2005-12-16 12:49:26 UTC (rev 
40807)
@@ -352,7 +352,7 @@
 # Right now we are limited in the errors we can issue, since
 # we agree to accept the file before checking authorization
 
-fd=ContentReceiver(self.stor_callback, line[1])
+fd = ContentReceiver(self.stor_callback, line[1])
 self.respond (
 '150 Opening %s connection for %s' % (
 self.type_map[self.current_mode],
@@ -361,14 +361,15 @@
 )
 self.make_recv_channel(fd)
 
-def stor_callback(self,path,data):
+def stor_callback(self, path, data, size):
 'callback to do the STOR, after we have the input'
-response=make_response(self, self.stor_completion)
-request=FTPRequest(path,'STOR',self,response,stdin=data)
-handle(self.module,request,response)
+response = make_response(self, self.stor_completion)
+request = FTPRequest(path, 'STOR', self, response,
+ stdin=data, size=size)
+handle(self.module, request, response)
 
-def stor_completion(self,response):
-status=response.getStatus()
+def stor_completion(self, response):
+status = response.getStatus()
 
 if status in (200, 201, 204, 302):
 self.client_dc.channel.respond('226 Transfer complete.')
@@ -559,19 +560,21 @@
 Write-only file object used to receive data from FTP
 
 def __init__(self,callback,*args):
-self.data=StringIO()
-self.callback=callback
-self.args=args
+from tempfile import TemporaryFile
+self.data = TemporaryFile('w+b')
+self.callback = callback
+self.args = args
 
 def write(self,data):
 self.data.write(data)
 
 def close(self):
+size = self.data.tell()
 self.data.seek(0)
-args=self.args+(self.data,)
-c=self.callback
-

[Zope-Checkins] SVN: Zope/branches/2.9/ - Collector #1939: When running as a service, Zope could

2005-12-21 Thread Sidnei da Silva
Log message for revision 40951:
  
- Collector #1939: When running as a service, Zope could
  potentially collect too much log output filling the NT Event
  Log. When that happened, a 'print' during exception handling
  would cause an IOError in the restart code causing the service
  not to restart automatically.
  
  Problem is that a service/pythonw.exe process *always* has an
  invalid sys.stdout.  But due to the magic of buffering, small
  print statements would not fail - but once the file actually
  got written to, the error happened.  Never a problem when
  debugging, as the process has a console, and hence a valid
  stdout.
  

Changed:
  U   Zope/branches/2.9/doc/CHANGES.txt
  U   Zope/branches/2.9/lib/python/nt_svcutils/service.py

-=-
Modified: Zope/branches/2.9/doc/CHANGES.txt
===
--- Zope/branches/2.9/doc/CHANGES.txt   2005-12-21 12:15:36 UTC (rev 40950)
+++ Zope/branches/2.9/doc/CHANGES.txt   2005-12-21 12:29:35 UTC (rev 40951)
@@ -23,10 +23,23 @@
- Collector #1233: port ZOPE_CONFIG patch from Zope 2.7 to Zope 2.8
 
 
-  after Zope 2.9.0 beta 1 
+  after Zope 2.9.0 beta 1
 
 Bugs fixed
 
+  - Collector #1939: When running as a service, Zope could
+potentially collect too much log output filling the NT Event
+Log. When that happened, a 'print' during exception handling
+would cause an IOError in the restart code causing the service
+not to restart automatically.
+
+Problem is that a service/pythonw.exe process *always* has an
+invalid sys.stdout.  But due to the magic of buffering, small
+print statements would not fail - but once the file actually
+got written to, the error happened.  Never a problem when
+debugging, as the process has a console, and hence a valid
+stdout.
+
  - For content-type HTTP headers starting with 'text/' or 'application/'
the 'charset' field is automatically if not specified by the
application. The 'charset' is determined by the content-type header

Modified: Zope/branches/2.9/lib/python/nt_svcutils/service.py
===
--- Zope/branches/2.9/lib/python/nt_svcutils/service.py 2005-12-21 12:15:36 UTC 
(rev 40950)
+++ Zope/branches/2.9/lib/python/nt_svcutils/service.py 2005-12-21 12:29:35 UTC 
(rev 40951)
@@ -36,8 +36,10 @@
 # (except obviously via the event log entry)
 # Size of the blocks we read from the child process's output.
 CHILDCAPTURE_BLOCK_SIZE = 80
-# The number of BLOCKSIZE blocks we keep as process output.
-CHILDCAPTURE_MAX_BLOCKS = 200
+# The number of BLOCKSIZE blocks we keep as process output.  This gives
+# is 4k, which should be enough to see any tracebacks etc, but not so
+# large as to prematurely fill the event log.
+CHILDCAPTURE_MAX_BLOCKS = 50
 
 class Service(win32serviceutil.ServiceFramework):
 Base class for a Windows Server to manage an external process.
@@ -108,7 +110,10 @@
 except win32api.error, details:
 # Failed to write a log entry - most likely problem is
 # that the event log is full.  We don't want this to kill us
-print FAILED to write INFO event, event, :, details
+try:
+print FAILED to write INFO event, event, :, details
+except IOError:
+pass
 
 def _dolog(self, func, msg):
 try:
@@ -118,8 +123,13 @@
 except win32api.error, details:
 # Failed to write a log entry - most likely problem is
 # that the event log is full.  We don't want this to kill us
-print FAILED to write event log entry:, details
-print msg
+try:
+print FAILED to write event log entry:, details
+print msg
+except IOError:
+# And if running as a service, its likely our sys.stdout
+# is invalid
+pass
 
 def info(self, s):
 self._dolog(servicemanager.LogInfoMsg, s)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/test.py - Report number of failures/errors

2005-12-27 Thread Sidnei da Silva
Log message for revision 41046:
  
  - Report number of failures/errors
  

Changed:
  U   Zope/branches/Zope-2_8-branch/test.py

-=-
Modified: Zope/branches/Zope-2_8-branch/test.py
===
--- Zope/branches/Zope-2_8-branch/test.py   2005-12-27 18:34:58 UTC (rev 
41045)
+++ Zope/branches/Zope-2_8-branch/test.py   2005-12-28 02:52:06 UTC (rev 
41046)
@@ -609,6 +609,8 @@
 def runner(files, test_filter, debug):
 runner = ImmediateTestRunner(verbosity=VERBOSE, debug=debug,
  progress=progress)
+result = runner.result
+
 suite = unittest.TestSuite()
 for file in files:
 s = get_suite(file, runner.result)
@@ -625,6 +627,8 @@
 print Wrote timing data to, timesfn
 if timetests:
 r.print_times(sys.stdout, timetests)
+numbad = len(result.failures) + len(result.errors)
+return numbad
 except:
 if debugger:
 pdb.post_mortem(sys.exc_info()[2])
@@ -706,7 +710,7 @@
 rc = sys.gettotalrefcount()
 track = TrackRefs()
 while True:
-runner(files, test_filter, debug)
+numbad = runner(files, test_filter, debug)
 gc.collect()
 if gc.garbage:
 print GARBAGE:, len(gc.garbage), gc.garbage
@@ -717,8 +721,9 @@
 print totalrefcount=%-8d change=%-6d % (rc, rc - prev)
 track.update()
 else:
-runner(files, test_filter, debug)
+numbad = runner(files, test_filter, debug)
 
+return numbad
 
 def configure_logging():
 Initialize the logging module.

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/tim-2.9-windows-installer/inst/WinBuilders/mk/ - Fetch the dependencies with curl

2006-01-19 Thread Sidnei da Silva
Log message for revision 41368:
  
  - Fetch the dependencies with curl
  

Changed:
  U   Zope/branches/tim-2.9-windows-installer/inst/WinBuilders/mk/common.mk
  U   Zope/branches/tim-2.9-windows-installer/inst/WinBuilders/mk/python.mk
  U   Zope/branches/tim-2.9-windows-installer/inst/WinBuilders/mk/zope.mk

-=-
Modified: Zope/branches/tim-2.9-windows-installer/inst/WinBuilders/mk/common.mk
===
--- Zope/branches/tim-2.9-windows-installer/inst/WinBuilders/mk/common.mk   
2006-01-19 16:41:08 UTC (rev 41367)
+++ Zope/branches/tim-2.9-windows-installer/inst/WinBuilders/mk/common.mk   
2006-01-19 17:47:05 UTC (rev 41368)
@@ -37,10 +37,11 @@
 SED=sed
 TOUCH=touch
 NMAKE=nmake
+CURL=curl -N
 CSCRIPT=cscript
 ECHO=echo
 ISS_DIR=$(CYGROOT)/Progra~1/Inno Setup 5
-ISS_COMPILER=$(ISS_DIR)/Compil32.exe
+ISS_COMPILER=$(ISS_DIR)/Compil32.exe /cc
 # We need a version that understands cygwin paths, so /bin/
 UNZIP=/bin/unzip
 

Modified: Zope/branches/tim-2.9-windows-installer/inst/WinBuilders/mk/python.mk
===
--- Zope/branches/tim-2.9-windows-installer/inst/WinBuilders/mk/python.mk   
2006-01-19 16:41:08 UTC (rev 41367)
+++ Zope/branches/tim-2.9-windows-installer/inst/WinBuilders/mk/python.mk   
2006-01-19 17:47:05 UTC (rev 41368)
@@ -66,6 +66,18 @@
 clean_libs:
$(RMRF) $(W32EXTRACTDIR)
 
+# Fetch dependencies
+tmp:
+   $(MKDIR) tmp
+   
+tmp/$(W32ALLDIRNAME).exe: tmp
+   $(CURL) -o tmp/$(W32ALLDIRNAME).exe 
http://easynews.dl.sourceforge.net/sourceforge/pywin32/$(W32ALLDIRNAME).exe
+   $(TOUCH) tmp/$(W32ALLDIRNAME).exe
+
+tmp/$(PYDIRNAME).tgz: tmp
+   $(CURL) -o tmp/$(PYDIRNAME).tgz 
http://python.org/ftp/python/$(PYVERSION)/$(PYDIRNAME).tgz
+   $(TOUCH) tmp/$(PYDIRNAME).tgz
+
 $(ARB_PYSRCDIR): tmp/$(PYDIRNAME).tgz
$(MKDIR) $(SRC_DIR)
$(CD) $(SRC_DIR)  $(TAR) xvzf ../tmp/$(PYDIRNAME).tgz

Modified: Zope/branches/tim-2.9-windows-installer/inst/WinBuilders/mk/zope.mk
===
--- Zope/branches/tim-2.9-windows-installer/inst/WinBuilders/mk/zope.mk 
2006-01-19 16:41:08 UTC (rev 41367)
+++ Zope/branches/tim-2.9-windows-installer/inst/WinBuilders/mk/zope.mk 
2006-01-19 17:47:05 UTC (rev 41368)
@@ -38,7 +38,7 @@
find $(BUILD_DIR) -name *.zcml | xargs unix2dos
 
# Build the Inno installer.
-   $(CD) $(BUILD_DIR);$(ISS_COMPILER) /cc $(WIN_BUILD_DIR)\zope.iss
+   $(CD) $(BUILD_DIR);$(ISS_COMPILER) $(WIN_BUILD_DIR)\zope.iss
 
 # This builds Zope, then installs it into the build directory, then
 # creates lib/python/Zope2/version.txt in the build directory.

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/tim-2.9-windows-installer/inst/WinBuilders/mk/zope.mk - I must be blind

2006-01-19 Thread Sidnei da Silva
Log message for revision 41370:
  
  - I must be blind
  

Changed:
  U   Zope/branches/tim-2.9-windows-installer/inst/WinBuilders/mk/zope.mk

-=-
Modified: Zope/branches/tim-2.9-windows-installer/inst/WinBuilders/mk/zope.mk
===
--- Zope/branches/tim-2.9-windows-installer/inst/WinBuilders/mk/zope.mk 
2006-01-19 18:23:30 UTC (rev 41369)
+++ Zope/branches/tim-2.9-windows-installer/inst/WinBuilders/mk/zope.mk 
2006-01-19 18:24:40 UTC (rev 41370)
@@ -64,11 +64,11 @@
echo Zope $(ZOPEVERSION)  $@
$(TOUCH) $@
 
-../tmp/$(ZOPEDIRNAME).tgz:
-   $(CURL) -o ../tmp/$(ZOPEDIRNAME).tgz 
http://www.zope.org/Products/Zope/$(ZOPEVERSION)/$(ZOPEDIRNAME).tgz
-   $(TOUCH) ../tmp/$(ZOPEDIRNAME).tgz
+tmp/$(ZOPEDIRNAME).tgz:
+   $(CURL) -o tmp/$(ZOPEDIRNAME).tgz 
http://www.zope.org/Products/Zope/$(ZOPEVERSION)/$(ZOPEDIRNAME).tgz
+   $(TOUCH) tmp/$(ZOPEDIRNAME).tgz
 
 # This merely unpacks the Zope tarball.
-src/$(ZOPEDIRNAME)/install.py: ../tmp/$(ZOPEDIRNAME).tgz
+src/$(ZOPEDIRNAME)/install.py: tmp/$(ZOPEDIRNAME).tgz
$(MKDIR) $(SRC_DIR)
$(CD) $(SRC_DIR)  $(TAR) xvzf ../tmp/$(ZOPEDIRNAME).tgz

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ - Collector #2002: fixed broken 'ls -R' functionality (didn't

2006-01-21 Thread Sidnei da Silva
Log message for revision 41393:
  
- Collector #2002: fixed broken 'ls -R' functionality (didn't
  recurse properly subclasses of OFS.Folder)
  

Changed:
  U   Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
  U   Zope/branches/Zope-2_8-branch/lib/python/OFS/ObjectManager.py

-=-
Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
===
--- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt   2006-01-21 12:16:22 UTC 
(rev 41392)
+++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt   2006-01-21 14:14:12 UTC 
(rev 41393)
@@ -30,6 +30,8 @@
   - Collector #1999: fixed broken FTP rename functionality
 (RNFR now returns 350 as status code instead 250)
 
+  - Collector #2002: fixed broken 'ls -R' functionality (didn't
+recurse properly subclasses of OFS.Folder)
 
   Zope 2.8.5 (2005/12/19)
 

Modified: Zope/branches/Zope-2_8-branch/lib/python/OFS/ObjectManager.py
===
--- Zope/branches/Zope-2_8-branch/lib/python/OFS/ObjectManager.py   
2006-01-21 12:16:22 UTC (rev 41392)
+++ Zope/branches/Zope-2_8-branch/lib/python/OFS/ObjectManager.py   
2006-01-21 14:14:12 UTC (rev 41393)
@@ -514,7 +514,7 @@
 obj_ids.sort()
 for id in obj_ids:
 o=self._getOb(id)
-if hasattr(o, 'isPrincipiaFolderish') and \
+if hasattr(aq_base(o), 'isPrincipiaFolderish') and \
o.isPrincipiaFolderish:
 r.append(o)
 return r
@@ -629,7 +629,7 @@
 break
 ob=ob.aq_parent
 
-files=self.objectItems()
+files = list(self.objectItems())
 
 # recursive ride through all subfolders (ls -R) (ajung)
 
@@ -637,15 +637,10 @@
 
 all_files = copy.copy(files)
 for f in files:
-if f[1].meta_type == Folder:
+if hasattr(aq_base(f[1]), 'isPrincipiaFolderish') and 
f[1].isPrincipiaFolderish:
 all_files.extend(findChildren(f[1]))
-else:
-all_files.append(f)
-
 files = all_files
 
-files = list(files)
-
 # Perform globbing on list of files (ajung)
 
 globbing = REQUEST.environ.get('GLOBBING','')
@@ -723,12 +718,12 @@
 find all children of an object (ajung)
 
 
-lst =[]
-for name,child in obj.objectItems():
-if child.meta_type==Folder:
-lst.extend(findChildren(child,dirname+ obj.id + '/'))
+lst = []
+for name, child in obj.objectItems():
+if hasattr(aq_base(child), 'isPrincipiaFolderish') and 
child.isPrincipiaFolderish:
+lst.extend(findChildren(child, dirname + obj.id + '/'))
 else:
-lst.append( (dirname + obj.id + / + name,child) )
+lst.append((dirname + obj.id + / + name, child))
 
 return lst
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/tim-2.9-windows-installer/ - Collector #2002: fixed broken 'ls -R' functionality (didn't

2006-01-21 Thread Sidnei da Silva
Log message for revision 41394:
  
- Collector #2002: fixed broken 'ls -R' functionality (didn't
  recurse properly subclasses of OFS.Folder)
  

Changed:
  U   Zope/branches/tim-2.9-windows-installer/doc/CHANGES.txt
  U   Zope/branches/tim-2.9-windows-installer/lib/python/OFS/ObjectManager.py

-=-
Modified: Zope/branches/tim-2.9-windows-installer/doc/CHANGES.txt
===
--- Zope/branches/tim-2.9-windows-installer/doc/CHANGES.txt 2006-01-21 
14:14:12 UTC (rev 41393)
+++ Zope/branches/tim-2.9-windows-installer/doc/CHANGES.txt 2006-01-21 
14:23:00 UTC (rev 41394)
@@ -22,6 +22,11 @@
 
- Collector #1233: port ZOPE_CONFIG patch from Zope 2.7 to Zope 2.8
 
+  after Zope 2.9.0
+
+  - Collector #2002: fixed broken 'ls -R' functionality (didn't
+recurse properly subclasses of OFS.Folder)
+
   Zope 2.9.0 (2006/01/09)
 
 Bugs fixed

Modified: 
Zope/branches/tim-2.9-windows-installer/lib/python/OFS/ObjectManager.py
===
--- Zope/branches/tim-2.9-windows-installer/lib/python/OFS/ObjectManager.py 
2006-01-21 14:14:12 UTC (rev 41393)
+++ Zope/branches/tim-2.9-windows-installer/lib/python/OFS/ObjectManager.py 
2006-01-21 14:23:00 UTC (rev 41394)
@@ -524,7 +524,7 @@
 obj_ids.sort()
 for id in obj_ids:
 o=self._getOb(id)
-if hasattr(o, 'isPrincipiaFolderish') and \
+if hasattr(aq_base(o), 'isPrincipiaFolderish') and \
o.isPrincipiaFolderish:
 r.append(o)
 return r
@@ -641,7 +641,7 @@
 break
 ob=ob.aq_parent
 
-files=self.objectItems()
+files = list(self.objectItems())
 
 # recursive ride through all subfolders (ls -R) (ajung)
 
@@ -649,15 +649,10 @@
 
 all_files = copy.copy(files)
 for f in files:
-if f[1].meta_type == Folder:
+if hasattr(aq_base(f[1]), 'isPrincipiaFolderish') and 
f[1].isPrincipiaFolderish:
 all_files.extend(findChildren(f[1]))
-else:
-all_files.append(f)
-
 files = all_files
 
-files = list(files)
-
 # Perform globbing on list of files (ajung)
 
 globbing = REQUEST.environ.get('GLOBBING','')
@@ -735,12 +730,12 @@
 find all children of an object (ajung)
 
 
-lst =[]
-for name,child in obj.objectItems():
-if child.meta_type==Folder:
-lst.extend(findChildren(child,dirname+ obj.id + '/'))
+lst = []
+for name, child in obj.objectItems():
+if hasattr(aq_base(child), 'isPrincipiaFolderish') and 
child.isPrincipiaFolderish:
+lst.extend(findChildren(child, dirname + obj.id + '/'))
 else:
-lst.append( (dirname + obj.id + / + name,child) )
+lst.append((dirname + obj.id + / + name, child))
 
 return lst
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/ - Collector #2002: fixed broken 'ls -R' functionality (didn't

2006-01-21 Thread Sidnei da Silva
Log message for revision 41395:
  
- Collector #2002: fixed broken 'ls -R' functionality (didn't
  recurse properly subclasses of OFS.Folder)
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/OFS/ObjectManager.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2006-01-21 14:23:00 UTC (rev 41394)
+++ Zope/trunk/doc/CHANGES.txt  2006-01-21 14:24:58 UTC (rev 41395)
@@ -197,6 +197,9 @@
 
 Bugs Fixed
 
+  - Collector #2002: fixed broken 'ls -R' functionality (didn't
+recurse properly subclasses of OFS.Folder)
+
   - Collector #1992: unified the visible hostnames of the FTP and
 HTTP servers
 
@@ -208,7 +211,6 @@
 as specified through the 'charset' within the content-type
 property.
 
-
   - Collector #1939: When running as a service, Zope could
 potentially collect too much log output filling the NT Event
 Log. When that happened, a 'print' during exception handling

Modified: Zope/trunk/lib/python/OFS/ObjectManager.py
===
--- Zope/trunk/lib/python/OFS/ObjectManager.py  2006-01-21 14:23:00 UTC (rev 
41394)
+++ Zope/trunk/lib/python/OFS/ObjectManager.py  2006-01-21 14:24:58 UTC (rev 
41395)
@@ -527,7 +527,7 @@
 obj_ids.sort()
 for id in obj_ids:
 o=self._getOb(id)
-if hasattr(o, 'isPrincipiaFolderish') and \
+if hasattr(aq_base(o), 'isPrincipiaFolderish') and \
o.isPrincipiaFolderish:
 r.append(o)
 return r
@@ -648,7 +648,7 @@
 break
 ob=ob.aq_parent
 
-files=self.objectItems()
+files = list(self.objectItems())
 
 # recursive ride through all subfolders (ls -R) (ajung)
 
@@ -656,15 +656,10 @@
 
 all_files = copy.copy(files)
 for f in files:
-if f[1].meta_type == Folder:
+if hasattr(aq_base(f[1]), 'isPrincipiaFolderish') and 
f[1].isPrincipiaFolderish:
 all_files.extend(findChildren(f[1]))
-else:
-all_files.append(f)
-
 files = all_files
 
-files = list(files)
-
 # Perform globbing on list of files (ajung)
 
 globbing = REQUEST.environ.get('GLOBBING','')
@@ -746,12 +741,12 @@
 find all children of an object (ajung)
 
 
-lst =[]
-for name,child in obj.objectItems():
-if child.meta_type==Folder:
-lst.extend(findChildren(child,dirname+ obj.id + '/'))
+lst = []
+for name, child in obj.objectItems():
+if hasattr(aq_base(child), 'isPrincipiaFolderish') and 
child.isPrincipiaFolderish:
+lst.extend(findChildren(child, dirname + obj.id + '/'))
 else:
-lst.append( (dirname + obj.id + / + name,child) )
+lst.append((dirname + obj.id + / + name, child))
 
 return lst
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.9/ - Collector #2002: fixed broken 'ls -R' functionality (didn't

2006-01-21 Thread Sidnei da Silva
Log message for revision 41399:
  
- Collector #2002: fixed broken 'ls -R' functionality (didn't
  recurse properly subclasses of OFS.Folder)
  

Changed:
  U   Zope/branches/2.9/doc/CHANGES.txt
  U   Zope/branches/2.9/lib/python/OFS/ObjectManager.py

-=-
Modified: Zope/branches/2.9/doc/CHANGES.txt
===
--- Zope/branches/2.9/doc/CHANGES.txt   2006-01-21 14:55:38 UTC (rev 41398)
+++ Zope/branches/2.9/doc/CHANGES.txt   2006-01-21 15:19:11 UTC (rev 41399)
@@ -22,7 +22,7 @@
 
- Collector #1233: port ZOPE_CONFIG patch from Zope 2.7 to Zope 2.8
 
-  after 2.9.0 
+  after 2.9.0
 
 Bugs fixed
 
@@ -35,6 +35,9 @@
   - Replaced used of deprecated 'OFS.content_types' module with cognates
 from 'zope.app.content_types'.
 
+  - Collector #2002: fixed broken 'ls -R' functionality (didn't
+recurse properly subclasses of OFS.Folder)
+
   Zope 2.9.0 (2006/01/09)
 
 Bugs fixed

Modified: Zope/branches/2.9/lib/python/OFS/ObjectManager.py
===
--- Zope/branches/2.9/lib/python/OFS/ObjectManager.py   2006-01-21 14:55:38 UTC 
(rev 41398)
+++ Zope/branches/2.9/lib/python/OFS/ObjectManager.py   2006-01-21 15:19:11 UTC 
(rev 41399)
@@ -524,7 +524,7 @@
 obj_ids.sort()
 for id in obj_ids:
 o=self._getOb(id)
-if hasattr(o, 'isPrincipiaFolderish') and \
+if hasattr(aq_base(o), 'isPrincipiaFolderish') and \
o.isPrincipiaFolderish:
 r.append(o)
 return r
@@ -641,7 +641,7 @@
 break
 ob=ob.aq_parent
 
-files=self.objectItems()
+files = list(self.objectItems())
 
 # recursive ride through all subfolders (ls -R) (ajung)
 
@@ -649,15 +649,10 @@
 
 all_files = copy.copy(files)
 for f in files:
-if f[1].meta_type == Folder:
+if hasattr(aq_base(f[1]), 'isPrincipiaFolderish') and 
f[1].isPrincipiaFolderish:
 all_files.extend(findChildren(f[1]))
-else:
-all_files.append(f)
-
 files = all_files
 
-files = list(files)
-
 # Perform globbing on list of files (ajung)
 
 globbing = REQUEST.environ.get('GLOBBING','')
@@ -735,12 +730,12 @@
 find all children of an object (ajung)
 
 
-lst =[]
-for name,child in obj.objectItems():
-if child.meta_type==Folder:
-lst.extend(findChildren(child,dirname+ obj.id + '/'))
+lst = []
+for name, child in obj.objectItems():
+if hasattr(aq_base(child), 'isPrincipiaFolderish') and 
child.isPrincipiaFolderish:
+lst.extend(findChildren(child, dirname + obj.id + '/'))
 else:
-lst.append( (dirname + obj.id + / + name,child) )
+lst.append((dirname + obj.id + / + name, child))
 
 return lst
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


Re: [Zope-Checkins] SVN: Zope/branches/tim-2.9-windows-installer/inst/WinBuilders/mk/ Repair invocation of Inno compiler -- it doesn't ( can't) work to

2006-01-26 Thread Sidnei da Silva
On Thu, Jan 26, 2006 at 07:57:44PM -0500, Tim Peters wrote:
| Log message for revision 41456:
|   Repair invocation of Inno compiler -- it doesn't ( can't) work to
|   stick the path and /cc in the same quoted string.  Unsure why that
|   change was made (it worked fine before -- and now).

That change was so I can run:
'ISS_COMPILER=iscc.exe WinBuilders/buildout', because compile32.exe
fires up the gui, and obviously that can't work with the buildbot.

Obviously I just tested my command and not what worked before :(

-- 
Sidnei da Silva
Enfold Systems, LLC.
http://enfoldsystems.com
___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


Re: [Zope-Checkins] SVN: Zope/branches/tim-2.9-windows-installer/inst/WinBuilders/mk/ Repair invocation of Inno compiler -- it doesn't ( can't) work to

2006-01-26 Thread Sidnei da Silva
On Thu, Jan 26, 2006 at 08:30:40PM -0500, Tim Peters wrote:
| [Tim Peters]
|  Log message for revision 41456:
|Repair invocation of Inno compiler -- it doesn't ( can't) work to
|stick the path and /cc in the same quoted string.  Unsure why that
|change was made (it worked fine before -- and now).
| 
| [Sidnei da Silva]
|  That change was so I can run: 'ISS_COMPILER=iscc.exe
|  WinBuilders/buildout', because compile32.exe fires up the gui, and
|  obviously that can't work with the buildbot.
| 
| I don't see why not -- no interaction with the GUI is required, it simply
| pops up a window for as long as the Inno compiler runs.  Then the window
| goes away again, all by itself.

I can surely say that it doesn't work with the buildbot. Maybe because
it's running as a Windows Service.

-- 
Sidnei da Silva
Enfold Systems, LLC.
http://enfoldsystems.com
___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.9/ - Missing import of NotFound in webdav.Resource.

2006-02-28 Thread Sidnei da Silva
Log message for revision 65607:
  
  - Missing import of NotFound in webdav.Resource.
  

Changed:
  U   Zope/branches/2.9/doc/CHANGES.txt
  U   Zope/branches/2.9/lib/python/webdav/Resource.py

-=-
Modified: Zope/branches/2.9/doc/CHANGES.txt
===
--- Zope/branches/2.9/doc/CHANGES.txt   2006-02-28 19:55:33 UTC (rev 65606)
+++ Zope/branches/2.9/doc/CHANGES.txt   2006-02-28 19:56:14 UTC (rev 65607)
@@ -14,6 +14,12 @@
  to the rules for such a type laid out in the Python docs:
  http://docs.python.org/api/supporting-cycle-detection.html
 
+  After Zope 2.9.1
+
+Bugs fixed
+
+  - Missing import of NotFound in webdav.Resource.
+
   Zope 2.9.1  (2006/02/25)
 
 Bugs fixed

Modified: Zope/branches/2.9/lib/python/webdav/Resource.py
===
--- Zope/branches/2.9/lib/python/webdav/Resource.py 2006-02-28 19:55:33 UTC 
(rev 65606)
+++ Zope/branches/2.9/lib/python/webdav/Resource.py 2006-02-28 19:56:14 UTC 
(rev 65607)
@@ -24,7 +24,7 @@
 from AccessControl import getSecurityManager
 from Acquisition import aq_base
 from zExceptions import BadRequest, MethodNotAllowed
-from zExceptions import Unauthorized, Forbidden
+from zExceptions import Unauthorized, Forbidden, NotFound
 from zope.interface import implements
 from ZPublisher.HTTPRangeSupport import HTTPRangeInterface
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/ - Missing import of NotFound in webdav.Resource.

2006-02-28 Thread Sidnei da Silva
Log message for revision 65608:
  
  - Missing import of NotFound in webdav.Resource.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/webdav/Resource.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2006-02-28 19:56:14 UTC (rev 65607)
+++ Zope/trunk/doc/CHANGES.txt  2006-02-28 20:02:08 UTC (rev 65608)
@@ -197,6 +197,8 @@
 
 Bugs Fixed
 
+  - Missing import of NotFound in webdav.Resource
+
   - Collector #1819: fixed method signature of
 MountedObject.SimpleTrailblazer._construct()
 

Modified: Zope/trunk/lib/python/webdav/Resource.py
===
--- Zope/trunk/lib/python/webdav/Resource.py2006-02-28 19:56:14 UTC (rev 
65607)
+++ Zope/trunk/lib/python/webdav/Resource.py2006-02-28 20:02:08 UTC (rev 
65608)
@@ -31,7 +31,7 @@
 from AccessControl.Permissions import webdav_access
 from Acquisition import aq_base
 from zExceptions import BadRequest, MethodNotAllowed
-from zExceptions import Unauthorized, Forbidden
+from zExceptions import Unauthorized, Forbidden, NotFound
 from zope.interface import implements
 from ZPublisher.HTTPRangeSupport import HTTPRangeInterface
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.9/inst/ - A try at syncing the makefile.win.in with makefile.in

2006-05-12 Thread Sidnei da Silva
Log message for revision 68115:
  
  - A try at syncing the makefile.win.in with makefile.in
  

Changed:
  U   Zope/branches/2.9/inst/Makefile.in
  U   Zope/branches/2.9/inst/Makefile.win.in
  U   Zope/branches/2.9/inst/configure.py

-=-
Modified: Zope/branches/2.9/inst/Makefile.in
===
--- Zope/branches/2.9/inst/Makefile.in  2006-05-12 22:11:44 UTC (rev 68114)
+++ Zope/branches/2.9/inst/Makefile.in  2006-05-13 03:38:11 UTC (rev 68115)
@@ -11,7 +11,7 @@
 
 PYTHON=PYTHON
 ZPKG=zpkg
-TMPDIR=/tmp
+TMPDIR=TMP_DIR
 PREFIX=PREFIX
 BASE_DIR=BASE_DIR
 DISTUTILS_OPTS=DISTUTILS_OPTS

Modified: Zope/branches/2.9/inst/Makefile.win.in
===
--- Zope/branches/2.9/inst/Makefile.win.in  2006-05-12 22:11:44 UTC (rev 
68114)
+++ Zope/branches/2.9/inst/Makefile.win.in  2006-05-13 03:38:11 UTC (rev 
68115)
@@ -10,16 +10,14 @@
 PACKAGE_NAME=$(NAME)-$(MAJOR_VERSION).$(MINOR_VERSION)-$(RELEASE_TAG)
 
 PYTHON=PYTHON
-PREFIX=PREFIX
-BASE_DIR=BASE_DIR
-BUILD_BASE=BUILD_BASE
+ZPKG=zpkg
+TMPDIR=TMP_DIR
+PREFIX=PREFIX
+BASE_DIR=BASE_DIR
 DISTUTILS_OPTS=DISTUTILS_OPTS
 INSTALL_FLAGS=INSTALL_FLAGS
 TESTOPTS=-v
-BUILD_FLAGS=--build-base=$(BUILD_BASE) \
---build-lib=$(BUILD_BASE)\build-lib \
---build-scripts=$(BUILD_BASE)\build-scripts \
---build-temp=$(BUILD_BASE)\build-temp
+BUILD_FLAGS=-i
 
 RM=del /f /q
 !IF ($(OS) == Windows_NT)
@@ -37,37 +35,74 @@
@ echo Zope built.  Next, do 'nmake install'.
@ echo.
 
-.PHONY: clean install build unbuild
-.PHONY: default
+.PHONY : clean install instance untestinst testinst build
+.PHONY : default
 
 # build:   Do whatever 'setup.py build' implies
 build:
$(PYTHON) $(BASE_DIR)\setup.py \
-$(DISTUTILS_OPTS) build $(BUILD_FLAGS)
+$(DISTUTILS_OPTS) build_ext $(BUILD_FLAGS)
 
-# unbuild: Remove the build directory (undo the make build step)
-unbuild:
-   -$(RMRF) $(BUILD_BASE)
-
 # install: Install a software home.
 install: build version_txt
-   $(PYTHON) $(BASE_DIR)\setup.py $(DISTUTILS_OPTS) install \
-   --prefix=$(PREFIX) $(BUILD_FLAGS) $(INSTALL_FLAGS)
+   $(PYTHON) $(BASE_DIR)\setup.py $(DISTUTILS_OPTS) \
+  build_ext $(BUILD_FLAGS) \
+  install --home=$(PREFIX) $(INSTALL_FLAGS)
@ echo.
@ echo Zope binaries installed successfully.
@ echo Now run '$(PYTHON) $(PREFIX)\bin\mkzopeinstance.py'
 
+# inplace: Do an in-place build
+inplace: build
+
+# test:Do an inplace build and run the Zope test suite.
+test: inplace
+   $(PYTHON) $(BASE_DIR)\test.py $(TESTOPTS)
+
+# instance:Do an inplace build and create an instance home in the resulting
+#  software home.
+instance: build
+   $(PYTHON) $(BASE_DIR)\utilities\mkzopeinstance.py $(MKZ_FLAGS)
+
+# testinst:Perform an inplace build and create an instance home in the
+#  resulting software home without asking questions.  Useful when
+#  performing automated testing.
+# testinst: MKZ_FLAGS=--user=admin:admin --dir=$(BASE_DIR)
+# testinst: instance
+
+# uninstance:  Remove the instance files made by testinstance (w/ prejudice)
+uninstance:
+   $(RMRF) $(BASE_DIR)/bin
+   $(RMRF) $(BASE_DIR)/etc
+   $(RMRF) $(BASE_DIR)/import
+   $(RMRF) $(BASE_DIR)/log
+   $(RMRF) $(BASE_DIR)/var
+   $(RMRF) $(BASE_DIR)/Products
+
+# clean:   Delete the build files and any binaries/bytecode files in
+#  the source directory for good measure.
+clean:
+   $(CD) $(BASE_DIR)
+   -$(RM) /s *.pyc *.pyo *.dll *.o *.obj *.pyd
+   -$(RM) $(BASE_DIR)\lib\python\version.txt
+   -$(RMRF) build
+
 # version_txt: create a version file in lib/python/version.txt
 version_txt:
echo Zope $(MAJOR_VERSION).$(MINOR_VERSION)-$(RELEASE_TAG) \
   $(BASE_DIR)/lib/python/version.txt
 
-# clean:   Delete the build files and any binaries/bytecode files in
-#  the source directory for good measure.
-clean: unbuild
-   $(CD) $(BASE_DIR)
-   -$(RM) /s *.pyc *.pyo *.dll *.o *.obj *.pyd
-   -$(RM) (BASE_DIR)\lib\python\version.txt
+# Building a source distribution requires that zpkg be available:
+sdist: version_txt
+   $(ZPKG) -C $(BASE_DIR)\releases\Zope2.cfg -r 
$(MAJOR_VERSION).$(MINOR_VERSION)$(RELEASE_TAG)
 
+# clobber: Make the source tree 'pristine' again.
+clobber: clean uninstance
 
+# distclean: Make the source tree *really* 'pristine' again.
+distclean: clobber
+   $(RM) makefile Makefile
+   $(RMRF) build-base
 
+
+

Modified: Zope/branches/2.9/inst/configure.py
===
--- Zope/branches/2.9/inst/configure.py 2006-05-12 22:11:44 UTC (rev 68114)
+++ Zope/branches/2.9/inst/configure.py 2006-05-13 03:38:11 UTC (rev 68115)
@@ -17,6 +17,7 @@
 import os
 import sys
 import 

[Zope-Checkins] SVN: Zope/branches/2.9/inst/ - Restore buildout into functioning

2006-07-13 Thread Sidnei da Silva
Log message for revision 69118:
  
  - Restore buildout into functioning
  

Changed:
  U   Zope/branches/2.9/inst/Makefile.win.in
  A   Zope/branches/2.9/inst/WinBuilders/bin/makezope.bat
  U   Zope/branches/2.9/inst/WinBuilders/etc/zope.iss.in
  U   Zope/branches/2.9/inst/WinBuilders/mk/common.mk
  U   Zope/branches/2.9/inst/WinBuilders/mk/python.mk
  U   Zope/branches/2.9/inst/WinBuilders/mk/zope.mk
  U   Zope/branches/2.9/inst/tar.py

-=-
Modified: Zope/branches/2.9/inst/Makefile.win.in
===
--- Zope/branches/2.9/inst/Makefile.win.in  2006-07-13 22:23:17 UTC (rev 
69117)
+++ Zope/branches/2.9/inst/Makefile.win.in  2006-07-13 23:21:48 UTC (rev 
69118)
@@ -7,7 +7,8 @@
 MAJOR_VERSION=ZOPE_MAJOR_VERSION
 MINOR_VERSION=ZOPE_MINOR_VERSION
 RELEASE_TAG=VERSION_RELEASE_TAG
-PACKAGE_NAME=$(NAME)-$(MAJOR_VERSION).$(MINOR_VERSION)-$(RELEASE_TAG)
+ZOPEVERSION=$(MAJOR_VERSION).$(MINOR_VERSION)-$(RELEASE_TAG)
+PACKAGE_NAME=$(NAME)-$(ZOPEVERSION)
 
 PYTHON=PYTHON
 TMPDIR=TMP_DIR
@@ -31,7 +32,9 @@
 CD=cd
 XCOPY=xcopy /i /s /e /y
 COPY=copy
+MOVE=move
 EXISTS=IF EXIST
+NOT_EXISTS=IF NOT EXIST
 
 default: build
 # default: The default step (invoked when make is called without a target)
@@ -59,6 +62,16 @@
@ echo Zope binaries installed successfully.
@ echo Now run '$(PYTHON) $(PREFIX)\bin\mkzopeinstance.py'
 
+
+$(BASE_DIR)/inst/tmp/$(PACKAGE_NAME).tgz:
+   $(MAKE) sdist
+   $(NOT_EXISTS) inst\tmp $(MKDIR) inst\tmp
+   $(MOVE) $(PACKAGE_NAME).tgz inst\tmp
+
+# installer: Create the Zope Installer.
+installer: $(BASE_DIR)/inst/tmp/$(PACKAGE_NAME).tgz
+   $(CD) inst  sh Winbuilders/buildout zope ZOPEVERSION=$(ZOPEVERSION)
+
 # inplace: Do an in-place build
 inplace:
$(MAKE) install PREFIX=$(BASE_DIR)

Added: Zope/branches/2.9/inst/WinBuilders/bin/makezope.bat
===
--- Zope/branches/2.9/inst/WinBuilders/bin/makezope.bat 2006-07-13 22:23:17 UTC 
(rev 69117)
+++ Zope/branches/2.9/inst/WinBuilders/bin/makezope.bat 2006-07-13 23:21:48 UTC 
(rev 69118)
@@ -0,0 +1,4 @@
+cd %1%
+set MAKEFLAGS=
+nmake build
+nmake install

Modified: Zope/branches/2.9/inst/WinBuilders/etc/zope.iss.in
===
--- Zope/branches/2.9/inst/WinBuilders/etc/zope.iss.in  2006-07-13 22:23:17 UTC 
(rev 69117)
+++ Zope/branches/2.9/inst/WinBuilders/etc/zope.iss.in  2006-07-13 23:21:48 UTC 
(rev 69118)
@@ -33,7 +33,7 @@
 Source:doc\*.*; DestDir: {app}\doc; Flags: ignoreversion recursesubdirs
 Source:lib\*.*; DestDir: {app}\lib; Flags: ignoreversion recursesubdirs
 Source:skel\*.*; DestDir: {app}\skel; Flags: ignoreversion recursesubdirs
-Source:zopeskel\*.*; DestDir: {app}\zopeskel; Flags: ignoreversion 
recursesubdirs
+
 ; these are required to be put into the bin directory for proper function of 
NT services
 Source:bin\Lib\site-packages\win32\PythonService.exe; DestDir: {app}\bin; 
Flags: ignoreversion
 Source:bin\Lib\site-packages\pywin32_system32\PyWinTypes24.dll; DestDir: 
{app}\bin; Flags: ignoreversion

Modified: Zope/branches/2.9/inst/WinBuilders/mk/common.mk
===
--- Zope/branches/2.9/inst/WinBuilders/mk/common.mk 2006-07-13 22:23:17 UTC 
(rev 69117)
+++ Zope/branches/2.9/inst/WinBuilders/mk/common.mk 2006-07-13 23:21:48 UTC 
(rev 69118)
@@ -39,8 +39,8 @@
 NMAKE=nmake
 CSCRIPT=cscript
 ECHO=echo
-ISS_DIR=$(CYGROOT)/Progra~1/Inno Setup 5
-ISS_COMPILER=$(ISS_DIR)/Compil32.exe
+ISS_DIR=$(PROGRAMFILES)\\Inno Setup 5
+ISS_COMPILER=$(ISS_DIR)\\Compil32.exe
 # We need a version that understands cygwin paths, so /bin/
 UNZIP=/bin/unzip
 

Modified: Zope/branches/2.9/inst/WinBuilders/mk/python.mk
===
--- Zope/branches/2.9/inst/WinBuilders/mk/python.mk 2006-07-13 22:23:17 UTC 
(rev 69117)
+++ Zope/branches/2.9/inst/WinBuilders/mk/python.mk 2006-07-13 23:21:48 UTC 
(rev 69118)
@@ -72,7 +72,7 @@
 
 $(ARB_PYSRCDIR): tmp/$(PYDIRNAME).tgz
$(MKDIR) $(SRC_DIR)
-   $(CD) $(SRC_DIR)  $(TAR) xvzf ../tmp/$(PYDIRNAME).tgz
+   $(CD) $(SRC_DIR)  $(TAR) xzf ../tmp/$(PYDIRNAME).tgz
$(TOUCH) $(ARB_PYSRCDIR)
 
 # unzip warns about .exe not being exactly a .zip, then succeeds in

Modified: Zope/branches/2.9/inst/WinBuilders/mk/zope.mk
===
--- Zope/branches/2.9/inst/WinBuilders/mk/zope.mk   2006-07-13 22:23:17 UTC 
(rev 69117)
+++ Zope/branches/2.9/inst/WinBuilders/mk/zope.mk   2006-07-13 23:21:48 UTC 
(rev 69118)
@@ -1,15 +1,15 @@
-ZOPEVERSION := 2.9.3
+ZOPEVERSION = 2.9.3
 ZOPEDIRNAME := Zope-$(ZOPEVERSION)
 
 ZOPE_REQUIRED_FILES=tmp/$(ZOPEDIRNAME).tgz
 
-REQUIRED_FILES=$(PYTHON_REQUIRED_FILES)\
+REQUIRED_FILES=$(PYTHON_REQUIRED_FILES) \
$(ZOPE_REQUIRED_FILES)
 
 clean_zope:

[Zope-Checkins] SVN: Zope/trunk/inst/ - Restore buildout into functioning

2006-07-13 Thread Sidnei da Silva
Log message for revision 69120:
  
   - Restore buildout into functioning
   

Changed:
  U   Zope/trunk/inst/Makefile.win.in
  A   Zope/trunk/inst/WinBuilders/bin/makezope.bat
  U   Zope/trunk/inst/WinBuilders/etc/zope.iss.in
  U   Zope/trunk/inst/WinBuilders/mk/common.mk
  U   Zope/trunk/inst/WinBuilders/mk/python.mk
  U   Zope/trunk/inst/WinBuilders/mk/zope.mk
  U   Zope/trunk/inst/tar.py

-=-
Modified: Zope/trunk/inst/Makefile.win.in
===
--- Zope/trunk/inst/Makefile.win.in 2006-07-13 23:23:55 UTC (rev 69119)
+++ Zope/trunk/inst/Makefile.win.in 2006-07-13 23:25:08 UTC (rev 69120)
@@ -7,7 +7,8 @@
 MAJOR_VERSION=ZOPE_MAJOR_VERSION
 MINOR_VERSION=ZOPE_MINOR_VERSION
 RELEASE_TAG=VERSION_RELEASE_TAG
-PACKAGE_NAME=$(NAME)-$(MAJOR_VERSION).$(MINOR_VERSION)-$(RELEASE_TAG)
+ZOPEVERSION=$(MAJOR_VERSION).$(MINOR_VERSION)-$(RELEASE_TAG)
+PACKAGE_NAME=$(NAME)-$(ZOPEVERSION)
 
 PYTHON=PYTHON
 TMPDIR=TMP_DIR
@@ -31,7 +32,9 @@
 CD=cd
 XCOPY=xcopy /i /s /e /y
 COPY=copy
+MOVE=move
 EXISTS=IF EXIST
+NOT_EXISTS=IF NOT EXIST
 
 default: build
 # default: The default step (invoked when make is called without a target)
@@ -59,6 +62,16 @@
@ echo Zope binaries installed successfully.
@ echo Now run '$(PYTHON) $(PREFIX)\bin\mkzopeinstance.py'
 
+
+$(BASE_DIR)/inst/tmp/$(PACKAGE_NAME).tgz:
+   $(MAKE) sdist
+   $(NOT_EXISTS) inst\tmp $(MKDIR) inst\tmp
+   $(MOVE) $(PACKAGE_NAME).tgz inst\tmp
+
+# installer: Create the Zope Installer.
+installer: $(BASE_DIR)/inst/tmp/$(PACKAGE_NAME).tgz
+   $(CD) inst  sh Winbuilders/buildout zope ZOPEVERSION=$(ZOPEVERSION)
+
 # inplace: Do an in-place build
 inplace:
$(MAKE) install PREFIX=$(BASE_DIR)

Copied: Zope/trunk/inst/WinBuilders/bin/makezope.bat (from rev 69118, 
Zope/branches/2.9/inst/WinBuilders/bin/makezope.bat)

Modified: Zope/trunk/inst/WinBuilders/etc/zope.iss.in
===
--- Zope/trunk/inst/WinBuilders/etc/zope.iss.in 2006-07-13 23:23:55 UTC (rev 
69119)
+++ Zope/trunk/inst/WinBuilders/etc/zope.iss.in 2006-07-13 23:25:08 UTC (rev 
69120)
@@ -33,7 +33,7 @@
 Source:doc\*.*; DestDir: {app}\doc; Flags: ignoreversion recursesubdirs
 Source:lib\*.*; DestDir: {app}\lib; Flags: ignoreversion recursesubdirs
 Source:skel\*.*; DestDir: {app}\skel; Flags: ignoreversion recursesubdirs
-Source:zopeskel\*.*; DestDir: {app}\zopeskel; Flags: ignoreversion 
recursesubdirs
+
 ; these are required to be put into the bin directory for proper function of 
NT services
 Source:bin\Lib\site-packages\win32\PythonService.exe; DestDir: {app}\bin; 
Flags: ignoreversion
 Source:bin\Lib\site-packages\pywin32_system32\PyWinTypes24.dll; DestDir: 
{app}\bin; Flags: ignoreversion

Modified: Zope/trunk/inst/WinBuilders/mk/common.mk
===
--- Zope/trunk/inst/WinBuilders/mk/common.mk2006-07-13 23:23:55 UTC (rev 
69119)
+++ Zope/trunk/inst/WinBuilders/mk/common.mk2006-07-13 23:25:08 UTC (rev 
69120)
@@ -39,8 +39,8 @@
 NMAKE=nmake
 CSCRIPT=cscript
 ECHO=echo
-ISS_DIR=$(CYGROOT)/Progra~1/Inno Setup 5
-ISS_COMPILER=$(ISS_DIR)/Compil32.exe
+ISS_DIR=$(PROGRAMFILES)\\Inno Setup 5
+ISS_COMPILER=$(ISS_DIR)\\Compil32.exe
 # We need a version that understands cygwin paths, so /bin/
 UNZIP=/bin/unzip
 

Modified: Zope/trunk/inst/WinBuilders/mk/python.mk
===
--- Zope/trunk/inst/WinBuilders/mk/python.mk2006-07-13 23:23:55 UTC (rev 
69119)
+++ Zope/trunk/inst/WinBuilders/mk/python.mk2006-07-13 23:25:08 UTC (rev 
69120)
@@ -72,7 +72,7 @@
 
 $(ARB_PYSRCDIR): tmp/$(PYDIRNAME).tgz
$(MKDIR) $(SRC_DIR)
-   $(CD) $(SRC_DIR)  $(TAR) xvzf ../tmp/$(PYDIRNAME).tgz
+   $(CD) $(SRC_DIR)  $(TAR) xzf ../tmp/$(PYDIRNAME).tgz
$(TOUCH) $(ARB_PYSRCDIR)
 
 # unzip warns about .exe not being exactly a .zip, then succeeds in

Modified: Zope/trunk/inst/WinBuilders/mk/zope.mk
===
--- Zope/trunk/inst/WinBuilders/mk/zope.mk  2006-07-13 23:23:55 UTC (rev 
69119)
+++ Zope/trunk/inst/WinBuilders/mk/zope.mk  2006-07-13 23:25:08 UTC (rev 
69120)
@@ -1,15 +1,15 @@
-ZOPEVERSION := 2.10.0-b1
+ZOPEVERSION = 2.10.0-b1
 ZOPEDIRNAME := Zope-$(ZOPEVERSION)
 
 ZOPE_REQUIRED_FILES=tmp/$(ZOPEDIRNAME).tgz
 
-REQUIRED_FILES=$(PYTHON_REQUIRED_FILES)\
+REQUIRED_FILES=$(PYTHON_REQUIRED_FILES) \
$(ZOPE_REQUIRED_FILES)
 
 clean_zope:
$(RMRF) src/$(ZOPEDIRNAME)
 
-install_zope: src/$(ZOPEDIRNAME)/install.py \
+install_zope: src/$(ZOPEDIRNAME)/inst/configure.py \
install_python \
$(BUILD_DIR)/lib/python/Zope2/version.txt \
$(BUILD_DIR)/Zope-$(ZOPEVERSION)-win32.exe
@@ -40,27 +40,16 @@
# Build the Inno installer.
$(CD) $(BUILD_DIR);$(ISS_COMPILER) /cc $(WIN_BUILD_DIR)\zope.iss
 

[Zope-Checkins] SVN: Zope/trunk/doc/CHANGES.txt - Fix usage of urljoin in webdav.davcmds

2006-07-17 Thread Sidnei da Silva
Log message for revision 69165:
  
  - Fix usage of urljoin in webdav.davcmds
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2006-07-17 23:34:32 UTC (rev 69164)
+++ Zope/trunk/doc/CHANGES.txt  2006-07-17 23:34:59 UTC (rev 69165)
@@ -39,6 +39,9 @@
 
 Bugs Fixed
 
+  - Usage of 'urljoin' in 'webdav.davcmds' could lead to wrongly
+constructed urls.
+
   - reStructuredText/ZReST: setting raw_enabled to 0 for security
 reasons
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.9/ - Fixup usage of urljoin in webdav.davcmds

2006-07-20 Thread Sidnei da Silva
Log message for revision 69225:
  
  - Fixup usage of urljoin in webdav.davcmds
  (a shame I missed the deadline to Zope 2.9.4)
  

Changed:
  U   Zope/branches/2.9/doc/CHANGES.txt
  U   Zope/branches/2.9/lib/python/webdav/common.py
  U   Zope/branches/2.9/lib/python/webdav/davcmds.py

-=-
Modified: Zope/branches/2.9/doc/CHANGES.txt
===
--- Zope/branches/2.9/doc/CHANGES.txt   2006-07-20 12:09:12 UTC (rev 69224)
+++ Zope/branches/2.9/doc/CHANGES.txt   2006-07-20 12:22:36 UTC (rev 69225)
@@ -14,6 +14,13 @@
  to the rules for such a type laid out in the Python docs:
  http://docs.python.org/api/supporting-cycle-detection.html
 
+  Zope 2.9.5 (unreleased)
+
+   Bugs fixed
+
+  - Usage of 'urljoin' in 'webdav.davcmds' could lead to wrongly
+constructed urls.
+
   Zope 2.9.4 (2006/07/21)
 
Bugs fixed

Modified: Zope/branches/2.9/lib/python/webdav/common.py
===
--- Zope/branches/2.9/lib/python/webdav/common.py   2006-07-20 12:09:12 UTC 
(rev 69224)
+++ Zope/branches/2.9/lib/python/webdav/common.py   2006-07-20 12:22:36 UTC 
(rev 69225)
@@ -42,6 +42,11 @@
 return attr()
 return attr
 
+def urljoin(url, s):
+url = url.rstrip('/')
+s = s.lstrip('/')
+return '/'.join((url, s))
+
 def urlfix(url, s):
 n=len(s)
 if url[-n:]==s: url=url[:-n]

Modified: Zope/branches/2.9/lib/python/webdav/davcmds.py
===
--- Zope/branches/2.9/lib/python/webdav/davcmds.py  2006-07-20 12:09:12 UTC 
(rev 69224)
+++ Zope/branches/2.9/lib/python/webdav/davcmds.py  2006-07-20 12:22:36 UTC 
(rev 69225)
@@ -23,10 +23,9 @@
 from AccessControl import getSecurityManager
 from Acquisition import aq_parent
 from OFS.PropertySheets import DAVProperties
-from ZConfig.url import urljoin
 from zExceptions import BadRequest, Forbidden
 
-from common import absattr, aq_base, urlfix, urlbase
+from common import absattr, aq_base, urlfix, urlbase, urljoin
 from common import isDavCollection
 from common import PreconditionFailed
 from interfaces import IWriteLock
@@ -170,8 +169,8 @@
 if dflag:
 ob._p_deactivate()
 elif hasattr(ob, '__dav_resource__'):
-uri=urljoin(url, absattr(ob.id))
-depth=depth=='infinity' and depth or 0
+uri = urljoin(url, absattr(ob.getId()))
+depth = depth=='infinity' and depth or 0
 self.apply(ob, uri, depth, result, top=0)
 if dflag:
 ob._p_deactivate()
@@ -409,7 +408,7 @@
 if depth == 'infinity' and iscol:
 for ob in obj.objectValues():
 if hasattr(obj, '__dav_resource__'):
-uri = urljoin(url, absattr(ob.id))
+uri = urljoin(url, absattr(ob.getId()))
 self.apply(ob, creator, depth, token, result,
uri, top=0)
 if not top:
@@ -474,7 +473,7 @@
 if hasattr(ob, '__dav_resource__') and \
 (IWriteLock.providedBy(ob) or
  WriteLockInterface.isImplementedBy(ob)):
-uri = urljoin(url, absattr(ob.id))
+uri = urljoin(url, absattr(ob.getId()))
 self.apply(ob, token, uri, result, top=0)
 if not top:
 return result
@@ -529,7 +528,7 @@
 for ob in obj.objectValues():
 dflag = hasattr(ob,'_p_changed') and (ob._p_changed == None)
 if hasattr(ob, '__dav_resource__'):
-uri = urljoin(url, absattr(ob.id))
+uri = urljoin(url, absattr(ob.getId()))
 self.apply(ob, token, user, uri, result, top=0)
 if dflag:
 ob._p_deactivate()

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.9/ - Fix #2155: Wrong parameters being passed to logger's error().

2006-08-18 Thread Sidnei da Silva
Log message for revision 69658:
  - Fix #2155: Wrong parameters being passed to logger's error().
  

Changed:
  U   Zope/branches/2.9/doc/CHANGES.txt
  U   Zope/branches/2.9/lib/python/ZPublisher/BeforeTraverse.py
  A   Zope/branches/2.9/lib/python/ZPublisher/tests/testBeforeTraverse.py

-=-
Modified: Zope/branches/2.9/doc/CHANGES.txt
===
--- Zope/branches/2.9/doc/CHANGES.txt   2006-08-18 16:10:19 UTC (rev 69657)
+++ Zope/branches/2.9/doc/CHANGES.txt   2006-08-18 16:34:06 UTC (rev 69658)
@@ -16,6 +16,9 @@
   - Usage of 'urljoin' in 'webdav.davcmds' could lead to wrongly
 constructed urls.
 
+  - Collector #2155: Fix wrong parameter being passed to
+logger's error() method, with tests.
+
   Zope 2.9.4 (2006/07/21)
 
Bugs fixed

Modified: Zope/branches/2.9/lib/python/ZPublisher/BeforeTraverse.py
===
--- Zope/branches/2.9/lib/python/ZPublisher/BeforeTraverse.py   2006-08-18 
16:10:19 UTC (rev 69657)
+++ Zope/branches/2.9/lib/python/ZPublisher/BeforeTraverse.py   2006-08-18 
16:34:06 UTC (rev 69658)
@@ -13,10 +13,9 @@
 __version__='$Revision: 1.12 $'[11:-2]
 
 BeforeTraverse interface and helper classes
-import logging
 
+import logging
 from Acquisition import aq_base
-import sys
 
 # Interface
 
@@ -105,7 +104,7 @@
 cob(container, request)
 except TypeError:
 self.logger.error('%s call %s failed.' % (
-`self._hookname`, `cob`), error=sys.exc_info())
+`self._hookname`, `cob`), exc_info=True)
 
 def add(self, cob):
 self._list.append(cob)
@@ -151,6 +150,5 @@
 # Only catch exceptions that are likely to be logic errors.
 # We shouldn't catch Redirects, Unauthorizeds, etc. since
 # the programmer may want to raise them deliberately.
-import sys
 self.logger.error('Error while invoking hook: %s'
-% self.name, error=sys.exc_info())
+% self.name, exc_info=True)

Added: Zope/branches/2.9/lib/python/ZPublisher/tests/testBeforeTraverse.py
===
--- Zope/branches/2.9/lib/python/ZPublisher/tests/testBeforeTraverse.py 
2006-08-18 16:10:19 UTC (rev 69657)
+++ Zope/branches/2.9/lib/python/ZPublisher/tests/testBeforeTraverse.py 
2006-08-18 16:34:06 UTC (rev 69658)
@@ -0,0 +1,153 @@
+import sys
+import logging
+
+from Acquisition import Implicit
+from ZPublisher import BeforeTraverse
+from ZPublisher.BaseRequest import BaseRequest
+from ZPublisher.HTTPResponse import HTTPResponse
+
+def makeBaseRequest(root):
+response = HTTPResponse()
+environment = { 'URL': '',
+   'PARENTS': [root],
+   'steps': [],
+   '_hacked_path': 0,
+   '_test_counter': 0,
+   'response': response }
+return BaseRequest(environment)
+
+
+class DummyObjectBasic(Implicit):
+ Dummy class with docstring.
+
+pass
+
+
+class BrokenHook:
+
+def __call__(self, *args):
+   print self.__class__.__name__, 'called'
+   raise TypeError, self.__class__.__name__
+
+def testBeforeTraverse(self):
+ 
+Zope supports a 'before traverse' hook that is used for several
+features, including 'Site Access Rules'. It is implemented using a
+special API for registering hooks, and the hooks themselves are
+called during traversal by ZPublisher.
+
+ root = DummyObjectBasic()
+ request = makeBaseRequest(root)
+
+ container = DummyObjectBasic()
+ root.container = container
+
+ obj = DummyObjectBasic()
+ container.obj = obj
+
+Setup a broken hook as the before traverse hook for the
+container. That will create a 'MultiHook' object:
+
+ BeforeTraverse.registerBeforeTraverse(container, BrokenHook(),
+...'broken_hook')
+
+ container.__before_publishing_traverse__
+ZPublisher.BeforeTraverse.MultiHook instance at ...
+
+ container.__before_traverse__
+{(99, 'broken_hook'): ZPublisher.tests.testBeforeTraverse.BrokenHook ...}
+
+Setup logging so we can see the actual exception being logged:
+
+ logger = logging.getLogger('MultiHook')
+ level = logger.level
+ handlers = logger.handlers[:]
+
+ logger.addHandler(logging.StreamHandler(sys.stdout))
+ logger.setLevel(logging.ERROR)
+
+Now do the actual traversal:
+
+ _ = request.traverse('container/obj')
+BrokenHook called
+'__before_publishing_traverse__' call ... failed.
+Traceback (most recent call last):
+...
+TypeError: BrokenHook
+
+Unregister the borken hook:
+
+ _ = BeforeTraverse.unregisterBeforeTraverse(container, 'broken_hook')
+
+The list of 'before traverse' hooks is empty:
+
+ container.__before_traverse__
+{}
+
+But the 

[Zope-Checkins] SVN: Zope/branches/2.10/ - Fix #2155: Wrong parameters being passed to logger's error().

2006-08-18 Thread Sidnei da Silva
Log message for revision 69659:
  - Fix #2155: Wrong parameters being passed to logger's error().
  

Changed:
  U   Zope/branches/2.10/doc/CHANGES.txt
  U   Zope/branches/2.10/lib/python/ZPublisher/BeforeTraverse.py
  A   Zope/branches/2.10/lib/python/ZPublisher/tests/testBeforeTraverse.py

-=-
Modified: Zope/branches/2.10/doc/CHANGES.txt
===
--- Zope/branches/2.10/doc/CHANGES.txt  2006-08-18 16:34:06 UTC (rev 69658)
+++ Zope/branches/2.10/doc/CHANGES.txt  2006-08-18 16:46:42 UTC (rev 69659)
@@ -8,6 +8,9 @@
 
 Bugs Fixed
 
+  - Collector #2155: Fix wrong parameter being passed to
+logger's error() method, with tests.
+
   - Updated Five to stable 1.5 release.
 
   - Traversal order changes were causing WebDAV requests which used

Modified: Zope/branches/2.10/lib/python/ZPublisher/BeforeTraverse.py
===
--- Zope/branches/2.10/lib/python/ZPublisher/BeforeTraverse.py  2006-08-18 
16:34:06 UTC (rev 69658)
+++ Zope/branches/2.10/lib/python/ZPublisher/BeforeTraverse.py  2006-08-18 
16:46:42 UTC (rev 69659)
@@ -16,7 +16,6 @@
 
 from Acquisition import aq_base
 from logging import getLogger
-import sys
 
 # Interface
 
@@ -106,7 +105,7 @@
 cob(container, request)
 except TypeError:
 LOG.error('%s call %s failed.' % (
-`self._hookname`, `cob`), exc_info=sys.exc_info())
+`self._hookname`, `cob`), exc_info=True)
 
 def add(self, cob):
 self._list.append(cob)
@@ -151,6 +150,5 @@
 # Only catch exceptions that are likely to be logic errors.
 # We shouldn't catch Redirects, Unauthorizeds, etc. since
 # the programmer may want to raise them deliberately.
-
 LOG.error('BeforeTraverse: Error while invoking hook: %s' % 
self.name, 
-  exc_info=sys.exc_info())
+  exc_info=True)

Copied: Zope/branches/2.10/lib/python/ZPublisher/tests/testBeforeTraverse.py 
(from rev 69658, 
Zope/branches/2.9/lib/python/ZPublisher/tests/testBeforeTraverse.py)
===
--- Zope/branches/2.9/lib/python/ZPublisher/tests/testBeforeTraverse.py 
2006-08-18 16:34:06 UTC (rev 69658)
+++ Zope/branches/2.10/lib/python/ZPublisher/tests/testBeforeTraverse.py
2006-08-18 16:46:42 UTC (rev 69659)
@@ -0,0 +1,139 @@
+import sys
+import logging
+
+from Acquisition import Implicit
+from ZPublisher import BeforeTraverse
+from ZPublisher.BaseRequest import BaseRequest
+from ZPublisher.HTTPResponse import HTTPResponse
+
+def makeBaseRequest(root):
+response = HTTPResponse()
+environment = { 'URL': '',
+   'PARENTS': [root],
+   'steps': [],
+   '_hacked_path': 0,
+   '_test_counter': 0,
+   'response': response }
+return BaseRequest(environment)
+
+
+class DummyObjectBasic(Implicit):
+ Dummy class with docstring.
+
+pass
+
+
+class BrokenHook:
+
+def __call__(self, *args):
+   print self.__class__.__name__, 'called'
+   raise TypeError, self.__class__.__name__
+
+def testBeforeTraverse(self):
+ 
+Zope supports a 'before traverse' hook that is used for several
+features, including 'Site Access Rules'. It is implemented using a
+special API for registering hooks, and the hooks themselves are
+called during traversal by ZPublisher.
+
+ root = DummyObjectBasic()
+ request = makeBaseRequest(root)
+
+ container = DummyObjectBasic()
+ root.container = container
+
+ obj = DummyObjectBasic()
+ container.obj = obj
+
+Setup a broken hook as the before traverse hook for the
+container. That will create a 'MultiHook' object:
+
+ BeforeTraverse.registerBeforeTraverse(container, BrokenHook(),
+...'broken_hook')
+
+ container.__before_publishing_traverse__
+ZPublisher.BeforeTraverse.MultiHook instance at ...
+
+ container.__before_traverse__
+{(99, 'broken_hook'): ZPublisher.tests.testBeforeTraverse.BrokenHook ...}
+
+Setup logging so we can see the actual exception being logged:
+
+ logger = logging.getLogger('ZPublisher')
+ level = logger.level
+ handlers = logger.handlers[:]
+
+ logger.addHandler(logging.StreamHandler(sys.stdout))
+ logger.setLevel(logging.ERROR)
+
+Now do the actual traversal:
+
+ _ = request.traverse('container/obj')
+BrokenHook called
+'__before_publishing_traverse__' call ... failed.
+Traceback (most recent call last):
+...
+TypeError: BrokenHook
+
+Unregister the borken hook:
+
+ _ = BeforeTraverse.unregisterBeforeTraverse(container, 'broken_hook')
+
+The list of 'before traverse' hooks is empty:
+
+ container.__before_traverse__
+{}
+
+But the 'MultiHook' is not 

[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/Products/SiteAccess/VirtualHostMonster.py - Forward port from 2.9:Apply fix for #2288 to VirtualHostMonster too

2008-03-09 Thread Sidnei da Silva
Log message for revision 73323:
  - Forward port from 2.9:Apply fix for #2288 to VirtualHostMonster too

Changed:
  U   Zope/branches/2.10/lib/python/Products/SiteAccess/VirtualHostMonster.py

-=-
Modified: 
Zope/branches/2.10/lib/python/Products/SiteAccess/VirtualHostMonster.py
===
--- Zope/branches/2.10/lib/python/Products/SiteAccess/VirtualHostMonster.py 
2007-03-18 16:21:09 UTC (rev 73322)
+++ Zope/branches/2.10/lib/python/Products/SiteAccess/VirtualHostMonster.py 
2007-03-18 16:47:41 UTC (rev 73323)
@@ -10,8 +10,8 @@
 from OFS.SimpleItem import Item
 from Acquisition import Implicit, aq_inner, aq_parent
 from ZPublisher import BeforeTraverse
+from ZPublisher.BaseRequest import quote
 from zExceptions import BadRequest
-from urllib import quote
 import os
 
 from AccessRule import _swallow

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/SiteAccess/VirtualHostMonster.py - Forward port from 2.9:Apply fix for #2288 to VirtualHostMonster too

2008-03-09 Thread Sidnei da Silva
Log message for revision 73324:
  - Forward port from 2.9:Apply fix for #2288 to VirtualHostMonster too

Changed:
  U   Zope/trunk/lib/python/Products/SiteAccess/VirtualHostMonster.py

-=-
Modified: Zope/trunk/lib/python/Products/SiteAccess/VirtualHostMonster.py
===
--- Zope/trunk/lib/python/Products/SiteAccess/VirtualHostMonster.py 
2007-03-18 16:47:41 UTC (rev 73323)
+++ Zope/trunk/lib/python/Products/SiteAccess/VirtualHostMonster.py 
2007-03-18 16:47:50 UTC (rev 73324)
@@ -10,8 +10,8 @@
 from OFS.SimpleItem import Item
 from Acquisition import Implicit, aq_inner, aq_parent
 from ZPublisher import BeforeTraverse
+from ZPublisher.BaseRequest import quote
 from zExceptions import BadRequest
-from urllib import quote
 import os
 
 from AccessRule import _swallow

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/ - DAV: compatibility with Windows Web Folders restored by adding

2008-03-09 Thread Sidnei da Silva
Log message for revision 76767:
  
- DAV: compatibility with Windows Web Folders restored by adding
  a configuration variable that controls the sending of the
  non-standard MS-Author-Via and Public headers. Thanks for
  PatrickD for the the hard work coming up with an initial
  patch.
  (http://zope.org/Collectors/Zope/1441)
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/Zope2/Startup/handlers.py
  U   Zope/trunk/lib/python/Zope2/Startup/tests/test_schema.py
  U   Zope/trunk/lib/python/Zope2/Startup/zopeschema.xml
  U   Zope/trunk/lib/python/webdav/Resource.py
  U   Zope/trunk/lib/python/webdav/__init__.py
  U   Zope/trunk/lib/python/webdav/tests/testResource.py
  U   Zope/trunk/skel/etc/zope.conf.in

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2007-06-18 15:59:12 UTC (rev 76766)
+++ Zope/trunk/doc/CHANGES.txt  2007-06-18 16:04:25 UTC (rev 76767)
@@ -97,6 +97,13 @@
 
 Bugs Fixed
 
+  - Collector #1441: WebDAV compatibility with Windows Web Folders
+restored by adding a configuration variable that controls the
+sending of the non-standard MS-Author-Via and Public
+headers. Thanks for PatrickD for the the hard work coming up
+with an initial patch.  
+(http://zope.org/Collectors/Zope/1441)
+
   - DAV: litmus notowner_modify tests warn during a MOVE request
 because we returned 412 Precondition Failed instead of 423
 Locked when the resource attempting to be moved was itself
@@ -118,13 +125,14 @@
 for further rationale.
 
   - When Zope properties were set via DAV in the null namespace
-(xmlns=) a subsequent PROPFIND for the property would cause the 
-XML representation for that property to show a namespace of 
+(xmlns=) a subsequent PROPFIND for the property would cause the
+XML representation for that property to show a namespace of
 xmlns=None.  Fixed within OFS.PropertySheets.dav__propstat.
 
   - Relaxed requirements for context of
 Products.Five.browser.pagetemplatefile.ZopeTwoPageTemplateFile,
-to reduce barriers for testing renderability of views which use them.
+to reduce barriers for testing renderability of views which
+use them.
 (http://www.zope.org/Collectors/Zope/2327)
 
   - Collector #2304: fixed markup issue in ptEdit.zpt
@@ -1296,7 +1304,8 @@
x86_64 systems
 
  - ZReST: the charset used in the rendered HTML was not set to the
-   corresponding output_encoding property of the ZReST instance. In 
addition
+   corresponding output_encoding property of the ZReST instance. In
+addition
changing the encodings through the Properties tab did not re-render
the HTML.
 

Modified: Zope/trunk/lib/python/Zope2/Startup/handlers.py
===
--- Zope/trunk/lib/python/Zope2/Startup/handlers.py 2007-06-18 15:59:12 UTC 
(rev 76766)
+++ Zope/trunk/lib/python/Zope2/Startup/handlers.py 2007-06-18 16:04:25 UTC 
(rev 76767)
@@ -150,6 +150,14 @@
 def http_header_max_length(value):
 return value
 
+def enable_ms_author_via(value):
+import webdav
+webdav.enable_ms_author_via = value
+
+def enable_ms_public_header(value):
+import webdav
+webdav.enable_ms_public_header = value
+
 def catalog_getObject_raises(value):
 
 if value is not None:

Modified: Zope/trunk/lib/python/Zope2/Startup/tests/test_schema.py
===
--- Zope/trunk/lib/python/Zope2/Startup/tests/test_schema.py2007-06-18 
15:59:12 UTC (rev 76766)
+++ Zope/trunk/lib/python/Zope2/Startup/tests/test_schema.py2007-06-18 
16:04:25 UTC (rev 76767)
@@ -95,6 +95,50 @@
 items.sort()
 self.assertEqual(items, [(FEARFACTORY, rocks), (NSYNC,doesnt)])
 
+def test_ms_author_via(self):
+import webdav
+from Zope2.Startup.handlers import handleConfig
+
+default_setting = webdav.enable_ms_author_via
+try:
+conf, handler = self.load_config_text(\
+instancehome INSTANCE_HOME
+enable-ms-author-via true
+)
+handleConfig(None, handler)
+self.assert_(webdav.enable_ms_author_via == True)
+
+conf, handler = self.load_config_text(\
+instancehome INSTANCE_HOME
+enable-ms-author-via false
+)
+handleConfig(None, handler)
+self.assert_(webdav.enable_ms_author_via == False)
+finally:
+webdav.enable_ms_author_via = default_setting
+
+def test_ms_public_header(self):
+import webdav
+from Zope2.Startup.handlers import handleConfig
+
+default_setting = webdav.enable_ms_public_header
+try:
+

[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/zope/app/ - Fix broken externals

2008-10-07 Thread Sidnei da Silva
Log message for revision 91872:
   - Fix broken externals

Changed:
  _U  Zope/branches/gsoc-python-2.5/lib/python/zope/app/

-=-

Property changes on: Zope/branches/gsoc-python-2.5/lib/python/zope/app
___
Name: svn:externals
   - annotation   
svn://svn.zope.org/repos/main/zope.app.annotation/tags/3.4.0/src/zope/app/annotation
apidoc   
svn://svn.zope.org/repos/main/zope.app.apidoc/tags/3.4.3/src/zope/app/apidoc
applicationcontrol   
svn://svn.zope.org/repos/main/zope.app.applicationcontrol/tags/3.4.1/src/zope/app/applicationcontrol
appsetup 
svn://svn.zope.org/repos/main/zope.app.appsetup/tags/3.4.1/src/zope/app/appsetup
authentication   
svn://svn.zope.org/repos/main/zope.app.authentication/tags/3.4.1/src/zope/app/authentication
basicskin
svn://svn.zope.org/repos/main/zope.app.basicskin/tags/3.4.0/src/zope/app/basicskin
broken   
svn://svn.zope.org/repos/main/zope.app.broken/tags/3.4.0/src/zope/app/broken
cache
svn://svn.zope.org/repos/main/zope.app.cache/tags/3.4.0/src/zope/app/cache
component
svn://svn.zope.org/repos/main/zope.app.component/tags/3.4.1/src/zope/app/component
container
svn://svn.zope.org/repos/main/zope.app.container/tags/3.5.3/src/zope/app/container
content  
svn://svn.zope.org/repos/main/zope.app.content/tags/3.4.0/src/zope/app/content
debug
svn://svn.zope.org/repos/main/zope.app.debug/tags/3.4.0/src/zope/app/debug
dependable   
svn://svn.zope.org/repos/main/zope.app.dependable/tags/3.4.0/src/zope/app/dependable
error
svn://svn.zope.org/repos/main/zope.app.error/tags/3.5.1/src/zope/app/error
exception
svn://svn.zope.org/repos/main/zope.app.exception/tags/3.4.1/src/zope/app/exception
file 
svn://svn.zope.org/repos/main/zope.app.file/tags/3.4.2/src/zope/app/file
folder   
svn://svn.zope.org/repos/main/zope.app.folder/tags/3.4.0/src/zope/app/folder
folder   
svn://svn.zope.org/repos/main/zope.app.folder/tags/3.4.0/src/zope/app/folder
form 
svn://svn.zope.org/repos/main/zope.app.form/tags/3.4.1/src/zope/app/form
generations  
svn://svn.zope.org/repos/main/zope.app.generations/tags/3.4.1/src/zope/app/generations
http 
svn://svn.zope.org/repos/main/zope.app.http/tags/3.4.1/src/zope/app/http
i18n 
svn://svn.zope.org/repos/main/zope.app.i18n/tags/3.4.4/src/zope/app/i18n
interface
svn://svn.zope.org/repos/main/zope.app.interface/tags/3.4.0/src/zope/app/interface
intid
svn://svn.zope.org/repos/main/zope.app.intid/tags/3.4.1/src/zope/app/intid
keyreference 
svn://svn.zope.org/repos/main/zope.app.keyreference/tags/3.4.1/src/zope/app/keyreference
layers   
svn://svn.zope.org/repos/main/zope.app.layers/tags/3.4.0/src/zope/app/layers
locales  
svn://svn.zope.org/repos/main/zope.app.locales/tags/3.4.1/src/zope/app/locales
onlinehelp   
svn://svn.zope.org/repos/main/zope.app.onlinehelp/tags/3.4.1/src/zope/app/onlinehelp
pagetemplate 
svn://svn.zope.org/repos/main/zope.app.pagetemplate/tags/3.4.0/src/zope/app/pagetemplate
pluggableauth
svn://svn.zope.org/repos/main/zope.app.pluggableauth/tags/3.4.0/src/zope/app/pluggableauth
preference   
svn://svn.zope.org/repos/main/zope.app.preference/tags/3.4.1/src/zope/app/preference
preview  
svn://svn.zope.org/repos/main/zope.app.preview/tags/3.4.0/src/zope/app/preview
principalannotation  
svn://svn.zope.org/repos/main/zope.app.principalannotation/tags/3.4.0/src/zope/app/principalannotation
publication  
svn://svn.zope.org/repos/main/zope.app.publication/tags/3.4.3/src/zope/app/publication
publisher
svn://svn.zope.org/repos/main/zope.app.publisher/tags/3.4.1/src/zope/app/publisher
renderer 
svn://svn.zope.org/repos/main/zope.app.renderer/tags/3.4.0/src/zope/app/renderer
rotterdam
svn://svn.zope.org/repos/main/zope.app.rotterdam/tags/3.4.1/src/zope/app/rotterdam
schema   
svn://svn.zope.org/repos/main/zope.app.schema/tags/3.4.0/src/zope/app/schema
security 
svn://svn.zope.org/repos/main/zope.app.security/tags/3.4.0/src/zope/app/security
securitypolicy   
svn://svn.zope.org/repos/main/zope.app.securitypolicy/tags/3.4.6/src/zope/app/securitypolicy
session  
svn://svn.zope.org/repos/main/zope.app.session/tags/3.5.1/src/zope/app/session
skins
svn://svn.zope.org/repos/main/zope.app.skins/tags/3.4.0/src/zope/app/skins
sqlscript
svn://svn.zope.org/repos/main/zope.app.sqlscript/tags/3.4.1/src/zope/app/sqlscript
testing  
svn://svn.zope.org/repos/main/zope.app.testing/tags/3.4.1/src/zope/app/testing
traversing   
svn://svn.zope.org/repos/main/zope.app.traversing/tags/3.4.0/src/zope/app/traversing
tree 

[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/Zope2/Startup/warnfilter.py - Accept new-style classes as valid warning categories. Patch by

2008-10-07 Thread Sidnei da Silva
Log message for revision 91879:
  - Accept new-style classes as valid warning categories. Patch by
Ranjith Kannikara, GSoC student.
  
  

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/Zope2/Startup/warnfilter.py

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/Zope2/Startup/warnfilter.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/Zope2/Startup/warnfilter.py
2008-10-07 18:32:12 UTC (rev 91878)
+++ Zope/branches/gsoc-python-2.5/lib/python/Zope2/Startup/warnfilter.py
2008-10-07 19:25:16 UTC (rev 91879)
@@ -35,7 +35,7 @@
 cat = getattr(m, klass)
 except AttributeError:
 raise ValueError(unknown warning category: %s % `category`)
-if (not isinstance(cat, types.ClassType) or
+if (not isinstance(cat, (type, types.ClassType)) or
 not issubclass(cat, Warning)):
 raise ValueError(invalid warning category: %s % `category`)
 return cat

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/AccessControl/ImplC.py - Get rid of a relative import. Python 2.6 compatibility patch, by

2008-10-07 Thread Sidnei da Silva
Log message for revision 91890:
  - Get rid of a relative import. Python 2.6 compatibility patch, by
Ranjith Kannikara, GSoC student.
  
  

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/AccessControl/ImplC.py

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/AccessControl/ImplC.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/AccessControl/ImplC.py 
2008-10-08 00:58:49 UTC (rev 91889)
+++ Zope/branches/gsoc-python-2.5/lib/python/AccessControl/ImplC.py 
2008-10-08 01:14:02 UTC (rev 91890)
@@ -27,7 +27,8 @@
 del sys.modules[__name__]
 
 
-from ImplPython import RestrictedDTML, SecurityManager, ZopeSecurityPolicy
+from AccessControl.ImplPython import RestrictedDTML
+from AccessControl.ImplPython import SecurityManager, ZopeSecurityPolicy
 
 
 class RestrictedDTML(RestrictedDTMLMixin, RestrictedDTML):

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/Products/PythonScripts/tests/testPythonScript.py - This test fails with a TypeError on Python 2.6, so adjust accordingly.

2008-10-07 Thread Sidnei da Silva
Log message for revision 91891:
  - This test fails with a TypeError on Python 2.6, so adjust accordingly.
  
  

Changed:
  U   
Zope/branches/gsoc-python-2.5/lib/python/Products/PythonScripts/tests/testPythonScript.py

-=-
Modified: 
Zope/branches/gsoc-python-2.5/lib/python/Products/PythonScripts/tests/testPythonScript.py
===
--- 
Zope/branches/gsoc-python-2.5/lib/python/Products/PythonScripts/tests/testPythonScript.py
   2008-10-08 01:14:02 UTC (rev 91890)
+++ 
Zope/branches/gsoc-python-2.5/lib/python/Products/PythonScripts/tests/testPythonScript.py
   2008-10-08 03:53:21 UTC (rev 91891)
@@ -10,7 +10,7 @@
 # FOR A PARTICULAR PURPOSE
 #
 ##
-import os, unittest, warnings
+import os, sys, unittest, warnings
 
 from Products.PythonScripts.PythonScript import PythonScript
 from AccessControl.SecurityManagement import newSecurityManager
@@ -288,13 +288,19 @@
 f = self._filePS('class.__name__')
 self.assertEqual(f(), ('foo', 'string'))
 
-def test_filepath(self):
-# This test is meant to raise a deprecation warning.
-# It used to fail mysteriously instead.
-self._trap_warning_output()
-f = self._filePS('filepath')
-self.assertEqual(f(), [0])
-self._free_warning_output()
+if sys.version_info  (2, 6):
+def test_filepath(self):
+# This test is meant to raise a deprecation warning.
+# It used to fail mysteriously instead.
+self._trap_warning_output()
+f = self._filePS('filepath')
+self.assertEqual(f(), [0])
+self._free_warning_output()
+else:
+def test_filepath(self):
+# On Python 2.6, this now raises a TypeError.
+f = self._filePS('filepath')
+self.assertRaises(TypeError, f)
 
 class PythonScriptInterfaceConformanceTests(unittest.TestCase):
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/ - Some PEP-328 related changes. Need to make imports conditionally

2008-10-08 Thread Sidnei da Silva
Log message for revision 91894:
  - Some PEP-328 related changes. Need to make imports conditionally
relative using new syntax so that they work on Python 2.6.
  
  

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Return.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_String.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Var.py
  U   
Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DocumentTemplate.py
  U   
Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/cDocumentTemplate.c

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Return.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Return.py  
2008-10-08 05:02:37 UTC (rev 91893)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Return.py  
2008-10-08 06:43:00 UTC (rev 91894)
@@ -12,7 +12,11 @@
 ##
 __version__='$Revision: 1.9 $'[11:-2]
 
-from DT_Util import parse_params, name_param
+try:
+from DT_Util import parse_params, name_param
+except ImportError:
+# See PEP-328
+from .DT_Util import parse_params, name_param
 
 class ReturnTag:
 name='return'

Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_String.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_String.py  
2008-10-08 05:02:37 UTC (rev 91893)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_String.py  
2008-10-08 06:43:00 UTC (rev 91894)
@@ -16,9 +16,17 @@
 import thread
 import re
 
-from DT_Util import ParseError, InstanceDict, TemplateDict, render_blocks, str
-from DT_Var import Var, Call, Comment
-from DT_Return import ReturnTag, DTReturn
+try:
+from DT_Util import ParseError, InstanceDict
+from DT_Util import TemplateDict, render_blocks, str
+from DT_Var import Var, Call, Comment
+from DT_Return import ReturnTag, DTReturn
+except ImportError:
+# See PEP-328
+from .DT_Util import ParseError, InstanceDict
+from .DT_Util import TemplateDict, render_blocks, str
+from .DT_Var import Var, Call, Comment
+from .DT_Return import ReturnTag, DTReturn
 
 _marker = []  # Create a new marker object.
 

Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py
2008-10-08 05:02:37 UTC (rev 91893)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py
2008-10-08 06:43:00 UTC (rev 91894)
@@ -16,12 +16,25 @@
 
 import re
 
-from html_quote import html_quote, ustr # for import by other modules, dont 
remove!
+try:
+# for import by other modules, dont remove!
+from html_quote import html_quote, ustr
+
+from cDocumentTemplate import InstanceDict, TemplateDict
+from cDocumentTemplate import render_blocks, safe_callable
+from cDocumentTemplate import join_unicode
+except ImportError:
+# See PEP-328: 
+# for import by other modules, dont remove!
+from .html_quote import html_quote, ustr
+
+from .cDocumentTemplate import InstanceDict, TemplateDict
+from .cDocumentTemplate import render_blocks, safe_callable
+from .cDocumentTemplate import join_unicode
+
 from RestrictedPython.Guards import safe_builtins
 from RestrictedPython.Utilities import utility_builtins
 from RestrictedPython.Eval import RestrictionCapableEval
-from cDocumentTemplate import InstanceDict, TemplateDict, \
- render_blocks, safe_callable, join_unicode
 
 test = utility_builtins['test'] # for backwards compatibility, dont remove!
 

Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Var.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Var.py 
2008-10-08 05:02:37 UTC (rev 91893)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Var.py 
2008-10-08 06:43:00 UTC (rev 91894)
@@ -151,14 +151,22 @@
 
 
 ''' # '
+
 __rcs_id__='$Id$'
 __version__='$Revision: 1.60 $'[11:-2]
 
+import string, re, sys
 from cgi import escape
-import string, re,  sys
 from urllib import quote, quote_plus, unquote, unquote_plus
-from DT_Util import parse_params, name_param, str, ustr
-from html_quote import html_quote # for import by other modules, dont remove!
+
+try:
+# for import by other modules, dont remove!
+from html_quote import html_quote
+from DT_Util import parse_params, name_param, str, ustr
+except ImportError:
+from .html_quote import html_quote
+from .DT_Util import parse_params, name_param, str, ustr
+
 from Acquisition import 

[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/Zope2/App/ - Raising a string exception generates a TypeError on Python

2008-10-08 Thread Sidnei da Silva
Log message for revision 91896:
  - Raising a string exception generates a TypeError on Python
2.6. Adjust tests accordingly.
  
  

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/Zope2/App/startup.py
  U   
Zope/branches/gsoc-python-2.5/lib/python/Zope2/App/tests/testExceptionHook.py

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/Zope2/App/startup.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/Zope2/App/startup.py   
2008-10-08 06:50:37 UTC (rev 91895)
+++ Zope/branches/gsoc-python-2.5/lib/python/Zope2/App/startup.py   
2008-10-08 06:58:04 UTC (rev 91896)
@@ -207,8 +207,9 @@
 else:
 error_log_url = log.raising((t, v, traceback))
 
-if (getattr(REQUEST.get('RESPONSE', None), '_error_format', '')
-!='text/html'):
+if (REQUEST is None or 
+(getattr(REQUEST.get('RESPONSE', None), '_error_format', '')
+ != 'text/html')):
 raise t, v, traceback
 
 # Lookup a view for the exception and render it, then

Modified: 
Zope/branches/gsoc-python-2.5/lib/python/Zope2/App/tests/testExceptionHook.py
===
--- 
Zope/branches/gsoc-python-2.5/lib/python/Zope2/App/tests/testExceptionHook.py   
2008-10-08 06:50:37 UTC (rev 91895)
+++ 
Zope/branches/gsoc-python-2.5/lib/python/Zope2/App/tests/testExceptionHook.py   
2008-10-08 06:58:04 UTC (rev 91896)
@@ -118,12 +118,20 @@
 def testStringException1(self):
 def f():
 raise 'unauthorized', 'x'
-self.assertRaises('unauthorized', self.call, None, None, f)
+if sys.version_info  (2, 6):
+self.assertRaises('unauthorized', self.call, None, None, f)
+else:
+# Raising a string exception causes a TypeError on Python 2.6
+self.assertRaises(TypeError, self.call, None, None, f)
 
 def testStringException2(self):
 def f():
 raise 'redirect', 'x'
-self.assertRaises('redirect', self.call, None, None, f)
+if sys.version_info  (2, 6):
+self.assertRaises('redirect', self.call, None, None, f)
+else:
+# Raising a string exception causes a TypeError on Python 2.6
+self.assertRaises(TypeError, self.call, None, None, f)
 
 def testSystemExit(self):
 def f():

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/OFS/ - Avoid raising string exceptions. If one is found, upgrade it to InternalError and keep the original exception name as part of exc_v

2008-10-10 Thread Sidnei da Silva
Log message for revision 91977:
   - Avoid raising string exceptions. If one is found, upgrade it to 
InternalError and keep the original exception name as part of exc_value

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/OFS/CopySupport.py
  U   Zope/branches/gsoc-python-2.5/lib/python/OFS/SimpleItem.py
  U   Zope/branches/gsoc-python-2.5/lib/python/OFS/tests/testCopySupport.py

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/OFS/CopySupport.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/OFS/CopySupport.py 2008-10-10 
10:24:04 UTC (rev 91976)
+++ Zope/branches/gsoc-python-2.5/lib/python/OFS/CopySupport.py 2008-10-10 
14:36:38 UTC (rev 91977)
@@ -48,7 +48,7 @@
 from OFS.interfaces import ICopySource
 
 
-CopyError='Copy Error'
+class CopyError(Exception): pass
 
 copy_re = re.compile('^copy([0-9]*)_of_(.*)')
 

Modified: Zope/branches/gsoc-python-2.5/lib/python/OFS/SimpleItem.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/OFS/SimpleItem.py  2008-10-10 
10:24:04 UTC (rev 91976)
+++ Zope/branches/gsoc-python-2.5/lib/python/OFS/SimpleItem.py  2008-10-10 
14:36:38 UTC (rev 91977)
@@ -36,7 +36,7 @@
 from DocumentTemplate.ustr import ustr
 from ExtensionClass import Base
 from webdav.Resource import Resource
-from zExceptions import Redirect
+from zExceptions import Redirect, InternalError
 from zExceptions.ExceptionFormatter import format_exception
 from zope.interface import implements
 
@@ -181,16 +181,29 @@
 elif type(tb) is type('') and not error_tb:
 error_tb = tb
 
-# turn error_type into a string
-if hasattr(error_type, '__name__'):
-error_type=error_type.__name__
+# warn if error_type is a string
+error_name = 'Unknown'
+if isinstance(error_type, basestring):
+# String Exceptions are deprecated on Python 2.5 and
+# plain won't work at all on Python 2.6. So upgrade it
+# to an InternalError exception but keep the original
+# exception in the value.
+error_name = error_type
+error_type = InternalError
+error_value = (error_name, error_value)
+warnings.warn('String exceptions are deprecated starting '
+  'with Python 2.5 and will be removed in a '
+  'future release', DeprecationWarning)
+else:
+if hasattr(error_type, '__name__'):
+error_name = error_type.__name__
 
 if hasattr(self, '_v_eek'):
 # Stop if there is recursion.
 raise error_type, error_value, tb
 self._v_eek=1
 
-if str(error_type).lower() in ('redirect',):
+if error_name.lower() in ('redirect',):
 raise error_type, error_value, tb
 
 if not error_message:
@@ -216,7 +229,10 @@
 else:
 client = aq_parent(client)
 s=getattr(client, 'standard_error_message')
-kwargs = {'error_type': error_type,
+# For backward compatibility, we pass 'error_name' as
+# 'error_type' here as historically this has always
+# been a string.
+kwargs = {'error_type': error_name,
   'error_value': error_value,
   'error_tb': error_tb,
   'error_traceback': error_tb,

Modified: Zope/branches/gsoc-python-2.5/lib/python/OFS/tests/testCopySupport.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/OFS/tests/testCopySupport.py   
2008-10-10 10:24:04 UTC (rev 91976)
+++ Zope/branches/gsoc-python-2.5/lib/python/OFS/tests/testCopySupport.py   
2008-10-10 14:36:38 UTC (rev 91977)
@@ -347,7 +347,7 @@
 if ce_regex is not None:
 
 pattern = re.compile( ce_regex, re.DOTALL )
-if pattern.search( e ) is None:
+if pattern.search( e.args[0] ) is None:
 self.fail( Paste failed; didn't match pattern:\n%s % e )
 
 else:

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/ZServer/ - Temporary workaround for new asyncore in Python 2.6. Need to clean this up

2008-10-10 Thread Sidnei da Silva
Log message for revision 91981:
   - Temporary workaround for new asyncore in Python 2.6. Need to clean this up

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/ZServer/HTTPServer.py
  U   Zope/branches/gsoc-python-2.5/lib/python/ZServer/medusa/http_server.py

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/ZServer/HTTPServer.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/ZServer/HTTPServer.py  
2008-10-10 15:05:39 UTC (rev 91980)
+++ Zope/branches/gsoc-python-2.5/lib/python/ZServer/HTTPServer.py  
2008-10-10 15:05:44 UTC (rev 91981)
@@ -45,7 +45,8 @@
 from ZPublisher.HTTPRequest import HTTPRequest
 from App.config import getConfiguration
 
-from medusa.http_server import http_server,get_header, http_channel, 
VERSION_STRING
+from medusa.http_server import http_server, get_header
+from medusa.http_server import fifo, http_channel, VERSION_STRING
 import asyncore
 from medusa import counter, producers
 from medusa.test import  max_sockets
@@ -334,6 +335,10 @@
 
 def __init__(self, server, conn, addr):
 http_channel.__init__(self, server, conn, addr)
+if isinstance(self.producer_fifo, fifo):
+self.producer_fifo_push = self.producer_fifo.push
+else:
+self.producer_fifo_push = self.producer_fifo.append
 requestCloseOnExec(conn)
 self.queue=[]
 self.working=0
@@ -345,7 +350,7 @@
 # producers by default
 if self.closed:
 return
-self.producer_fifo.push(producer)
+self.producer_fifo_push(producer)
 if send: self.initiate_send()
 
 push_with_producer=push

Modified: Zope/branches/gsoc-python-2.5/lib/python/ZServer/medusa/http_server.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/ZServer/medusa/http_server.py  
2008-10-10 15:05:39 UTC (rev 91980)
+++ Zope/branches/gsoc-python-2.5/lib/python/ZServer/medusa/http_server.py  
2008-10-10 15:05:44 UTC (rev 91981)
@@ -528,25 +528,25 @@
 # no handlers, so complain
 r.error (404)
 
-def writable (self):
-# this is just the normal async_chat 'writable', here for 
comparison
-return self.ac_out_buffer or len(self.producer_fifo)
+#def writable (self):
+## this is just the normal async_chat 'writable', here for 
comparison
+#return self.ac_out_buffer or len(self.producer_fifo)
 
-def writable_for_proxy (self):
-# this version of writable supports the idea of a 'stalled' 
producer
-# [i.e., it's not ready to produce any output yet] This is needed 
by
-# the proxy, which will be waiting for the magic combination of
-# 1) hostname resolved
-# 2) connection made
-# 3) data available.
-if self.ac_out_buffer:
-return 1
-elif len(self.producer_fifo):
-p = self.producer_fifo.first()
-if hasattr (p, 'stalled'):
-return not p.stalled()
-else:
-return 1
+#def writable_for_proxy (self):
+## this version of writable supports the idea of a 'stalled' 
producer
+## [i.e., it's not ready to produce any output yet] This is needed 
by
+## the proxy, which will be waiting for the magic combination of
+## 1) hostname resolved
+## 2) connection made
+## 3) data available.
+#if self.ac_out_buffer:
+#return 1
+#elif len(self.producer_fifo):
+#p = self.producer_fifo.first()
+#if hasattr (p, 'stalled'):
+#return not p.stalled()
+#else:
+#return 1
 
 # 
===
 #   HTTP Server 
Object

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/ - Provide a helper function to upgrade a string exception to a real exception.

2008-10-10 Thread Sidnei da Silva
Log message for revision 91983:
   - Provide a helper function to upgrade a string exception to a real 
exception.

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Raise.py
  U   Zope/branches/gsoc-python-2.5/lib/python/OFS/SimpleItem.py
  U   Zope/branches/gsoc-python-2.5/lib/python/zExceptions/__init__.py

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Raise.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Raise.py   
2008-10-10 15:06:14 UTC (rev 91982)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Raise.py   
2008-10-10 15:06:23 UTC (rev 91983)
@@ -26,8 +26,12 @@
 __rcs_id__='$Id$'
 __version__='$Revision: 1.13 $'[11:-2]
 
+from zExceptions import upgradeException
 from DT_Util import parse_params, name_param, render_blocks, str
 
+class InvalidErrorTypeExpression(Exception):
+pass
+
 class Raise:
 blockContinuations=()
 name='raise'
@@ -44,15 +48,17 @@
 expr=self.expr
 if expr is None:
 t=self.__name__
-if t[-5:]=='Error' and __builtins__.has_key(t):
-t=__builtins__[t]
 else:
 try: t=expr.eval(md)
-except: t='Invalid Error Type Expression'
+except: t=InvalidErrorTypeExpression
 
 try: v=render_blocks(self.section,md)
 except: v='Invalid Error Value'
-
+
+# String Exceptions are deprecated on Python 2.5 and
+# plain won't work at all on Python 2.6. So try to upgrade it
+# to a real exception.
+t, v = upgradeException(t, v)
 raise t, v
 
 __call__=render

Modified: Zope/branches/gsoc-python-2.5/lib/python/OFS/SimpleItem.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/OFS/SimpleItem.py  2008-10-10 
15:06:14 UTC (rev 91982)
+++ Zope/branches/gsoc-python-2.5/lib/python/OFS/SimpleItem.py  2008-10-10 
15:06:23 UTC (rev 91983)
@@ -36,7 +36,7 @@
 from DocumentTemplate.ustr import ustr
 from ExtensionClass import Base
 from webdav.Resource import Resource
-from zExceptions import Redirect, InternalError
+from zExceptions import Redirect, upgradeException
 from zExceptions.ExceptionFormatter import format_exception
 from zope.interface import implements
 
@@ -185,15 +185,10 @@
 error_name = 'Unknown'
 if isinstance(error_type, basestring):
 # String Exceptions are deprecated on Python 2.5 and
-# plain won't work at all on Python 2.6. So upgrade it
-# to an InternalError exception but keep the original
-# exception in the value.
+# plain won't work at all on Python 2.6. So try to upgrade it
+# to a real exception.
 error_name = error_type
-error_type = InternalError
-error_value = (error_name, error_value)
-warnings.warn('String exceptions are deprecated starting '
-  'with Python 2.5 and will be removed in a '
-  'future release', DeprecationWarning)
+error_type, error_value = upgradeException(error_type, 
error_value)
 else:
 if hasattr(error_type, '__name__'):
 error_name = error_type.__name__

Modified: Zope/branches/gsoc-python-2.5/lib/python/zExceptions/__init__.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/zExceptions/__init__.py
2008-10-10 15:06:14 UTC (rev 91982)
+++ Zope/branches/gsoc-python-2.5/lib/python/zExceptions/__init__.py
2008-10-10 15:06:23 UTC (rev 91983)
@@ -18,12 +18,13 @@
 $Id$
 
 
-from unauthorized import Unauthorized
+import warnings
 
 from zope.interface import implements
 from zope.interface.common.interfaces import IException
 from zope.publisher.interfaces import INotFound
 from zope.security.interfaces import IForbidden
+from zExceptions.unauthorized import Unauthorized
 
 class BadRequest(Exception):
 implements(IException)
@@ -42,3 +43,29 @@
 
 class Redirect(Exception):
 pass
+
+def upgradeException(t, v):
+# If a string exception is found, convert it to an equivalent
+# exception defined either in builtins or zExceptions. If none of
+# that works, tehn convert it to an InternalError and keep the
+# original exception name as part of the exception value.
+import zExceptions
+
+if not isinstance(t, basestring):
+return t, v
+
+warnings.warn('String exceptions are deprecated starting '
+  'with Python 2.5 and will be removed in a '
+  'future release', DeprecationWarning)
+
+n = None
+if __builtins__.has_key(t):
+n = __builtins__[t]
+elif hasattr(zExceptions, t):
+n = getattr(zExceptions, t)
+  

[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/zExceptions/__init__.py - Use stacklevel=2 to show calling site

2008-10-10 Thread Sidnei da Silva
Log message for revision 91986:
   - Use stacklevel=2 to show calling site

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/zExceptions/__init__.py

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/zExceptions/__init__.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/zExceptions/__init__.py
2008-10-10 15:07:37 UTC (rev 91985)
+++ Zope/branches/gsoc-python-2.5/lib/python/zExceptions/__init__.py
2008-10-10 15:08:47 UTC (rev 91986)
@@ -56,7 +56,7 @@
 
 warnings.warn('String exceptions are deprecated starting '
   'with Python 2.5 and will be removed in a '
-  'future release', DeprecationWarning)
+  'future release', DeprecationWarning, stacklevel=2)
 
 n = None
 if __builtins__.has_key(t):

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/zope/app/ - Update some externals to trunk versions

2008-10-13 Thread Sidnei da Silva
Log message for revision 92148:
   - Update some externals to trunk versions

Changed:
  _U  Zope/branches/gsoc-python-2.5/lib/python/zope/app/

-=-

Property changes on: Zope/branches/gsoc-python-2.5/lib/python/zope/app
___
Name: svn:externals
   - annotation   
svn://svn.zope.org/repos/main/zope.app.annotation/tags/3.4.0/src/zope/app/annotation
apidoc   
svn://svn.zope.org/repos/main/zope.app.apidoc/tags/3.4.3/src/zope/app/apidoc
applicationcontrol   
svn://svn.zope.org/repos/main/zope.app.applicationcontrol/tags/3.4.1/src/zope/app/applicationcontrol
appsetup 
svn://svn.zope.org/repos/main/zope.app.appsetup/tags/3.4.1/src/zope/app/appsetup
authentication   
svn://svn.zope.org/repos/main/zope.app.authentication/tags/3.4.1/src/zope/app/authentication
basicskin
svn://svn.zope.org/repos/main/zope.app.basicskin/tags/3.4.0/src/zope/app/basicskin
broken   
svn://svn.zope.org/repos/main/zope.app.broken/tags/3.4.0/src/zope/app/broken
cache
svn://svn.zope.org/repos/main/zope.app.cache/tags/3.4.0/src/zope/app/cache
component
svn://svn.zope.org/repos/main/zope.app.component/branches/sidnei-back35-quick-hack/src/zope/app/component
container
svn://svn.zope.org/repos/main/zope.app.container/tags/3.5.3/src/zope/app/container
content  
svn://svn.zope.org/repos/main/zope.app.content/tags/3.4.0/src/zope/app/content
debug
svn://svn.zope.org/repos/main/zope.app.debug/tags/3.4.0/src/zope/app/debug
dependable   
svn://svn.zope.org/repos/main/zope.app.dependable/tags/3.4.0/src/zope/app/dependable
error
svn://svn.zope.org/repos/main/zope.app.error/tags/3.5.1/src/zope/app/error
exception
svn://svn.zope.org/repos/main/zope.app.exception/tags/3.4.1/src/zope/app/exception
file 
svn://svn.zope.org/repos/main/zope.app.file/tags/3.4.2/src/zope/app/file
folder   
svn://svn.zope.org/repos/main/zope.app.folder/tags/3.4.0/src/zope/app/folder
form 
svn://svn.zope.org/repos/main/zope.app.form/tags/3.4.1/src/zope/app/form
generations  
svn://svn.zope.org/repos/main/zope.app.generations/tags/3.4.1/src/zope/app/generations
http 
svn://svn.zope.org/repos/main/zope.app.http/tags/3.4.1/src/zope/app/http
i18n 
svn://svn.zope.org/repos/main/zope.app.i18n/tags/3.4.4/src/zope/app/i18n
interface
svn://svn.zope.org/repos/main/zope.app.interface/tags/3.4.0/src/zope/app/interface
intid
svn://svn.zope.org/repos/main/zope.app.intid/tags/3.4.1/src/zope/app/intid
keyreference 
svn://svn.zope.org/repos/main/zope.app.keyreference/tags/3.4.1/src/zope/app/keyreference
layers   
svn://svn.zope.org/repos/main/zope.app.layers/tags/3.4.0/src/zope/app/layers
locales  
svn://svn.zope.org/repos/main/zope.app.locales/tags/3.4.1/src/zope/app/locales
onlinehelp   
svn://svn.zope.org/repos/main/zope.app.onlinehelp/tags/3.4.1/src/zope/app/onlinehelp
pagetemplate 
svn://svn.zope.org/repos/main/zope.app.pagetemplate/tags/3.4.0/src/zope/app/pagetemplate
pluggableauth
svn://svn.zope.org/repos/main/zope.app.pluggableauth/tags/3.4.0/src/zope/app/pluggableauth
preference   
svn://svn.zope.org/repos/main/zope.app.preference/tags/3.4.1/src/zope/app/preference
preview  
svn://svn.zope.org/repos/main/zope.app.preview/tags/3.4.0/src/zope/app/preview
principalannotation  
svn://svn.zope.org/repos/main/zope.app.principalannotation/tags/3.4.0/src/zope/app/principalannotation
publication  
svn://svn.zope.org/repos/main/zope.app.publication/tags/3.4.3/src/zope/app/publication
publisher
svn://svn.zope.org/repos/main/zope.app.publisher/tags/3.4.1/src/zope/app/publisher
renderer 
svn://svn.zope.org/repos/main/zope.app.renderer/tags/3.4.0/src/zope/app/renderer
rotterdam
svn://svn.zope.org/repos/main/zope.app.rotterdam/tags/3.4.1/src/zope/app/rotterdam
schema   
svn://svn.zope.org/repos/main/zope.app.schema/tags/3.4.0/src/zope/app/schema
security 
svn://svn.zope.org/repos/main/zope.app.security/tags/3.4.0/src/zope/app/security
securitypolicy   
svn://svn.zope.org/repos/main/zope.app.securitypolicy/tags/3.4.6/src/zope/app/securitypolicy
session  
svn://svn.zope.org/repos/main/zope.app.session/tags/3.5.1/src/zope/app/session
skins
svn://svn.zope.org/repos/main/zope.app.skins/tags/3.4.0/src/zope/app/skins
sqlscript
svn://svn.zope.org/repos/main/zope.app.sqlscript/tags/3.4.1/src/zope/app/sqlscript
testing  
svn://svn.zope.org/repos/main/zope.app.testing/tags/3.4.1/src/zope/app/testing
traversing   
svn://svn.zope.org/repos/main/zope.app.traversing/tags/3.4.0/src/zope/app/traversing
tree 

[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/ - ZODB 3.8.1b9

2008-10-13 Thread Sidnei da Silva
Log message for revision 92172:
   - ZODB 3.8.1b9

Changed:
  _U  Zope/branches/gsoc-python-2.5/lib/python/

-=-

Property changes on: Zope/branches/gsoc-python-2.5/lib/python
___
Name: svn:externals
   - BTrees   
svn://svn.zope.org/repos/main/ZODB/tags/3.8.0/src/BTrees
ClientForm   svn://svn.zope.org/repos/main/Zope3/trunk/src/ClientForm
RestrictedPython 
svn://svn.zope.org/repos/main/RestrictedPython/trunk/src/RestrictedPython
ThreadedAsync
svn://svn.zope.org/repos/main/ZODB/tags/3.8.0/src/ThreadedAsync
ZConfig  svn://svn.zope.org/repos/main/ZConfig/tags/2.5.1/ZConfig
ZEO  svn://svn.zope.org/repos/main/ZODB/tags/3.8.0/src/ZEO
ZODB svn://svn.zope.org/repos/main/ZODB/tags/3.8.0/src/ZODB
ZopeUndo svn://svn.zope.org/repos/main/ZODB/tags/3.8.0/src/ZopeUndo
docutils svn://svn.zope.org/repos/main/docutils/tags/0.4.0
mechanizesvn://svn.zope.org/repos/main/Zope3/trunk/src/mechanize
persistent   
svn://svn.zope.org/repos/main/ZODB/tags/3.8.0/src/persistent
pytz svn://svn.zope.org/repos/main/Zope3/trunk/src/pytz
transaction  
svn://svn.zope.org/repos/main/ZODB/tags/3.8.0/src/transaction
zdaemon  
svn://svn.zope.org/repos/main/zdaemon/tags/2.0.2/src/zdaemon
zodbcode 
svn://svn.zope.org/repos/main/zodbcode/tags/3.4.0/src/zodbcode



   + BTrees   
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1b9/src/BTrees
ClientForm   svn://svn.zope.org/repos/main/Zope3/trunk/src/ClientForm
RestrictedPython 
svn://svn.zope.org/repos/main/RestrictedPython/trunk/src/RestrictedPython
ThreadedAsync
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1b9/src/ThreadedAsync
ZConfig  svn://svn.zope.org/repos/main/ZConfig/tags/2.5.1/ZConfig
ZEO  svn://svn.zope.org/repos/main/ZODB/tags/3.8.1b9/src/ZEO
ZODB svn://svn.zope.org/repos/main/ZODB/tags/3.8.1b9/src/ZODB
ZopeUndo 
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1b9/src/ZopeUndo
docutils svn://svn.zope.org/repos/main/docutils/tags/0.4.0
mechanizesvn://svn.zope.org/repos/main/Zope3/trunk/src/mechanize
persistent   
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1b9/src/persistent
pytz svn://svn.zope.org/repos/main/Zope3/trunk/src/pytz
transaction  
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1b9/src/transaction
zdaemon  
svn://svn.zope.org/repos/main/zdaemon/tags/2.0.2/src/zdaemon
zodbcode 
svn://svn.zope.org/repos/main/zodbcode/tags/3.4.0/src/zodbcode




___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/ - Convert another string exception to normal exception

2008-10-13 Thread Sidnei da Silva
Log message for revision 92176:
   - Convert another string exception to normal exception

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py
  U   Zope/branches/gsoc-python-2.5/lib/python/Shared/DC/ZRDB/sqlvar.py

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py
2008-10-13 21:07:59 UTC (rev 92175)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py
2008-10-13 21:31:16 UTC (rev 92176)
@@ -42,7 +42,9 @@
 
 str=__builtins__['str'] # Wa, w needed for pickling wa
 
-ParseError='Document Template Parse Error'
+class ParseError(Exception):
+Document Template Parse Error
+
 from zExceptions import Unauthorized as ValidationError
 
 def int_param(params,md,name,default=0, st=type('')):
@@ -248,37 +250,37 @@
 
 if v[:1]=='' and v[-1:]=='' and len(v)  1: # expr shorthand
 if used(attr):
-raise ParseError, ('%s and expr given' % attr, tag)
+raise ParseError('%s and expr given' % attr, tag)
 if expr:
 if used('expr'):
-raise ParseError, ('two exprs given', tag)
+raise ParseError('two exprs given', tag)
 v=v[1:-1]
 try: expr=Eval(v)
 except SyntaxError, v:
-raise ParseError, (
+raise ParseError(
 'strongExpression (Python) Syntax error/strong:'
 '\npre\n%s\n/pre\n' % v[0],
 tag)
 return v, expr
-else: raise ParseError, (
+else: raise ParseError(
 'The ... shorthand for expr was used in a tag '
 'that doesn\'t support expr attributes.',
 tag)
 
 else: # name shorthand
 if used(attr):
-raise ParseError, ('Two %s values were given' % attr, tag)
+raise ParseError('Two %s values were given' % attr, tag)
 if expr:
 if used('expr'):
 # raise 'Waa', 'waaa'
-raise ParseError, ('%s and expr given' % attr, tag)
+raise ParseError('%s and expr given' % attr, tag)
 return params[''],None
 return params['']
 
 elif used(attr):
 if expr:
 if used('expr'):
-raise ParseError, ('%s and expr given' % attr, tag)
+raise ParseError('%s and expr given' % attr, tag)
 return params[attr],None
 return params[attr]
 elif expr and used('expr'):
@@ -286,7 +288,7 @@
 expr=Eval(name)
 return name, expr
 
-raise ParseError, ('No %s given' % attr, tag)
+raise ParseError('No %s given' % attr, tag)
 
 Expr_doc=
 
@@ -399,11 +401,11 @@
 l=len(mo_unp.group(1))
 if result:
 if parms.has_key(name):
-if parms[name] is None: raise ParseError, (
+if parms[name] is None: raise ParseError(
 'Attribute %s requires a value' % name, tag)
 
 result[name]=parms[name]
-else: raise ParseError, (
+else: raise ParseError(
 'Invalid attribute name, %s' % name, tag)
 else:
 result['']=name
@@ -411,22 +413,22 @@
 elif mo_unq:
 name=mo_unq.group(2)
 l=len(mo_unq.group(1))
-if result: raise ParseError, (
+if result: raise ParseError(
 'Invalid attribute name, %s' % name, tag)
 else: result['']=name
 return parse_params(text[l:],result,**parms)
 else:
 if not text or not text.strip(): return result
-raise ParseError, ('invalid parameter: %s' % text, tag)
+raise ParseError('invalid parameter: %s' % text, tag)
 
 if not parms.has_key(name):
-raise ParseError, (
+raise ParseError(
 'Invalid attribute name, %s' % name, tag)
 
 if result.has_key(name):
 p=parms[name]
 if type(p) is not ListType or p:
-raise ParseError, (
+raise ParseError(
 'Duplicate values for attribute %s' % name, tag)
 
 result[name]=value

Modified: Zope/branches/gsoc-python-2.5/lib/python/Shared/DC/ZRDB/sqlvar.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/Shared/DC/ZRDB/sqlvar.py   
2008-10-13 21:07:59 UTC (rev 92175)
+++ Zope/branches/gsoc-python-2.5/lib/python/Shared/DC/ZRDB/sqlvar.py   
2008-10-13 21:31:16 UTC (rev 92176)
@@ -78,10 +78,10 @@
 
 self.args=args
 if not args.has_key('type'):
-raise ParseError, ('the type attribute is required', 'dtvar')
+raise 

[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/ - Cleanup DocumentTemplate module for relative imports

2008-10-13 Thread Sidnei da Silva
Log message for revision 92178:
   - Cleanup DocumentTemplate module for relative imports

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_HTML.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_If.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_In.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_InSV.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Let.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Raise.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Return.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_String.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Try.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_UI.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Var.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_With.py
  D   
Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DocumentTemplate.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/VSEval.py
  A   
Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/_DocumentTemplate.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/__init__.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/html_quote.py
  U   
Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/pDocumentTemplate.py
  U   Zope/branches/gsoc-python-2.5/lib/python/Shared/DC/ZRDB/sqlvar.py

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_HTML.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_HTML.py
2008-10-13 21:46:29 UTC (rev 92177)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_HTML.py
2008-10-13 21:50:06 UTC (rev 92178)
@@ -14,9 +14,9 @@
 
 $Id$
 
-from DT_String import String, FileMixin
-import DT_String, re
-from DT_Util import ParseError, str
+import re
+from DocumentTemplate.DT_String import String, FileMixin
+from DocumentTemplate.DT_Util import ParseError, str
 
 class dtml_re_class:
  This needs to be replaced before 2.4.  It's a hackaround. 
@@ -129,7 +129,7 @@
 def start(self, *args):
 return self._start
 
-class HTML(DT_String.String):
+class HTML(String):
 HTML Document Templates
 
 HTML Document templates use HTML server-side-include syntax,

Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_If.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_If.py  
2008-10-13 21:46:29 UTC (rev 92177)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_If.py  
2008-10-13 21:50:06 UTC (rev 92178)
@@ -78,7 +78,7 @@
 __rcs_id__='$Id$'
 __version__='$Revision: 1.19 $'[11:-2]
 
-from DT_Util import ParseError, parse_params, name_param, str
+from DocumentTemplate.DT_Util import ParseError, parse_params, name_param, str
 
 class If:
 blockContinuations='else','elif'

Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_In.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_In.py  
2008-10-13 21:46:29 UTC (rev 92177)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_In.py  
2008-10-13 21:50:06 UTC (rev 92178)
@@ -333,14 +333,18 @@
 __version__='$Revision: 1.62 $'[11:-2]
 
 import sys
-from DT_Util import ParseError, parse_params, name_param, str, join_unicode
-from DT_Util import render_blocks, InstanceDict, ValidationError, Eval
-from DT_Util import simple_name, add_with_prefix
 import re
-from DT_InSV import sequence_variables, opt
-TupleType=type(())
-StringTypes = (type(''), type(u''))
 
+from DocumentTemplate.DT_Util import ParseError, parse_params, name_param
+from DocumentTemplate.DT_Util import str, join_unicode
+from DocumentTemplate.DT_Util import render_blocks, InstanceDict
+from DocumentTemplate.DT_Util import ValidationError, Eval
+from DocumentTemplate.DT_Util import simple_name, add_with_prefix
+from DocumentTemplate.DT_InSV import sequence_variables, opt
+
+TupleType = tuple
+StringTypes = (str, unicode)
+
 class InFactory:
 blockContinuations=('else',)
 name='in'

Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_InSV.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_InSV.py
2008-10-13 21:46:29 UTC (rev 92177)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_InSV.py
2008-10-13 21:50:06 UTC (rev 92178)
@@ -18,12 +18,13 @@
 
 from math import sqrt
 import re
-TupleType=type(())
+
 try:
 import Missing
 mv=Missing.Value
 except: 

[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/zope/app/ - Update to newer zope.app.security

2008-10-13 Thread Sidnei da Silva
Log message for revision 92183:
   - Update to newer zope.app.security

Changed:
  _U  Zope/branches/gsoc-python-2.5/lib/python/zope/app/

-=-

Property changes on: Zope/branches/gsoc-python-2.5/lib/python/zope/app
___
Name: svn:externals
   - annotation   
svn://svn.zope.org/repos/main/zope.app.annotation/tags/3.4.0/src/zope/app/annotation
apidoc   
svn://svn.zope.org/repos/main/zope.app.apidoc/tags/3.4.3/src/zope/app/apidoc
applicationcontrol   
svn://svn.zope.org/repos/main/zope.app.applicationcontrol/tags/3.4.1/src/zope/app/applicationcontrol
appsetup 
svn://svn.zope.org/repos/main/zope.app.appsetup/tags/3.4.1/src/zope/app/appsetup
authentication   
svn://svn.zope.org/repos/main/zope.app.authentication/tags/3.4.1/src/zope/app/authentication
basicskin
svn://svn.zope.org/repos/main/zope.app.basicskin/tags/3.4.0/src/zope/app/basicskin
broken   
svn://svn.zope.org/repos/main/zope.app.broken/tags/3.4.0/src/zope/app/broken
cache
svn://svn.zope.org/repos/main/zope.app.cache/tags/3.4.0/src/zope/app/cache
component
svn://svn.zope.org/repos/main/zope.app.component/trunk/src/zope/app/component
container
svn://svn.zope.org/repos/main/zope.app.container/trunk/src/zope/app/container
content  
svn://svn.zope.org/repos/main/zope.app.content/tags/3.4.0/src/zope/app/content
debug
svn://svn.zope.org/repos/main/zope.app.debug/tags/3.4.0/src/zope/app/debug
dependable   
svn://svn.zope.org/repos/main/zope.app.dependable/tags/3.4.0/src/zope/app/dependable
error
svn://svn.zope.org/repos/main/zope.app.error/tags/3.5.1/src/zope/app/error
exception
svn://svn.zope.org/repos/main/zope.app.exception/tags/3.4.1/src/zope/app/exception
file 
svn://svn.zope.org/repos/main/zope.app.file/tags/3.4.2/src/zope/app/file
folder   
svn://svn.zope.org/repos/main/zope.app.folder/tags/3.4.0/src/zope/app/folder
form 
svn://svn.zope.org/repos/main/zope.app.form/trunk/src/zope/app/form
generations  
svn://svn.zope.org/repos/main/zope.app.generations/tags/3.4.1/src/zope/app/generations
http 
svn://svn.zope.org/repos/main/zope.app.http/tags/3.4.1/src/zope/app/http
i18n 
svn://svn.zope.org/repos/main/zope.app.i18n/tags/3.4.4/src/zope/app/i18n
interface
svn://svn.zope.org/repos/main/zope.app.interface/tags/3.4.0/src/zope/app/interface
intid
svn://svn.zope.org/repos/main/zope.app.intid/tags/3.4.1/src/zope/app/intid
keyreference 
svn://svn.zope.org/repos/main/zope.app.keyreference/tags/3.4.1/src/zope/app/keyreference
layers   
svn://svn.zope.org/repos/main/zope.app.layers/tags/3.4.0/src/zope/app/layers
locales  
svn://svn.zope.org/repos/main/zope.app.locales/tags/3.4.1/src/zope/app/locales
onlinehelp   
svn://svn.zope.org/repos/main/zope.app.onlinehelp/tags/3.4.1/src/zope/app/onlinehelp
pagetemplate 
svn://svn.zope.org/repos/main/zope.app.pagetemplate/tags/3.4.0/src/zope/app/pagetemplate
pluggableauth
svn://svn.zope.org/repos/main/zope.app.pluggableauth/tags/3.4.0/src/zope/app/pluggableauth
preference   
svn://svn.zope.org/repos/main/zope.app.preference/tags/3.4.1/src/zope/app/preference
preview  
svn://svn.zope.org/repos/main/zope.app.preview/tags/3.4.0/src/zope/app/preview
principalannotation  
svn://svn.zope.org/repos/main/zope.app.principalannotation/tags/3.4.0/src/zope/app/principalannotation
publication  
svn://svn.zope.org/repos/main/zope.app.publication/tags/3.4.3/src/zope/app/publication
publisher
svn://svn.zope.org/repos/main/zope.app.publisher/trunk/src/zope/app/publisher
renderer 
svn://svn.zope.org/repos/main/zope.app.renderer/tags/3.4.0/src/zope/app/renderer
rotterdam
svn://svn.zope.org/repos/main/zope.app.rotterdam/tags/3.4.1/src/zope/app/rotterdam
schema   
svn://svn.zope.org/repos/main/zope.app.schema/tags/3.4.0/src/zope/app/schema
security 
svn://svn.zope.org/repos/main/zope.app.security/tags/3.4.0/src/zope/app/security
securitypolicy   
svn://svn.zope.org/repos/main/zope.app.securitypolicy/tags/3.4.6/src/zope/app/securitypolicy
session  
svn://svn.zope.org/repos/main/zope.app.session/tags/3.5.1/src/zope/app/session
skins
svn://svn.zope.org/repos/main/zope.app.skins/tags/3.4.0/src/zope/app/skins
sqlscript
svn://svn.zope.org/repos/main/zope.app.sqlscript/tags/3.4.1/src/zope/app/sqlscript
testing  
svn://svn.zope.org/repos/main/zope.app.testing/tags/3.4.1/src/zope/app/testing
traversing   
svn://svn.zope.org/repos/main/zope.app.traversing/tags/3.4.0/src/zope/app/traversing
tree 
svn://svn.zope.org/repos/main/zope.app.tree/tags/3.4.0/src/zope/app/tree
undo 

[Zope-Checkins] SVN: Zope/trunk/lib/python/AccessControl/ - Launchpad #282677: fixed implementation of guarded_map and

2008-10-21 Thread Sidnei da Silva
Log message for revision 92436:
  - Launchpad #282677: fixed implementation of guarded_map and
provided tests and implementation for guarded_zip (RestrictedPython).
  
  

Changed:
  U   Zope/trunk/lib/python/AccessControl/ZopeGuards.py
  U   Zope/trunk/lib/python/AccessControl/tests/testZopeGuards.py

-=-
Modified: Zope/trunk/lib/python/AccessControl/ZopeGuards.py
===
--- Zope/trunk/lib/python/AccessControl/ZopeGuards.py   2008-10-21 17:07:58 UTC 
(rev 92435)
+++ Zope/trunk/lib/python/AccessControl/ZopeGuards.py   2008-10-21 17:30:18 UTC 
(rev 92436)
@@ -255,10 +255,18 @@
 safe_seqs = []
 for seqno in range(len(seqs)):
 seq = guarded_getitem(seqs, seqno)
-safe_seqs.append(seq)
+safe_seqs.append(guarded_iter(seq))
 return map(f, *safe_seqs)
 safe_builtins['map'] = guarded_map
 
+def guarded_zip(*seqs):
+safe_seqs = []
+for seqno in range(len(seqs)):
+seq = guarded_getitem(seqs, seqno)
+safe_seqs.append(guarded_iter(seq))
+return zip(*safe_seqs)
+safe_builtins['zip'] = guarded_zip
+
 def guarded_import(mname, globals=None, locals=None, fromlist=None):
 if fromlist is None:
 fromlist = ()

Modified: Zope/trunk/lib/python/AccessControl/tests/testZopeGuards.py
===
--- Zope/trunk/lib/python/AccessControl/tests/testZopeGuards.py 2008-10-21 
17:07:58 UTC (rev 92435)
+++ Zope/trunk/lib/python/AccessControl/tests/testZopeGuards.py 2008-10-21 
17:30:18 UTC (rev 92436)
@@ -19,6 +19,7 @@
 
 
 import os, sys
+import operator
 import unittest
 from zope.testing import doctest
 import ZODB
@@ -28,7 +29,7 @@
 from AccessControl.ZopeGuards \
 import guarded_getattr, get_dict_get, get_dict_pop, get_list_pop, \
 get_iter, guarded_min, guarded_max, safe_builtins, guarded_enumerate, \
-guarded_sum, guarded_apply
+guarded_sum, guarded_apply, guarded_map, guarded_zip
 
 try:
 __file__
@@ -236,6 +237,22 @@
 
 class TestBuiltinFunctionGuards(GuardTestCase):
 
+def test_zip_fails(self):
+sm = SecurityManager(1) # rejects
+old = self.setSecurityManager(sm)
+self.assertRaises(Unauthorized, guarded_zip, [1,2,3], [3,2,1])
+self.assertRaises(Unauthorized, guarded_zip, [1,2,3], [1])
+self.setSecurityManager(old)
+
+def test_map_fails(self):
+sm = SecurityManager(1) # rejects
+old = self.setSecurityManager(sm)
+self.assertRaises(Unauthorized, guarded_map, str, 
+  [1,2,3])
+self.assertRaises(Unauthorized, guarded_map, lambda x,y: x+y, 
+  [1,2,3], [3,2,1])
+self.setSecurityManager(old)
+
 def test_min_fails(self):
 sm = SecurityManager(1) # rejects
 old = self.setSecurityManager(sm)
@@ -263,6 +280,21 @@
 self.assertRaises(Unauthorized, guarded_sum, [1,2,3])
 self.setSecurityManager(old)
 
+def test_zip_succeeds(self):
+sm = SecurityManager() # accepts
+old = self.setSecurityManager(sm)
+self.assertEqual(guarded_zip([1,2,3], [3,2,1]), [(1,3),(2,2),(3,1)])
+self.assertEqual(guarded_zip([1,2,3], [1]), [(1,1)])
+self.setSecurityManager(old)
+
+def test_map_succeeds(self):
+sm = SecurityManager() # accepts
+old = self.setSecurityManager(sm)
+self.assertEqual(guarded_map(str, [1,2,3]), ['1','2','3'])
+self.assertEqual(guarded_map(lambda x,y: x+y, [1,2,3], [3,2,1]), 
+ [4,4,4])
+self.setSecurityManager(old)
+
 def test_min_succeeds(self):
 sm = SecurityManager() # accepts
 old = self.setSecurityManager(sm)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/AccessControl/ - Launchpad #282677: fixed implementation of guarded_map and

2008-10-21 Thread Sidnei da Silva
Log message for revision 92437:
  - Launchpad #282677: fixed implementation of guarded_map and
provided tests and implementation for guarded_zip (RestrictedPython).
  
  

Changed:
  U   Zope/branches/2.9/lib/python/AccessControl/ZopeGuards.py
  U   Zope/branches/2.9/lib/python/AccessControl/tests/testZopeGuards.py

-=-
Modified: Zope/branches/2.9/lib/python/AccessControl/ZopeGuards.py
===
--- Zope/branches/2.9/lib/python/AccessControl/ZopeGuards.py2008-10-21 
17:30:18 UTC (rev 92436)
+++ Zope/branches/2.9/lib/python/AccessControl/ZopeGuards.py2008-10-21 
17:35:43 UTC (rev 92437)
@@ -255,10 +255,18 @@
 safe_seqs = []
 for seqno in range(len(seqs)):
 seq = guarded_getitem(seqs, seqno)
-safe_seqs.append(seq)
+safe_seqs.append(guarded_iter(seq))
 return map(f, *safe_seqs)
 safe_builtins['map'] = guarded_map
 
+def guarded_zip(*seqs):
+safe_seqs = []
+for seqno in range(len(seqs)):
+seq = guarded_getitem(seqs, seqno)
+safe_seqs.append(guarded_iter(seq))
+return zip(*safe_seqs)
+safe_builtins['zip'] = guarded_zip
+
 def guarded_import(mname, globals=None, locals=None, fromlist=None):
 if fromlist is None:
 fromlist = ()

Modified: Zope/branches/2.9/lib/python/AccessControl/tests/testZopeGuards.py
===
--- Zope/branches/2.9/lib/python/AccessControl/tests/testZopeGuards.py  
2008-10-21 17:30:18 UTC (rev 92436)
+++ Zope/branches/2.9/lib/python/AccessControl/tests/testZopeGuards.py  
2008-10-21 17:35:43 UTC (rev 92437)
@@ -19,6 +19,7 @@
 
 
 import os, sys
+import operator
 import unittest
 from zope.testing import doctest
 import ZODB
@@ -28,7 +29,7 @@
 from AccessControl.ZopeGuards \
 import guarded_getattr, get_dict_get, get_dict_pop, get_list_pop, \
 get_iter, guarded_min, guarded_max, safe_builtins, guarded_enumerate, \
-guarded_sum, guarded_apply
+guarded_sum, guarded_apply, guarded_map, guarded_zip
 
 try:
 __file__
@@ -236,6 +237,22 @@
 
 class TestBuiltinFunctionGuards(GuardTestCase):
 
+def test_zip_fails(self):
+sm = SecurityManager(1) # rejects
+old = self.setSecurityManager(sm)
+self.assertRaises(Unauthorized, guarded_zip, [1,2,3], [3,2,1])
+self.assertRaises(Unauthorized, guarded_zip, [1,2,3], [1])
+self.setSecurityManager(old)
+
+def test_map_fails(self):
+sm = SecurityManager(1) # rejects
+old = self.setSecurityManager(sm)
+self.assertRaises(Unauthorized, guarded_map, str, 
+  [1,2,3])
+self.assertRaises(Unauthorized, guarded_map, lambda x,y: x+y, 
+  [1,2,3], [3,2,1])
+self.setSecurityManager(old)
+
 def test_min_fails(self):
 sm = SecurityManager(1) # rejects
 old = self.setSecurityManager(sm)
@@ -263,6 +280,21 @@
 self.assertRaises(Unauthorized, guarded_sum, [1,2,3])
 self.setSecurityManager(old)
 
+def test_zip_succeeds(self):
+sm = SecurityManager() # accepts
+old = self.setSecurityManager(sm)
+self.assertEqual(guarded_zip([1,2,3], [3,2,1]), [(1,3),(2,2),(3,1)])
+self.assertEqual(guarded_zip([1,2,3], [1]), [(1,1)])
+self.setSecurityManager(old)
+
+def test_map_succeeds(self):
+sm = SecurityManager() # accepts
+old = self.setSecurityManager(sm)
+self.assertEqual(guarded_map(str, [1,2,3]), ['1','2','3'])
+self.assertEqual(guarded_map(lambda x,y: x+y, [1,2,3], [3,2,1]), 
+ [4,4,4])
+self.setSecurityManager(old)
+
 def test_min_succeeds(self):
 sm = SecurityManager() # accepts
 old = self.setSecurityManager(sm)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.9/doc/CHANGES.txt - Record last checkin

2008-10-21 Thread Sidnei da Silva
Log message for revision 92438:
   - Record last checkin

Changed:
  U   Zope/branches/2.9/doc/CHANGES.txt

-=-
Modified: Zope/branches/2.9/doc/CHANGES.txt
===
--- Zope/branches/2.9/doc/CHANGES.txt   2008-10-21 17:35:43 UTC (rev 92437)
+++ Zope/branches/2.9/doc/CHANGES.txt   2008-10-21 17:37:30 UTC (rev 92438)
@@ -8,6 +8,10 @@
 
Bugs fixed
 
+  - Launchpad #282677: fixed implementation of guarded_map and
+provided tests and implementation for guarded_zip
+(RestrictedPython).
+
   - 'AccessControl.ZopeGuards.guarded_import' mapped some Unauthorized
 exceptions onto ImportErrors:  don't do that!  Also, removed
 mutable defaults from argument list, improved tests.

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.11/ - Launchpad #282677: fixed implementation of guarded_map and provided

2008-10-21 Thread Sidnei da Silva
Log message for revision 92440:
  - Launchpad #282677: fixed implementation of guarded_map and provided
tests and implementation for guarded_zip (RestrictedPython).
  
  

Changed:
  U   Zope/branches/2.11/doc/CHANGES.txt
  U   Zope/branches/2.11/lib/python/AccessControl/ZopeGuards.py
  U   Zope/branches/2.11/lib/python/AccessControl/tests/testZopeGuards.py

-=-
Modified: Zope/branches/2.11/doc/CHANGES.txt
===
--- Zope/branches/2.11/doc/CHANGES.txt  2008-10-21 17:38:54 UTC (rev 92439)
+++ Zope/branches/2.11/doc/CHANGES.txt  2008-10-21 17:40:10 UTC (rev 92440)
@@ -8,6 +8,9 @@
 
 Bugs Fixed
 
+  - Launchpad #282677: fixed implementation of guarded_map and
+provided tests and implementation for guarded_zip (RestrictedPython).
+
   - updated to ZODB 3.8.1
 
   - Lauchpad #143736,#271395: fixed AttributeError' on _ltid in TempStorage

Modified: Zope/branches/2.11/lib/python/AccessControl/ZopeGuards.py
===
--- Zope/branches/2.11/lib/python/AccessControl/ZopeGuards.py   2008-10-21 
17:38:54 UTC (rev 92439)
+++ Zope/branches/2.11/lib/python/AccessControl/ZopeGuards.py   2008-10-21 
17:40:10 UTC (rev 92440)
@@ -255,10 +255,18 @@
 safe_seqs = []
 for seqno in range(len(seqs)):
 seq = guarded_getitem(seqs, seqno)
-safe_seqs.append(seq)
+safe_seqs.append(guarded_iter(seq))
 return map(f, *safe_seqs)
 safe_builtins['map'] = guarded_map
 
+def guarded_zip(*seqs):
+safe_seqs = []
+for seqno in range(len(seqs)):
+seq = guarded_getitem(seqs, seqno)
+safe_seqs.append(guarded_iter(seq))
+return zip(*safe_seqs)
+safe_builtins['zip'] = guarded_zip
+
 def guarded_import(mname, globals=None, locals=None, fromlist=None):
 if fromlist is None:
 fromlist = ()

Modified: Zope/branches/2.11/lib/python/AccessControl/tests/testZopeGuards.py
===
--- Zope/branches/2.11/lib/python/AccessControl/tests/testZopeGuards.py 
2008-10-21 17:38:54 UTC (rev 92439)
+++ Zope/branches/2.11/lib/python/AccessControl/tests/testZopeGuards.py 
2008-10-21 17:40:10 UTC (rev 92440)
@@ -19,6 +19,7 @@
 
 
 import os, sys
+import operator
 import unittest
 from zope.testing import doctest
 import ZODB
@@ -28,7 +29,7 @@
 from AccessControl.ZopeGuards \
 import guarded_getattr, get_dict_get, get_dict_pop, get_list_pop, \
 get_iter, guarded_min, guarded_max, safe_builtins, guarded_enumerate, \
-guarded_sum, guarded_apply
+guarded_sum, guarded_apply, guarded_map, guarded_zip
 
 try:
 __file__
@@ -236,6 +237,22 @@
 
 class TestBuiltinFunctionGuards(GuardTestCase):
 
+def test_zip_fails(self):
+sm = SecurityManager(1) # rejects
+old = self.setSecurityManager(sm)
+self.assertRaises(Unauthorized, guarded_zip, [1,2,3], [3,2,1])
+self.assertRaises(Unauthorized, guarded_zip, [1,2,3], [1])
+self.setSecurityManager(old)
+
+def test_map_fails(self):
+sm = SecurityManager(1) # rejects
+old = self.setSecurityManager(sm)
+self.assertRaises(Unauthorized, guarded_map, str, 
+  [1,2,3])
+self.assertRaises(Unauthorized, guarded_map, lambda x,y: x+y, 
+  [1,2,3], [3,2,1])
+self.setSecurityManager(old)
+
 def test_min_fails(self):
 sm = SecurityManager(1) # rejects
 old = self.setSecurityManager(sm)
@@ -263,6 +280,21 @@
 self.assertRaises(Unauthorized, guarded_sum, [1,2,3])
 self.setSecurityManager(old)
 
+def test_zip_succeeds(self):
+sm = SecurityManager() # accepts
+old = self.setSecurityManager(sm)
+self.assertEqual(guarded_zip([1,2,3], [3,2,1]), [(1,3),(2,2),(3,1)])
+self.assertEqual(guarded_zip([1,2,3], [1]), [(1,1)])
+self.setSecurityManager(old)
+
+def test_map_succeeds(self):
+sm = SecurityManager() # accepts
+old = self.setSecurityManager(sm)
+self.assertEqual(guarded_map(str, [1,2,3]), ['1','2','3'])
+self.assertEqual(guarded_map(lambda x,y: x+y, [1,2,3], [3,2,1]), 
+ [4,4,4])
+self.setSecurityManager(old)
+
 def test_min_succeeds(self):
 sm = SecurityManager() # accepts
 old = self.setSecurityManager(sm)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.10/ - Launchpad #282677: fixed implementation of guarded_map and provided

2008-10-21 Thread Sidnei da Silva
Log message for revision 92439:
  - Launchpad #282677: fixed implementation of guarded_map and provided
tests and implementation for guarded_zip (RestrictedPython).
  
  

Changed:
  U   Zope/branches/2.10/doc/CHANGES.txt
  U   Zope/branches/2.10/lib/python/AccessControl/ZopeGuards.py
  U   Zope/branches/2.10/lib/python/AccessControl/tests/testZopeGuards.py

-=-
Modified: Zope/branches/2.10/doc/CHANGES.txt
===
--- Zope/branches/2.10/doc/CHANGES.txt  2008-10-21 17:37:30 UTC (rev 92438)
+++ Zope/branches/2.10/doc/CHANGES.txt  2008-10-21 17:38:54 UTC (rev 92439)
@@ -8,6 +8,10 @@
 
 Bugs fixed
 
+  - Launchpad #282677: fixed implementation of guarded_map and
+provided tests and implementation for guarded_zip
+(RestrictedPython).
+
   - Lauchpad #143736,#271395: fixed AttributeError' on _ltid in TempStorage
 
   - 'AccessControl.ZopeGuards.guarded_import' mapped some Unauthorized

Modified: Zope/branches/2.10/lib/python/AccessControl/ZopeGuards.py
===
--- Zope/branches/2.10/lib/python/AccessControl/ZopeGuards.py   2008-10-21 
17:37:30 UTC (rev 92438)
+++ Zope/branches/2.10/lib/python/AccessControl/ZopeGuards.py   2008-10-21 
17:38:54 UTC (rev 92439)
@@ -255,10 +255,18 @@
 safe_seqs = []
 for seqno in range(len(seqs)):
 seq = guarded_getitem(seqs, seqno)
-safe_seqs.append(seq)
+safe_seqs.append(guarded_iter(seq))
 return map(f, *safe_seqs)
 safe_builtins['map'] = guarded_map
 
+def guarded_zip(*seqs):
+safe_seqs = []
+for seqno in range(len(seqs)):
+seq = guarded_getitem(seqs, seqno)
+safe_seqs.append(guarded_iter(seq))
+return zip(*safe_seqs)
+safe_builtins['zip'] = guarded_zip
+
 def guarded_import(mname, globals=None, locals=None, fromlist=None):
 if fromlist is None:
 fromlist = ()

Modified: Zope/branches/2.10/lib/python/AccessControl/tests/testZopeGuards.py
===
--- Zope/branches/2.10/lib/python/AccessControl/tests/testZopeGuards.py 
2008-10-21 17:37:30 UTC (rev 92438)
+++ Zope/branches/2.10/lib/python/AccessControl/tests/testZopeGuards.py 
2008-10-21 17:38:54 UTC (rev 92439)
@@ -19,6 +19,7 @@
 
 
 import os, sys
+import operator
 import unittest
 from zope.testing import doctest
 import ZODB
@@ -28,7 +29,7 @@
 from AccessControl.ZopeGuards \
 import guarded_getattr, get_dict_get, get_dict_pop, get_list_pop, \
 get_iter, guarded_min, guarded_max, safe_builtins, guarded_enumerate, \
-guarded_sum, guarded_apply
+guarded_sum, guarded_apply, guarded_map, guarded_zip
 
 try:
 __file__
@@ -236,6 +237,22 @@
 
 class TestBuiltinFunctionGuards(GuardTestCase):
 
+def test_zip_fails(self):
+sm = SecurityManager(1) # rejects
+old = self.setSecurityManager(sm)
+self.assertRaises(Unauthorized, guarded_zip, [1,2,3], [3,2,1])
+self.assertRaises(Unauthorized, guarded_zip, [1,2,3], [1])
+self.setSecurityManager(old)
+
+def test_map_fails(self):
+sm = SecurityManager(1) # rejects
+old = self.setSecurityManager(sm)
+self.assertRaises(Unauthorized, guarded_map, str, 
+  [1,2,3])
+self.assertRaises(Unauthorized, guarded_map, lambda x,y: x+y, 
+  [1,2,3], [3,2,1])
+self.setSecurityManager(old)
+
 def test_min_fails(self):
 sm = SecurityManager(1) # rejects
 old = self.setSecurityManager(sm)
@@ -263,6 +280,21 @@
 self.assertRaises(Unauthorized, guarded_sum, [1,2,3])
 self.setSecurityManager(old)
 
+def test_zip_succeeds(self):
+sm = SecurityManager() # accepts
+old = self.setSecurityManager(sm)
+self.assertEqual(guarded_zip([1,2,3], [3,2,1]), [(1,3),(2,2),(3,1)])
+self.assertEqual(guarded_zip([1,2,3], [1]), [(1,1)])
+self.setSecurityManager(old)
+
+def test_map_succeeds(self):
+sm = SecurityManager() # accepts
+old = self.setSecurityManager(sm)
+self.assertEqual(guarded_map(str, [1,2,3]), ['1','2','3'])
+self.assertEqual(guarded_map(lambda x,y: x+y, [1,2,3], [3,2,1]), 
+ [4,4,4])
+self.setSecurityManager(old)
+
 def test_min_succeeds(self):
 sm = SecurityManager() # accepts
 old = self.setSecurityManager(sm)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/ - Launchpad #280334: Fixed problem with 'timeout'

2008-10-25 Thread Sidnei da Silva
Log message for revision 92571:
  - Launchpad #280334: Fixed problem with 'timeout'
argument/attribute missing in testbrowser tests.
  
  

Changed:
  U   Zope/branches/gsoc-python-2.5/doc/CHANGES.txt
  U   Zope/branches/gsoc-python-2.5/lib/python/Products/Five/testbrowser.py

-=-
Modified: Zope/branches/gsoc-python-2.5/doc/CHANGES.txt
===
--- Zope/branches/gsoc-python-2.5/doc/CHANGES.txt   2008-10-26 00:38:25 UTC 
(rev 92570)
+++ Zope/branches/gsoc-python-2.5/doc/CHANGES.txt   2008-10-26 05:14:47 UTC 
(rev 92571)
@@ -198,6 +198,9 @@
 
 Bugs Fixed
 
+  - Launchpad #280334: Fixed problem with 'timeout'
+argument/attribute missing in testbrowser tests.
+
   - Fixed against-the-rules zope.conf option 'fast_listen' to read
 'fast-listen' (dash, not underscore).
 

Modified: Zope/branches/gsoc-python-2.5/lib/python/Products/Five/testbrowser.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/Products/Five/testbrowser.py   
2008-10-26 00:38:25 UTC (rev 92570)
+++ Zope/branches/gsoc-python-2.5/lib/python/Products/Five/testbrowser.py   
2008-10-26 05:14:47 UTC (rev 92571)
@@ -18,6 +18,8 @@
 $Id$
 
 
+import sys
+import socket
 import urllib2
 
 import mechanize
@@ -29,7 +31,7 @@
 
 class PublisherConnection(testing.PublisherConnection):
 
-def __init__(self, host):
+def __init__(self, host, timeout=None):
 from Testing.ZopeTestCase.zopedoctest.functional import http
 self.caller = http
 self.host = host
@@ -76,6 +78,10 @@
 def http_open(self, req):
 Open an HTTP connection having a ``urllib2`` request.
 # Here we connect to the publisher.
+if sys.version_info  (2, 6) and not hasattr(req, 'timeout'):
+# Workaround mechanize incompatibility with Python
+# 2.6. See: LP #280334
+req.timeout = socket._GLOBAL_DEFAULT_TIMEOUT
 return self.do_open(PublisherConnection, req)
 
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/ - Switch to newer RestrictedPython

2008-10-25 Thread Sidnei da Silva
Log message for revision 92574:
   - Switch to newer RestrictedPython

Changed:
  _U  Zope/trunk/lib/python/

-=-

Property changes on: Zope/trunk/lib/python
___
Name: svn:externals
   - BTrees   
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/BTrees
ClientForm   svn://svn.zope.org/repos/main/Zope3/trunk/src/ClientForm
RestrictedPython 
svn://svn.zope.org/repos/main/RestrictedPython/tags/3.4.2/src/RestrictedPython
ThreadedAsync
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ThreadedAsync
ZConfig  svn://svn.zope.org/repos/main/ZConfig/tags/2.5.1/ZConfig
ZEO  svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ZEO
ZODB svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ZODB
ZopeUndo svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ZopeUndo
docutils svn://svn.zope.org/repos/main/docutils/tags/0.4.0
mechanizesvn://svn.zope.org/repos/main/Zope3/trunk/src/mechanize
persistent   
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/persistent
pytz svn://svn.zope.org/repos/main/Zope3/trunk/src/pytz
transaction  
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/transaction
zdaemon  
svn://svn.zope.org/repos/main/zdaemon/tags/2.0.2/src/zdaemon
zodbcode 
svn://svn.zope.org/repos/main/zodbcode/tags/3.4.0/src/zodbcode



   + BTrees   
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/BTrees
ClientForm   svn://svn.zope.org/repos/main/Zope3/trunk/src/ClientForm
RestrictedPython 
svn://svn.zope.org/repos/main/RestrictedPython/tags/3.4.3/src/RestrictedPython
ThreadedAsync
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ThreadedAsync
ZConfig  svn://svn.zope.org/repos/main/ZConfig/tags/2.5.1/ZConfig
ZEO  svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ZEO
ZODB svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ZODB
ZopeUndo svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ZopeUndo
docutils svn://svn.zope.org/repos/main/docutils/tags/0.4.0
mechanizesvn://svn.zope.org/repos/main/Zope3/trunk/src/mechanize
persistent   
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/persistent
pytz svn://svn.zope.org/repos/main/Zope3/trunk/src/pytz
transaction  
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/transaction
zdaemon  
svn://svn.zope.org/repos/main/zdaemon/tags/2.0.2/src/zdaemon
zodbcode 
svn://svn.zope.org/repos/main/zodbcode/tags/3.4.0/src/zodbcode


___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/zope/ - Bump version of zope.documenttemplate to 3.4.2

2008-10-25 Thread Sidnei da Silva
Log message for revision 92575:
   - Bump version of zope.documenttemplate to 3.4.2

Changed:
  _U  Zope/trunk/lib/python/zope/

-=-

Property changes on: Zope/trunk/lib/python/zope
___
Name: svn:externals
   - annotation   
svn://svn.zope.org/repos/main/zope.annotation/tags/3.4.0/src/zope/annotation
cachedescriptors 
svn://svn.zope.org/repos/main/zope.cachedescriptors/tags/3.4.0/src/zope/cachedescriptors
component
svn://svn.zope.org/repos/main/zope.component/tags/3.4.0/src/zope/component
configuration
svn://svn.zope.org/repos/main/zope.configuration/tags/3.4.0/src/zope/configuration
contentprovider  
svn://svn.zope.org/repos/main/zope.contentprovider/tags/3.4.0/src/zope/contentprovider
contenttype  
svn://svn.zope.org/repos/main/zope.contenttype/tags/3.4.0/src/zope/contenttype
copypastemove
svn://svn.zope.org/repos/main/zope.copypastemove/tags/3.4.0/src/zope/copypastemove
datetime 
svn://svn.zope.org/repos/main/zope.datetime/tags/3.4.0/src/zope/datetime
decorator
svn://svn.zope.org/repos/main/zope.decorator/tags/3.4.0/src/zope/decorator
deferredimport   
svn://svn.zope.org/repos/main/zope.deferredimport/tags/3.4.0/src/zope/deferredimport
deprecation  
svn://svn.zope.org/repos/main/zope.deprecation/tags/3.4.0/src/zope/deprecation
documenttemplate 
svn://svn.zope.org/repos/main/zope.documenttemplate/tags/3.4.0/src/zope/documenttemplate
dottedname   
svn://svn.zope.org/repos/main/zope.dottedname/tags/3.4.2/src/zope/dottedname
dublincore   
svn://svn.zope.org/repos/main/zope.dublincore/tags/3.4.0/src/zope/dublincore
error
svn://svn.zope.org/repos/main/zope.error/tags/3.5.1/src/zope/error
event
svn://svn.zope.org/repos/main/zope.event/tags/3.4.0/src/zope/event
exceptions   
svn://svn.zope.org/repos/main/zope.exceptions/tags/3.4.0/src/zope/exceptions
filerepresentation   
svn://svn.zope.org/repos/main/zope.filerepresentation/tags/3.4.0/src/zope/filerepresentation
formlib  
svn://svn.zope.org/repos/main/zope.formlib/tags/3.4.0/src/zope/formlib
hookable 
svn://svn.zope.org/repos/main/zope.hookable/tags/3.4.0/src/zope/hookable
i18nmessageid
svn://svn.zope.org/repos/main/zope.i18nmessageid/tags/3.4.3/src/zope/i18nmessageid
i18n 
svn://svn.zope.org/repos/main/zope.i18n/tags/3.4.0/src/zope/i18n
index
svn://svn.zope.org/repos/main/zope.index/tags/3.4.1/src/zope/index
interface
svn://svn.zope.org/repos/main/zope.interface/tags/3.4.1/src/zope/interface
lifecycleevent   
svn://svn.zope.org/repos/main/zope.lifecycleevent/tags/3.4.0/src/zope/lifecycleevent
location 
svn://svn.zope.org/repos/main/zope.location/tags/3.4.0/src/zope/location
minmax   
svn://svn.zope.org/repos/main/zope.minmax/tags/1.1.0/src/zope/minmax
modulealias  
svn://svn.zope.org/repos/main/zope.modulealias/tags/3.4.0/src/zope/modulealias
pagetemplate 
svn://svn.zope.org/repos/main/zope.pagetemplate/tags/3.4.0/src/zope/pagetemplate
proxy
svn://svn.zope.org/repos/main/zope.proxy/tags/3.4.0/src/zope/proxy
publisher
svn://svn.zope.org/repos/main/zope.publisher/tags/3.4.3/src/zope/publisher
rdb  
svn://svn.zope.org/repos/main/zope.rdb/tags/3.4.0/src/zope/rdb
schema   
svn://svn.zope.org/repos/main/zope.schema/tags/3.4.0/src/zope/schema
security 
svn://svn.zope.org/repos/main/zope.security/tags/3.4.0/src/zope/security
sequencesort 
svn://svn.zope.org/repos/main/zope.sequencesort/tags/3.4.0/src/zope/sequencesort
sendmail 
svn://svn.zope.org/repos/main/zope.sendmail/tags/3.5.0/src/zope/sendmail
server   
svn://svn.zope.org/repos/main/zope.server/tags/3.4.1/src/zope/server
session  
svn://svn.zope.org/repos/main/zope.session/tags/3.4.1/src/zope/session
size 
svn://svn.zope.org/repos/main/zope.size/tags/3.4.0/src/zope/size
securitypolicy   
svn://svn.zope.org/repos/main/zope.securitypolicy/tags/3.4.0/src/zope/securitypolicy
structuredtext   
svn://svn.zope.org/repos/main/zope.structuredtext/tags/3.4.0/src/zope/structuredtext
tales
svn://svn.zope.org/repos/main/zope.tales/tags/3.4.0/src/zope/tales
tal  
svn://svn.zope.org/repos/main/zope.tal/tags/3.4.1/src/zope/tal
testbrowser  
svn://svn.zope.org/repos/main/zope.testbrowser/tags/3.4.2-zope2/src/zope/testbrowser
testing  
svn://svn.zope.org/repos/main/zope.testing/tags/3.5.3/src/zope/testing
thread   
svn://svn.zope.org/repos/main/zope.thread/tags/3.4/src/zope/thread
traversing   
svn://svn.zope.org/repos/main/zope.traversing/tags/3.4.0/src/zope/traversing
viewlet  
svn://svn.zope.org/repos/main/zope.viewlet/tags/3.4.2/src/zope/viewlet
wfmc 

[Zope-Checkins] SVN: Zope/trunk/lib/python/zope/app/ - Bump versions of zope.app.component and zope.app.container

2008-10-25 Thread Sidnei da Silva
Log message for revision 92576:
   - Bump versions of zope.app.component and zope.app.container

Changed:
  _U  Zope/trunk/lib/python/zope/app/

-=-

Property changes on: Zope/trunk/lib/python/zope/app
___
Name: svn:externals
   - annotation   
svn://svn.zope.org/repos/main/zope.app.annotation/tags/3.4.0/src/zope/app/annotation
apidoc   
svn://svn.zope.org/repos/main/zope.app.apidoc/tags/3.4.3/src/zope/app/apidoc
applicationcontrol   
svn://svn.zope.org/repos/main/zope.app.applicationcontrol/tags/3.4.1/src/zope/app/applicationcontrol
appsetup 
svn://svn.zope.org/repos/main/zope.app.appsetup/tags/3.4.1/src/zope/app/appsetup
authentication   
svn://svn.zope.org/repos/main/zope.app.authentication/tags/3.4.1/src/zope/app/authentication
basicskin
svn://svn.zope.org/repos/main/zope.app.basicskin/tags/3.4.0/src/zope/app/basicskin
broken   
svn://svn.zope.org/repos/main/zope.app.broken/tags/3.4.0/src/zope/app/broken
cache
svn://svn.zope.org/repos/main/zope.app.cache/tags/3.4.0/src/zope/app/cache
component
svn://svn.zope.org/repos/main/zope.app.component/tags/3.4.1/src/zope/app/component
container
svn://svn.zope.org/repos/main/zope.app.container/tags/3.5.3/src/zope/app/container
content  
svn://svn.zope.org/repos/main/zope.app.content/tags/3.4.0/src/zope/app/content
debug
svn://svn.zope.org/repos/main/zope.app.debug/tags/3.4.0/src/zope/app/debug
dependable   
svn://svn.zope.org/repos/main/zope.app.dependable/tags/3.4.0/src/zope/app/dependable
error
svn://svn.zope.org/repos/main/zope.app.error/tags/3.5.1/src/zope/app/error
exception
svn://svn.zope.org/repos/main/zope.app.exception/tags/3.4.1/src/zope/app/exception
file 
svn://svn.zope.org/repos/main/zope.app.file/tags/3.4.2/src/zope/app/file
folder   
svn://svn.zope.org/repos/main/zope.app.folder/tags/3.4.0/src/zope/app/folder
form 
svn://svn.zope.org/repos/main/zope.app.form/tags/3.4.1/src/zope/app/form
generations  
svn://svn.zope.org/repos/main/zope.app.generations/tags/3.4.1/src/zope/app/generations
http 
svn://svn.zope.org/repos/main/zope.app.http/tags/3.4.1/src/zope/app/http
i18n 
svn://svn.zope.org/repos/main/zope.app.i18n/tags/3.4.4/src/zope/app/i18n
interface
svn://svn.zope.org/repos/main/zope.app.interface/tags/3.4.0/src/zope/app/interface
intid
svn://svn.zope.org/repos/main/zope.app.intid/tags/3.4.1/src/zope/app/intid
keyreference 
svn://svn.zope.org/repos/main/zope.app.keyreference/tags/3.4.1/src/zope/app/keyreference
layers   
svn://svn.zope.org/repos/main/zope.app.layers/tags/3.4.0/src/zope/app/layers
locales  
svn://svn.zope.org/repos/main/zope.app.locales/tags/3.4.1/src/zope/app/locales
onlinehelp   
svn://svn.zope.org/repos/main/zope.app.onlinehelp/tags/3.4.1/src/zope/app/onlinehelp
pagetemplate 
svn://svn.zope.org/repos/main/zope.app.pagetemplate/tags/3.4.0/src/zope/app/pagetemplate
pluggableauth
svn://svn.zope.org/repos/main/zope.app.pluggableauth/tags/3.4.0/src/zope/app/pluggableauth
preference   
svn://svn.zope.org/repos/main/zope.app.preference/tags/3.4.1/src/zope/app/preference
preview  
svn://svn.zope.org/repos/main/zope.app.preview/tags/3.4.0/src/zope/app/preview
principalannotation  
svn://svn.zope.org/repos/main/zope.app.principalannotation/tags/3.4.0/src/zope/app/principalannotation
publication  
svn://svn.zope.org/repos/main/zope.app.publication/tags/3.4.3/src/zope/app/publication
publisher
svn://svn.zope.org/repos/main/zope.app.publisher/tags/3.4.1/src/zope/app/publisher
renderer 
svn://svn.zope.org/repos/main/zope.app.renderer/tags/3.4.0/src/zope/app/renderer
rotterdam
svn://svn.zope.org/repos/main/zope.app.rotterdam/tags/3.4.1/src/zope/app/rotterdam
schema   
svn://svn.zope.org/repos/main/zope.app.schema/tags/3.4.0/src/zope/app/schema
security 
svn://svn.zope.org/repos/main/zope.app.security/tags/3.4.0/src/zope/app/security
securitypolicy   
svn://svn.zope.org/repos/main/zope.app.securitypolicy/tags/3.4.6/src/zope/app/securitypolicy
session  
svn://svn.zope.org/repos/main/zope.app.session/tags/3.5.1/src/zope/app/session
skins
svn://svn.zope.org/repos/main/zope.app.skins/tags/3.4.0/src/zope/app/skins
sqlscript
svn://svn.zope.org/repos/main/zope.app.sqlscript/tags/3.4.1/src/zope/app/sqlscript
testing  
svn://svn.zope.org/repos/main/zope.app.testing/tags/3.4.1/src/zope/app/testing
traversing   
svn://svn.zope.org/repos/main/zope.app.traversing/tags/3.4.0/src/zope/app/traversing
tree 
svn://svn.zope.org/repos/main/zope.app.tree/tags/3.4.0/src/zope/app/tree
undo 

[Zope-Checkins] SVN: Zope/trunk/lib/python/zope/app/ - Adjust externals to released versions

2008-10-26 Thread Sidnei da Silva
Log message for revision 92593:
   - Adjust externals to released versions

Changed:
  _U  Zope/trunk/lib/python/zope/app/

-=-

Property changes on: Zope/trunk/lib/python/zope/app
___
Name: svn:externals
   - annotation   
svn://svn.zope.org/repos/main/zope.app.annotation/tags/3.4.0/src/zope/app/annotation
apidoc   
svn://svn.zope.org/repos/main/zope.app.apidoc/tags/3.4.3/src/zope/app/apidoc
applicationcontrol   
svn://svn.zope.org/repos/main/zope.app.applicationcontrol/tags/3.4.1/src/zope/app/applicationcontrol
appsetup 
svn://svn.zope.org/repos/main/zope.app.appsetup/tags/3.4.1/src/zope/app/appsetup
authentication   
svn://svn.zope.org/repos/main/zope.app.authentication/tags/3.4.1/src/zope/app/authentication
basicskin
svn://svn.zope.org/repos/main/zope.app.basicskin/tags/3.4.0/src/zope/app/basicskin
broken   
svn://svn.zope.org/repos/main/zope.app.broken/tags/3.4.0/src/zope/app/broken
cache
svn://svn.zope.org/repos/main/zope.app.cache/tags/3.4.0/src/zope/app/cache
component
svn://svn.zope.org/repos/main/zope.app.component/tags/3.5.0/src/zope/app/component
container
svn://svn.zope.org/repos/main/zope.app.container/tags/3.6.2/src/zope/app/container
content  
svn://svn.zope.org/repos/main/zope.app.content/tags/3.4.0/src/zope/app/content
debug
svn://svn.zope.org/repos/main/zope.app.debug/tags/3.4.0/src/zope/app/debug
dependable   
svn://svn.zope.org/repos/main/zope.app.dependable/tags/3.4.0/src/zope/app/dependable
error
svn://svn.zope.org/repos/main/zope.app.error/tags/3.5.1/src/zope/app/error
exception
svn://svn.zope.org/repos/main/zope.app.exception/tags/3.4.1/src/zope/app/exception
file 
svn://svn.zope.org/repos/main/zope.app.file/tags/3.4.2/src/zope/app/file
folder   
svn://svn.zope.org/repos/main/zope.app.folder/tags/3.4.0/src/zope/app/folder
form 
svn://svn.zope.org/repos/main/zope.app.form/trunk/src/zope/app/form
generations  
svn://svn.zope.org/repos/main/zope.app.generations/tags/3.4.1/src/zope/app/generations
http 
svn://svn.zope.org/repos/main/zope.app.http/tags/3.4.1/src/zope/app/http
i18n 
svn://svn.zope.org/repos/main/zope.app.i18n/tags/3.4.4/src/zope/app/i18n
interface
svn://svn.zope.org/repos/main/zope.app.interface/tags/3.4.0/src/zope/app/interface
intid
svn://svn.zope.org/repos/main/zope.app.intid/tags/3.4.1/src/zope/app/intid
keyreference 
svn://svn.zope.org/repos/main/zope.app.keyreference/tags/3.4.1/src/zope/app/keyreference
layers   
svn://svn.zope.org/repos/main/zope.app.layers/tags/3.4.0/src/zope/app/layers
locales  
svn://svn.zope.org/repos/main/zope.app.locales/tags/3.4.1/src/zope/app/locales
onlinehelp   
svn://svn.zope.org/repos/main/zope.app.onlinehelp/tags/3.4.1/src/zope/app/onlinehelp
pagetemplate 
svn://svn.zope.org/repos/main/zope.app.pagetemplate/tags/3.4.0/src/zope/app/pagetemplate
pluggableauth
svn://svn.zope.org/repos/main/zope.app.pluggableauth/tags/3.4.0/src/zope/app/pluggableauth
preference   
svn://svn.zope.org/repos/main/zope.app.preference/tags/3.4.1/src/zope/app/preference
preview  
svn://svn.zope.org/repos/main/zope.app.preview/tags/3.4.0/src/zope/app/preview
principalannotation  
svn://svn.zope.org/repos/main/zope.app.principalannotation/tags/3.4.0/src/zope/app/principalannotation
publication  
svn://svn.zope.org/repos/main/zope.app.publication/tags/3.4.3/src/zope/app/publication
publisher
svn://svn.zope.org/repos/main/zope.app.publisher/trunk/src/zope/app/publisher
renderer 
svn://svn.zope.org/repos/main/zope.app.renderer/tags/3.4.0/src/zope/app/renderer
rotterdam
svn://svn.zope.org/repos/main/zope.app.rotterdam/tags/3.4.1/src/zope/app/rotterdam
schema   
svn://svn.zope.org/repos/main/zope.app.schema/tags/3.4.0/src/zope/app/schema
security 
svn://svn.zope.org/repos/main/zope.app.security/tags/3.5.2/src/zope/app/security
securitypolicy   
svn://svn.zope.org/repos/main/zope.app.securitypolicy/tags/3.4.6/src/zope/app/securitypolicy
session  
svn://svn.zope.org/repos/main/zope.app.session/tags/3.5.1/src/zope/app/session
skins
svn://svn.zope.org/repos/main/zope.app.skins/tags/3.4.0/src/zope/app/skins
sqlscript
svn://svn.zope.org/repos/main/zope.app.sqlscript/tags/3.4.1/src/zope/app/sqlscript
testing  
svn://svn.zope.org/repos/main/zope.app.testing/tags/3.4.1/src/zope/app/testing
traversing   
svn://svn.zope.org/repos/main/zope.app.traversing/tags/3.4.0/src/zope/app/traversing
tree 
svn://svn.zope.org/repos/main/zope.app.tree/tags/3.4.0/src/zope/app/tree
undo 

[Zope-Checkins] SVN: Zope/trunk/lib/python/zope/app/ - Got publisher and publication backwards

2008-10-26 Thread Sidnei da Silva
Log message for revision 92594:
   - Got publisher and publication backwards

Changed:
  _U  Zope/trunk/lib/python/zope/app/

-=-

Property changes on: Zope/trunk/lib/python/zope/app
___
Name: svn:externals
   - annotation   
svn://svn.zope.org/repos/main/zope.app.annotation/tags/3.4.0/src/zope/app/annotation
apidoc   
svn://svn.zope.org/repos/main/zope.app.apidoc/tags/3.4.3/src/zope/app/apidoc
applicationcontrol   
svn://svn.zope.org/repos/main/zope.app.applicationcontrol/tags/3.4.1/src/zope/app/applicationcontrol
appsetup 
svn://svn.zope.org/repos/main/zope.app.appsetup/tags/3.4.1/src/zope/app/appsetup
authentication   
svn://svn.zope.org/repos/main/zope.app.authentication/tags/3.4.1/src/zope/app/authentication
basicskin
svn://svn.zope.org/repos/main/zope.app.basicskin/tags/3.4.0/src/zope/app/basicskin
broken   
svn://svn.zope.org/repos/main/zope.app.broken/tags/3.4.0/src/zope/app/broken
cache
svn://svn.zope.org/repos/main/zope.app.cache/tags/3.4.0/src/zope/app/cache
component
svn://svn.zope.org/repos/main/zope.app.component/tags/3.5.0/src/zope/app/component
container
svn://svn.zope.org/repos/main/zope.app.container/tags/3.6.2/src/zope/app/container
content  
svn://svn.zope.org/repos/main/zope.app.content/tags/3.4.0/src/zope/app/content
debug
svn://svn.zope.org/repos/main/zope.app.debug/tags/3.4.0/src/zope/app/debug
dependable   
svn://svn.zope.org/repos/main/zope.app.dependable/tags/3.4.0/src/zope/app/dependable
error
svn://svn.zope.org/repos/main/zope.app.error/tags/3.5.1/src/zope/app/error
exception
svn://svn.zope.org/repos/main/zope.app.exception/tags/3.4.1/src/zope/app/exception
file 
svn://svn.zope.org/repos/main/zope.app.file/tags/3.4.2/src/zope/app/file
folder   
svn://svn.zope.org/repos/main/zope.app.folder/tags/3.4.0/src/zope/app/folder
form 
svn://svn.zope.org/repos/main/zope.app.form/tags/3.6.3/src/zope/app/form
generations  
svn://svn.zope.org/repos/main/zope.app.generations/tags/3.4.1/src/zope/app/generations
http 
svn://svn.zope.org/repos/main/zope.app.http/tags/3.4.1/src/zope/app/http
i18n 
svn://svn.zope.org/repos/main/zope.app.i18n/tags/3.4.4/src/zope/app/i18n
interface
svn://svn.zope.org/repos/main/zope.app.interface/tags/3.4.0/src/zope/app/interface
intid
svn://svn.zope.org/repos/main/zope.app.intid/tags/3.4.1/src/zope/app/intid
keyreference 
svn://svn.zope.org/repos/main/zope.app.keyreference/tags/3.4.1/src/zope/app/keyreference
layers   
svn://svn.zope.org/repos/main/zope.app.layers/tags/3.4.0/src/zope/app/layers
locales  
svn://svn.zope.org/repos/main/zope.app.locales/tags/3.4.1/src/zope/app/locales
onlinehelp   
svn://svn.zope.org/repos/main/zope.app.onlinehelp/tags/3.4.1/src/zope/app/onlinehelp
pagetemplate 
svn://svn.zope.org/repos/main/zope.app.pagetemplate/tags/3.4.0/src/zope/app/pagetemplate
pluggableauth
svn://svn.zope.org/repos/main/zope.app.pluggableauth/tags/3.4.0/src/zope/app/pluggableauth
preference   
svn://svn.zope.org/repos/main/zope.app.preference/tags/3.4.1/src/zope/app/preference
preview  
svn://svn.zope.org/repos/main/zope.app.preview/tags/3.4.0/src/zope/app/preview
principalannotation  
svn://svn.zope.org/repos/main/zope.app.principalannotation/tags/3.4.0/src/zope/app/principalannotation
publication  
svn://svn.zope.org/repos/main/zope.app.publication/tags/3.5.1/src/zope/app/publication
publisher
svn://svn.zope.org/repos/main/zope.app.publisher/trunk/src/zope/app/publisher
renderer 
svn://svn.zope.org/repos/main/zope.app.renderer/tags/3.4.0/src/zope/app/renderer
rotterdam
svn://svn.zope.org/repos/main/zope.app.rotterdam/tags/3.4.1/src/zope/app/rotterdam
schema   
svn://svn.zope.org/repos/main/zope.app.schema/tags/3.4.0/src/zope/app/schema
security 
svn://svn.zope.org/repos/main/zope.app.security/tags/3.5.2/src/zope/app/security
securitypolicy   
svn://svn.zope.org/repos/main/zope.app.securitypolicy/tags/3.4.6/src/zope/app/securitypolicy
session  
svn://svn.zope.org/repos/main/zope.app.session/tags/3.5.1/src/zope/app/session
skins
svn://svn.zope.org/repos/main/zope.app.skins/tags/3.4.0/src/zope/app/skins
sqlscript
svn://svn.zope.org/repos/main/zope.app.sqlscript/tags/3.4.1/src/zope/app/sqlscript
testing  
svn://svn.zope.org/repos/main/zope.app.testing/tags/3.5.6/src/zope/app/testing
traversing   
svn://svn.zope.org/repos/main/zope.app.traversing/tags/3.4.0/src/zope/app/traversing
tree 
svn://svn.zope.org/repos/main/zope.app.tree/tags/3.4.0/src/zope/app/tree
undo 

[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PythonScripts/patches.py - Since it's fixed after 2.4.5, no reason to apply the patch otherwise

2008-10-26 Thread Sidnei da Silva
Log message for revision 92595:
   - Since it's fixed after 2.4.5, no reason to apply the patch otherwise

Changed:
  U   Zope/trunk/lib/python/Products/PythonScripts/patches.py

-=-
Modified: Zope/trunk/lib/python/Products/PythonScripts/patches.py
===
--- Zope/trunk/lib/python/Products/PythonScripts/patches.py 2008-10-26 
14:31:48 UTC (rev 92594)
+++ Zope/trunk/lib/python/Products/PythonScripts/patches.py 2008-10-26 
15:02:32 UTC (rev 92595)
@@ -13,6 +13,8 @@
 # Written by Marc-Andre Lemburg ([EMAIL PROTECTED]).
 # (c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
 
+import sys
+
 def search_function(encoding):
 
 # Cache lookup
@@ -93,7 +95,7 @@
 # Return the registry entry
 return entry
 
+if sys.version_info = (2, 4, 5):
+import encodings
+encodings.search_function.func_code = search_function.func_code
 
-import encodings
-encodings.search_function.func_code = search_function.func_code
-

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/zope/ - Revert to an older zope.testing. New one is way too new

2008-10-26 Thread Sidnei da Silva
Log message for revision 92597:
   - Revert to an older zope.testing. New one is way too new

Changed:
  _U  Zope/trunk/lib/python/zope/

-=-

Property changes on: Zope/trunk/lib/python/zope
___
Name: svn:externals
   - annotation   
svn://svn.zope.org/repos/main/zope.annotation/tags/3.4.0/src/zope/annotation
cachedescriptors 
svn://svn.zope.org/repos/main/zope.cachedescriptors/tags/3.4.0/src/zope/cachedescriptors
component
svn://svn.zope.org/repos/main/zope.component/tags/3.4.0/src/zope/component
configuration
svn://svn.zope.org/repos/main/zope.configuration/tags/3.4.0/src/zope/configuration
contentprovider  
svn://svn.zope.org/repos/main/zope.contentprovider/tags/3.4.0/src/zope/contentprovider
contenttype  
svn://svn.zope.org/repos/main/zope.contenttype/tags/3.4.0/src/zope/contenttype
copypastemove
svn://svn.zope.org/repos/main/zope.copypastemove/tags/3.4.0/src/zope/copypastemove
datetime 
svn://svn.zope.org/repos/main/zope.datetime/tags/3.4.0/src/zope/datetime
decorator
svn://svn.zope.org/repos/main/zope.decorator/tags/3.4.0/src/zope/decorator
deferredimport   
svn://svn.zope.org/repos/main/zope.deferredimport/tags/3.4.0/src/zope/deferredimport
deprecation  
svn://svn.zope.org/repos/main/zope.deprecation/tags/3.4.0/src/zope/deprecation
documenttemplate 
svn://svn.zope.org/repos/main/zope.documenttemplate/tags/3.4.2/src/zope/documenttemplate
dottedname   
svn://svn.zope.org/repos/main/zope.dottedname/tags/3.4.2/src/zope/dottedname
dublincore   
svn://svn.zope.org/repos/main/zope.dublincore/tags/3.4.0/src/zope/dublincore
error
svn://svn.zope.org/repos/main/zope.error/tags/3.5.1/src/zope/error
event
svn://svn.zope.org/repos/main/zope.event/tags/3.4.0/src/zope/event
exceptions   
svn://svn.zope.org/repos/main/zope.exceptions/tags/3.4.0/src/zope/exceptions
filerepresentation   
svn://svn.zope.org/repos/main/zope.filerepresentation/tags/3.4.0/src/zope/filerepresentation
formlib  
svn://svn.zope.org/repos/main/zope.formlib/tags/3.4.0/src/zope/formlib
hookable 
svn://svn.zope.org/repos/main/zope.hookable/tags/3.4.0/src/zope/hookable
i18nmessageid
svn://svn.zope.org/repos/main/zope.i18nmessageid/tags/3.4.3/src/zope/i18nmessageid
i18n 
svn://svn.zope.org/repos/main/zope.i18n/tags/3.4.0/src/zope/i18n
index
svn://svn.zope.org/repos/main/zope.index/tags/3.4.1/src/zope/index
interface
svn://svn.zope.org/repos/main/zope.interface/tags/3.4.1/src/zope/interface
lifecycleevent   
svn://svn.zope.org/repos/main/zope.lifecycleevent/tags/3.4.0/src/zope/lifecycleevent
location 
svn://svn.zope.org/repos/main/zope.location/tags/3.4.0/src/zope/location
minmax   
svn://svn.zope.org/repos/main/zope.minmax/tags/1.1.0/src/zope/minmax
modulealias  
svn://svn.zope.org/repos/main/zope.modulealias/tags/3.4.0/src/zope/modulealias
pagetemplate 
svn://svn.zope.org/repos/main/zope.pagetemplate/tags/3.4.0/src/zope/pagetemplate
proxy
svn://svn.zope.org/repos/main/zope.proxy/tags/3.4.0/src/zope/proxy
publisher
svn://svn.zope.org/repos/main/zope.publisher/tags/3.4.3/src/zope/publisher
rdb  
svn://svn.zope.org/repos/main/zope.rdb/tags/3.4.0/src/zope/rdb
schema   
svn://svn.zope.org/repos/main/zope.schema/tags/3.4.0/src/zope/schema
security 
svn://svn.zope.org/repos/main/zope.security/tags/3.4.0/src/zope/security
sequencesort 
svn://svn.zope.org/repos/main/zope.sequencesort/tags/3.4.0/src/zope/sequencesort
sendmail 
svn://svn.zope.org/repos/main/zope.sendmail/tags/3.5.0/src/zope/sendmail
server   
svn://svn.zope.org/repos/main/zope.server/tags/3.4.1/src/zope/server
session  
svn://svn.zope.org/repos/main/zope.session/tags/3.4.1/src/zope/session
size 
svn://svn.zope.org/repos/main/zope.size/tags/3.4.0/src/zope/size
securitypolicy   
svn://svn.zope.org/repos/main/zope.securitypolicy/tags/3.4.0/src/zope/securitypolicy
structuredtext   
svn://svn.zope.org/repos/main/zope.structuredtext/tags/3.4.0/src/zope/structuredtext
tales
svn://svn.zope.org/repos/main/zope.tales/tags/3.4.0/src/zope/tales
tal  
svn://svn.zope.org/repos/main/zope.tal/tags/3.4.1/src/zope/tal
testbrowser  
svn://svn.zope.org/repos/main/zope.testbrowser/tags/3.4.2-zope2/src/zope/testbrowser
testing  
svn://svn.zope.org/repos/main/zope.testing/tags/3.5.3/src/zope/testing
thread   
svn://svn.zope.org/repos/main/zope.thread/tags/3.4/src/zope/thread
traversing   
svn://svn.zope.org/repos/main/zope.traversing/tags/3.4.0/src/zope/traversing
viewlet  
svn://svn.zope.org/repos/main/zope.viewlet/tags/3.4.2/src/zope/viewlet
wfmc 

[Zope-Checkins] SVN: Zope/trunk/lib/python/zope/app/ - Newer zope.app.appsetup

2008-10-26 Thread Sidnei da Silva
Log message for revision 92598:
   - Newer zope.app.appsetup

Changed:
  _U  Zope/trunk/lib/python/zope/app/

-=-

Property changes on: Zope/trunk/lib/python/zope/app
___
Name: svn:externals
   - annotation   
svn://svn.zope.org/repos/main/zope.app.annotation/tags/3.4.0/src/zope/app/annotation
apidoc   
svn://svn.zope.org/repos/main/zope.app.apidoc/tags/3.4.3/src/zope/app/apidoc
applicationcontrol   
svn://svn.zope.org/repos/main/zope.app.applicationcontrol/tags/3.4.1/src/zope/app/applicationcontrol
appsetup 
svn://svn.zope.org/repos/main/zope.app.appsetup/tags/3.4.1/src/zope/app/appsetup
authentication   
svn://svn.zope.org/repos/main/zope.app.authentication/tags/3.4.1/src/zope/app/authentication
basicskin
svn://svn.zope.org/repos/main/zope.app.basicskin/tags/3.4.0/src/zope/app/basicskin
broken   
svn://svn.zope.org/repos/main/zope.app.broken/tags/3.4.0/src/zope/app/broken
cache
svn://svn.zope.org/repos/main/zope.app.cache/tags/3.4.0/src/zope/app/cache
component
svn://svn.zope.org/repos/main/zope.app.component/tags/3.5.0/src/zope/app/component
container
svn://svn.zope.org/repos/main/zope.app.container/tags/3.6.2/src/zope/app/container
content  
svn://svn.zope.org/repos/main/zope.app.content/tags/3.4.0/src/zope/app/content
debug
svn://svn.zope.org/repos/main/zope.app.debug/tags/3.4.0/src/zope/app/debug
dependable   
svn://svn.zope.org/repos/main/zope.app.dependable/tags/3.4.0/src/zope/app/dependable
error
svn://svn.zope.org/repos/main/zope.app.error/tags/3.5.1/src/zope/app/error
exception
svn://svn.zope.org/repos/main/zope.app.exception/tags/3.4.1/src/zope/app/exception
file 
svn://svn.zope.org/repos/main/zope.app.file/tags/3.4.2/src/zope/app/file
folder   
svn://svn.zope.org/repos/main/zope.app.folder/tags/3.4.0/src/zope/app/folder
form 
svn://svn.zope.org/repos/main/zope.app.form/tags/3.6.3/src/zope/app/form
generations  
svn://svn.zope.org/repos/main/zope.app.generations/tags/3.4.1/src/zope/app/generations
http 
svn://svn.zope.org/repos/main/zope.app.http/tags/3.4.1/src/zope/app/http
i18n 
svn://svn.zope.org/repos/main/zope.app.i18n/tags/3.4.4/src/zope/app/i18n
interface
svn://svn.zope.org/repos/main/zope.app.interface/tags/3.4.0/src/zope/app/interface
intid
svn://svn.zope.org/repos/main/zope.app.intid/tags/3.4.1/src/zope/app/intid
keyreference 
svn://svn.zope.org/repos/main/zope.app.keyreference/tags/3.4.1/src/zope/app/keyreference
layers   
svn://svn.zope.org/repos/main/zope.app.layers/tags/3.4.0/src/zope/app/layers
locales  
svn://svn.zope.org/repos/main/zope.app.locales/tags/3.4.1/src/zope/app/locales
onlinehelp   
svn://svn.zope.org/repos/main/zope.app.onlinehelp/tags/3.4.1/src/zope/app/onlinehelp
pagetemplate 
svn://svn.zope.org/repos/main/zope.app.pagetemplate/tags/3.4.0/src/zope/app/pagetemplate
pluggableauth
svn://svn.zope.org/repos/main/zope.app.pluggableauth/tags/3.4.0/src/zope/app/pluggableauth
preference   
svn://svn.zope.org/repos/main/zope.app.preference/tags/3.4.1/src/zope/app/preference
preview  
svn://svn.zope.org/repos/main/zope.app.preview/tags/3.4.0/src/zope/app/preview
principalannotation  
svn://svn.zope.org/repos/main/zope.app.principalannotation/tags/3.4.0/src/zope/app/principalannotation
publication  
svn://svn.zope.org/repos/main/zope.app.publication/tags/3.5.0/src/zope/app/publication
publisher
svn://svn.zope.org/repos/main/zope.app.publisher/tags/3.5.1/src/zope/app/publisher
renderer 
svn://svn.zope.org/repos/main/zope.app.renderer/tags/3.4.0/src/zope/app/renderer
rotterdam
svn://svn.zope.org/repos/main/zope.app.rotterdam/tags/3.4.1/src/zope/app/rotterdam
schema   
svn://svn.zope.org/repos/main/zope.app.schema/tags/3.4.0/src/zope/app/schema
security 
svn://svn.zope.org/repos/main/zope.app.security/tags/3.5.2/src/zope/app/security
securitypolicy   
svn://svn.zope.org/repos/main/zope.app.securitypolicy/tags/3.4.6/src/zope/app/securitypolicy
session  
svn://svn.zope.org/repos/main/zope.app.session/tags/3.5.1/src/zope/app/session
skins
svn://svn.zope.org/repos/main/zope.app.skins/tags/3.4.0/src/zope/app/skins
sqlscript
svn://svn.zope.org/repos/main/zope.app.sqlscript/tags/3.4.1/src/zope/app/sqlscript
testing  
svn://svn.zope.org/repos/main/zope.app.testing/tags/3.5.6/src/zope/app/testing
traversing   
svn://svn.zope.org/repos/main/zope.app.traversing/tags/3.4.0/src/zope/app/traversing
tree 
svn://svn.zope.org/repos/main/zope.app.tree/tags/3.4.0/src/zope/app/tree
undo 

[Zope-Checkins] SVN: Zope/trunk/lib/python/ZServer/HTTPServer.py - Make it work with Python 2.4 too

2008-10-26 Thread Sidnei da Silva
Log message for revision 92607:
   - Make it work with Python 2.4 too

Changed:
  U   Zope/trunk/lib/python/ZServer/HTTPServer.py

-=-
Modified: Zope/trunk/lib/python/ZServer/HTTPServer.py
===
--- Zope/trunk/lib/python/ZServer/HTTPServer.py 2008-10-26 18:45:54 UTC (rev 
92606)
+++ Zope/trunk/lib/python/ZServer/HTTPServer.py 2008-10-26 20:41:03 UTC (rev 
92607)
@@ -45,9 +45,11 @@
 from ZPublisher.HTTPRequest import HTTPRequest
 from App.config import getConfiguration
 
+import asyncore
+import asynchat
+
 from medusa.http_server import http_server, get_header
 from medusa.http_server import fifo, http_channel, VERSION_STRING
-import asyncore
 from medusa import counter, producers
 from medusa.test import  max_sockets
 from medusa.default_handler import unquote
@@ -335,7 +337,7 @@
 
 def __init__(self, server, conn, addr):
 http_channel.__init__(self, server, conn, addr)
-if isinstance(self.producer_fifo, fifo):
+if isinstance(self.producer_fifo, (fifo, asynchat.fifo)):
 self.producer_fifo_push = self.producer_fifo.push
 self.producer_fifo_first = self.producer_fifo.first
 self.producer_fifo_pop = self.producer_fifo.pop
@@ -348,7 +350,7 @@
 del self.producer_fifo[0]
 self.producer_fifo_pop = pop
 requestCloseOnExec(conn)
-self.queue=[]
+self.queue = []
 self.working=0
 self.max_header_len = getConfiguration().http_header_max_length
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/ - Rather nasty fix to work around Zope 3 exceptions that have more than one positional argument on the constructor. Also, pass 'handle_errors' argument used

2008-11-03 Thread Sidnei da Silva
Log message for revision 92767:
   - Rather nasty fix to work around Zope 3 exceptions that have more than one 
positional argument on the constructor. Also, pass 'handle_errors' argument 
used for functional http testing around and use that on 
raise_standardErrorMessage to decide if we need to care about rendering a full 
HTML traceback.

Changed:
  U   Zope/trunk/lib/python/OFS/SimpleItem.py
  U   Zope/trunk/lib/python/ZPublisher/Publish.py
  U   Zope/trunk/lib/python/ZPublisher/Test.py
  U   Zope/trunk/lib/python/Zope2/App/startup.py

-=-
Modified: Zope/trunk/lib/python/OFS/SimpleItem.py
===
--- Zope/trunk/lib/python/OFS/SimpleItem.py 2008-11-03 19:31:35 UTC (rev 
92766)
+++ Zope/trunk/lib/python/OFS/SimpleItem.py 2008-11-04 00:30:26 UTC (rev 
92767)
@@ -20,6 +20,7 @@
 $Id$
 
 
+import inspect
 import warnings
 import marshal, re, sys, time
 
@@ -196,7 +197,7 @@
 if hasattr(self, '_v_eek'):
 # Stop if there is recursion.
 raise error_type, error_value, tb
-self._v_eek=1
+self._v_eek = 1
 
 if error_name.lower() in ('redirect',):
 raise error_type, error_value, tb
@@ -215,15 +216,31 @@
 
 if client is None:
 client = self
+
 if not REQUEST:
 REQUEST = aq_acquire(self, 'REQUEST')
 
+handle_errors = getattr(getattr(REQUEST, 'RESPONSE', None), 
+'handle_errors', False)
+# Can we re-raise the exception with a rendered-to-HTML
+# exception value? To be able to do so, the exception
+# constructor needs to be able to take more than two
+# arguments (some Zope 3 exceptions can't).
+ctor = getattr(getattr(error_type, '__init__', None), 'im_func', 
None)
+can_raise = (ctor is not None and inspect.isfunction(ctor) 
+ and len(inspect.getargspec(error_type.__init__)[0])  
2)
+
+if not (can_raise and handle_errors):
+# If we have been asked not to handle errors and we
+# can't re-raise a transformed exception don't even
+# bother with transforming the exception into
+# HTML. Just re-raise the original exception right
+# away.
+raise error_type, error_value, tb
+
 try:
-if hasattr(client, 'standard_error_message'):
-s=getattr(client, 'standard_error_message')
-else:
-client = aq_parent(client)
-s=getattr(client, 'standard_error_message')
+s = aq_acquire(client, 'standard_error_message')
+
 # For backward compatibility, we pass 'error_name' as
 # 'error_type' here as historically this has always
 # been a string.
@@ -234,7 +251,7 @@
   'error_message': error_message,
   'error_log_url': error_log_url}
 
-if getattr(aq_base(s),'isDocTemp',0):
+if getattr(aq_base(s), 'isDocTemp', 0):
 v = s(client, REQUEST, **kwargs)
 elif callable(s):
 v = s(**kwargs)
@@ -256,10 +273,16 @@
  event log for full details: %s))%(
 html_quote(sys.exc_info()[1]),
 ))
+
+if handle_errors:
+# If we've been asked to handle errors, just
+# return the rendered exception and let the
+# ZPublisher Exception Hook deal with it.
+return error_type, v, tb
 raise error_type, v, tb
 finally:
 if hasattr(self, '_v_eek'): del self._v_eek
-tb=None
+tb = None
 
 def manage(self, URL1):
 

Modified: Zope/trunk/lib/python/ZPublisher/Publish.py
===
--- Zope/trunk/lib/python/ZPublisher/Publish.py 2008-11-03 19:31:35 UTC (rev 
92766)
+++ Zope/trunk/lib/python/ZPublisher/Publish.py 2008-11-04 00:30:26 UTC (rev 
92767)
@@ -191,6 +191,8 @@
 else:
 stdout=response.stdout
 
+response.handle_errors = debug
+
 if request is None:
 request=Request(stdin, environ, response)
 

Modified: Zope/trunk/lib/python/ZPublisher/Test.py
===
--- Zope/trunk/lib/python/ZPublisher/Test.py2008-11-03 19:31:35 UTC (rev 
92766)
+++ Zope/trunk/lib/python/ZPublisher/Test.py2008-11-04 00:30:26 UTC (rev 
92767)
@@ -187,6 +187,9 @@
 response=Response(stdout=stdout, stderr=stderr)
 else:
 stdout=response.stdout
+
+response.handle_errors = debug
+
 if request is 

[Zope-Checkins] SVN: Zope/trunk/lib/python/ZPublisher/HTTPResponse.py - Fixed another check for new-style exceptions. Patch by David Glick from One/Northwest.

2008-11-03 Thread Sidnei da Silva
Log message for revision 92768:
   - Fixed another check for new-style exceptions. Patch by David Glick from 
One/Northwest.

Changed:
  U   Zope/trunk/lib/python/ZPublisher/HTTPResponse.py

-=-
Modified: Zope/trunk/lib/python/ZPublisher/HTTPResponse.py
===
--- Zope/trunk/lib/python/ZPublisher/HTTPResponse.py2008-11-04 00:30:26 UTC 
(rev 92767)
+++ Zope/trunk/lib/python/ZPublisher/HTTPResponse.py2008-11-04 02:07:11 UTC 
(rev 92768)
@@ -725,7 +725,7 @@
 t, v, tb = sys.exc_info()
 
 if t == 'Unauthorized' or t == Unauthorized or (
-isinstance(t, types.ClassType) and issubclass(t, Unauthorized)):
+isinstance(t, (type, types.ClassType)) and issubclass(t, 
Unauthorized)):
 t = 'Unauthorized'
 self._unauthorized()
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


Re: [Zope-Checkins] [Checkins] SVN: Zope/branches/2.11/lib/python/Zope2/App/ Backported DoomedTransaction handling from trunk r92792 to 2.11 branch

2008-11-05 Thread Sidnei da Silva
Hi Matthew,

I think you merged a little bit too much here. You picked the previous
revision of startup.py by accident.

On Wed, Nov 5, 2008 at 11:08 AM, Matthew Wilkes
[EMAIL PROTECTED] wrote:
 Log message for revision 92793:
  Backported DoomedTransaction handling from trunk r92792 to 2.11 branch

 Changed:
  U   Zope/branches/2.11/lib/python/Zope2/App/startup.py
  A   Zope/branches/2.11/lib/python/Zope2/App/tests/testDoomedTransaction.py

 -=-
 Modified: Zope/branches/2.11/lib/python/Zope2/App/startup.py
 ===
 --- Zope/branches/2.11/lib/python/Zope2/App/startup.py  2008-11-05 12:41:21 
 UTC (rev 92792)
 +++ Zope/branches/2.11/lib/python/Zope2/App/startup.py  2008-11-05 13:08:33 
 UTC (rev 92793)
 @@ -249,7 +249,15 @@
 REQUEST['AUTHENTICATED_USER'] = AccessControl.User.nobody

 try:
 -f(client, REQUEST, t, v, traceback, 
 error_log_url=error_log_url)
 +result = f(client, REQUEST, t, v,
 +   traceback,
 +   error_log_url=error_log_url)
 +if result is not None:
 +t, v, traceback = result
 +response = REQUEST.RESPONSE
 +response.setStatus(t)
 +response.setBody(v)
 +return response
 except TypeError:
 # Pre 2.6 call signature
 f(client, REQUEST, t, v, traceback)
 @@ -267,7 +275,10 @@
 transaction.begin()

 def commit(self):
 -transaction.commit()
 +if hasattr(transaction, 'isDoomed') and transaction.isDoomed():
 +transaction.abort()
 +else:
 +transaction.commit()

 def abort(self):
 transaction.abort()

 Copied: 
 Zope/branches/2.11/lib/python/Zope2/App/tests/testDoomedTransaction.py (from 
 rev 92792, Zope/trunk/lib/python/Zope2/App/tests/testDoomedTransaction.py)
 ===
 --- Zope/branches/2.11/lib/python/Zope2/App/tests/testDoomedTransaction.py
   (rev 0)
 +++ Zope/branches/2.11/lib/python/Zope2/App/tests/testDoomedTransaction.py
   2008-11-05 13:08:33 UTC (rev 92793)
 @@ -0,0 +1,43 @@
 +##
 +#
 +# Copyright (c) 2007 Zope Corporation and Contributors.
 +# All Rights Reserved.
 +#
 +# This software is subject to the provisions of the Zope Public License,
 +# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
 +# THIS SOFTWARE IS PROVIDED AS IS AND ANY AND ALL EXPRESS OR IMPLIED
 +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 +# FOR A PARTICULAR PURPOSE.
 +#
 +##
 +
 +import sys
 +import unittest
 +import logging
 +import transaction
 +
 +class DoomedTransactionInManagerTest(unittest.TestCase):
 +
 +def testDoomedFails(self):
 +transaction.begin()
 +trans = transaction.get()
 +trans.doom()
 +from transaction.interfaces import DoomedTransaction
 +self.assertRaises(DoomedTransaction, trans.commit)
 +
 +def testDoomedSilentInTM(self):
 +from Zope2.App.startup import TransactionsManager
 +tm = TransactionsManager()
 +transaction.begin()
 +trans = transaction.get()
 +trans.doom()
 +tm.commit()
 +
 +def test_suite():
 +suite = unittest.TestSuite()
 +suite.addTest(unittest.makeSuite(DoomedTransactionInManagerTest))
 +return suite
 +
 +if __name__ == '__main__':
 +unittest.main(defaultTest='test_suite')

 ___
 Checkins mailing list
 [EMAIL PROTECTED]
 http://mail.zope.org/mailman/listinfo/checkins




-- 
Sidnei da Silva
Enfold Systems
http://enfoldsystems.com
Fax +1 832 201 8856
Office +1 713 942 2377 Ext 214
Skype zopedc
___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/utilities/mkzopeinstance.py - Revert to sha1. Andreas said he added SHA256 to AuthEncoding but I can't find it.

2008-11-14 Thread Sidnei da Silva
Log message for revision 92941:
   - Revert to sha1. Andreas said he added SHA256 to AuthEncoding but I can't 
find it.

Changed:
  U   Zope/trunk/utilities/mkzopeinstance.py

-=-
Modified: Zope/trunk/utilities/mkzopeinstance.py
===
--- Zope/trunk/utilities/mkzopeinstance.py  2008-11-14 19:12:22 UTC (rev 
92940)
+++ Zope/trunk/utilities/mkzopeinstance.py  2008-11-14 20:26:21 UTC (rev 
92941)
@@ -168,12 +168,12 @@
 def write_inituser(fn, user, password):
 import binascii
 try:
-from hashlib import sha256 as sha
+from hashlib import sha1 as sha
 except:
 from sha import new as sha
 fp = open(fn, w)
 pw = binascii.b2a_base64(sha(password).digest())[:-1]
-fp.write('%s:{SHA256}%s\n' % (user, pw))
+fp.write('%s:{SHA}%s\n' % (user, pw))
 fp.close()
 os.chmod(fn, 0644)
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/src/OFS/SimpleItem.py - In Python 2.4, it's a ``builtin method``, not a ``wrapper slot``. Yuck.

2009-05-07 Thread Sidnei da Silva
Log message for revision 99806:
  - In Python 2.4, it's a ``builtin method``, not a ``wrapper slot``. Yuck.
  
  

Changed:
  U   Zope/trunk/src/OFS/SimpleItem.py

-=-
Modified: Zope/trunk/src/OFS/SimpleItem.py
===
--- Zope/trunk/src/OFS/SimpleItem.py2009-05-07 23:18:39 UTC (rev 99805)
+++ Zope/trunk/src/OFS/SimpleItem.py2009-05-07 23:56:53 UTC (rev 99806)
@@ -243,6 +243,7 @@
 # exception value? To be able to do so, the exception
 # constructor needs to be able to take more than two
 # arguments (some Zope 3 exceptions can't).
+can_raise = False
 ctor = getattr(error_type, '__init__', None)
 if inspect.ismethoddescriptor(ctor):
 # If it's a method descriptor, it means we've got a
@@ -252,9 +253,14 @@
 else:
 if inspect.ismethod(ctor):
 ctor = getattr(ctor, 'im_func', None)
-can_raise = (
-ctor is not None and inspect.isfunction(ctor)
-and len(inspect.getargspec(error_type.__init__)[0])  2)
+if inspect.isbuiltin(ctor):
+# In Python 2.4, the ``__init__`` method of the
+# base ``Exception`` class is a ``builtin
+# method``.
+can_raise = True
+elif ctor is not None and inspect.isfunction(ctor):
+can_raise = (
+len(inspect.getargspec(error_type.__init__)[0])  2)
 
 if not (can_raise and handle_errors):
 # If we have been asked not to handle errors and we

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/ - RESPONSE.handle_errors was wrongly set (to debug, should have been

2009-05-08 Thread Sidnei da Silva
Log message for revision 99805:
  - RESPONSE.handle_errors was wrongly set (to debug, should have been
``not debug``). Also, the check for exception constructor arguments
didn't account for exceptions that didn't override the ``__init__``
(which are most of them). The combination of those two problems
caused the ``standard_error_message`` not to be called. Fixes
https://bugs.edge.launchpad.net/zope2/+bug/372632 .
  
  

Changed:
  U   Zope/trunk/doc/CHANGES.rst
  U   Zope/trunk/src/OFS/SimpleItem.py
  U   Zope/trunk/src/OFS/tests/testSimpleItem.py
  U   Zope/trunk/src/ZPublisher/Publish.py
  U   Zope/trunk/src/ZPublisher/Test.py

-=-
Modified: Zope/trunk/doc/CHANGES.rst
===
--- Zope/trunk/doc/CHANGES.rst  2009-05-07 19:07:21 UTC (rev 99804)
+++ Zope/trunk/doc/CHANGES.rst  2009-05-07 23:18:39 UTC (rev 99805)
@@ -36,6 +36,13 @@
 Bugs Fixed
 ++
 
+- RESPONSE.handle_errors was wrongly set (to debug, should have been
+  ``not debug``). Also, the check for exception constructor arguments
+  didn't account for exceptions that didn't override the ``__init__``
+  (which are most of them). The combination of those two problems
+  caused the ``standard_error_message`` not to be called. Fixes
+  https://bugs.edge.launchpad.net/zope2/+bug/372632 .
+
 - DocumentTemplate.DT_Raise:  use new 'zExceptions.convertExceptionType'
   API to allow raising non-builtin exceptions.
   Fixes https://bugs.launchpad.net/zope2/+bug/372629 , which prevented
@@ -50,7 +57,7 @@
 Bugs Fixed
 ++
 
-- fixed versions.cfg in order to support zope.z2release for 
+- fixed versions.cfg in order to support zope.z2release for
   creating a proper index structure
 
 2.12.0a3 (2009-04-19)

Modified: Zope/trunk/src/OFS/SimpleItem.py
===
--- Zope/trunk/src/OFS/SimpleItem.py2009-05-07 19:07:21 UTC (rev 99804)
+++ Zope/trunk/src/OFS/SimpleItem.py2009-05-07 23:18:39 UTC (rev 99805)
@@ -237,15 +237,24 @@
 if not REQUEST:
 REQUEST = aq_acquire(self, 'REQUEST')
 
-handle_errors = getattr(getattr(REQUEST, 'RESPONSE', None), 
+handle_errors = getattr(getattr(REQUEST, 'RESPONSE', None),
 'handle_errors', False)
 # Can we re-raise the exception with a rendered-to-HTML
 # exception value? To be able to do so, the exception
 # constructor needs to be able to take more than two
 # arguments (some Zope 3 exceptions can't).
-ctor = getattr(getattr(error_type, '__init__', None), 'im_func', 
None)
-can_raise = (ctor is not None and inspect.isfunction(ctor) 
- and len(inspect.getargspec(error_type.__init__)[0])  
2)
+ctor = getattr(error_type, '__init__', None)
+if inspect.ismethoddescriptor(ctor):
+# If it's a method descriptor, it means we've got a
+# base ``__init__`` method that was not overriden,
+# likely from the base ``Exception`` class.
+can_raise = True
+else:
+if inspect.ismethod(ctor):
+ctor = getattr(ctor, 'im_func', None)
+can_raise = (
+ctor is not None and inspect.isfunction(ctor)
+and len(inspect.getargspec(error_type.__init__)[0])  2)
 
 if not (can_raise and handle_errors):
 # If we have been asked not to handle errors and we

Modified: Zope/trunk/src/OFS/tests/testSimpleItem.py
===
--- Zope/trunk/src/OFS/tests/testSimpleItem.py  2009-05-07 19:07:21 UTC (rev 
99804)
+++ Zope/trunk/src/OFS/tests/testSimpleItem.py  2009-05-07 23:18:39 UTC (rev 
99805)
@@ -32,7 +32,36 @@
 
 verifyClass(ISimpleItem, SimpleItem)
 
+def test_standard_error_message_is_called(self):
+from zExceptions import BadRequest
+from OFS.SimpleItem import SimpleItem
 
+# handle_errors should default to True. It is a flag used for
+# functional doctests. See ZPublisher/Test.py and
+# ZPublisher/Publish.py.
+class REQUEST(object):
+class RESPONSE(object):
+handle_errors = True
+
+class StandardErrorMessage(object):
+def __init__(self):
+self.kw = {}
+
+def __call__(self, **kw):
+self.kw.clear()
+self.kw.update(kw)
+
+item = SimpleItem()
+item.standard_error_message = sem = StandardErrorMessage()
+
+try:
+raise BadRequest(1)
+except:
+item.raise_standardErrorMessage(client=item,
+REQUEST=REQUEST())
+
+self.assertEquals(sem.kw.get('error_type'), 'BadRequest')
+
 def test_suite():
 return