[Subversion] / PEAK / CHANGES.txt  

Revision 1839


Jump to revision:
Previous Next
Author: pje
Date: Fri Oct 8 16:38:01 2004 UTC (19 years, 6 months ago)

Log Message:

Changes to make it possible to use PEAK and PEAK apps' package data files
from .zip files:

- 'config.fileNearModule()' is DEPRECATED; use 'config.packageFile()' now.
   The latter returns a 'naming.IStreamFactory', which is more suitable for
   working with e.g. module data files compressed in a zipfile.  Uses of
   'fileNearModule()' that were being passed to 'config.loadConfigFile()'
   can be safely changed to 'config.packageFile()' without needing any
   other code changes, but if you were directly using 'fileNearModule()'
   as a filename, you will need to rewrite appropriately.

 - 'config.loadConfigFile()' and 'config.loadConfigFiles()' now accept
   URLs, 'naming.IStreamFactory' objects, and 'config.IStreamSource'
   objects as well as filenames.  This was primarily added to support use
   of 'config.packageFile()' or 'pkgfile:' URLs, in place of using
   'config.fileNearModule()'.  (ZConfig loaders support this too.)

 - There is a new 'config.IStreamSource' protocol, to make it easy to
   accept URLs, filenames, or 'naming.IStreamFactory' objects as the source
   of a "file".

   Its typical usage is just::

       factory = config.IStreamSource(data).getFactory(self)
       stream = factory.open('t')  # open for reading in text mode

   where 'data' is a string or a 'naming.IStreamFactory', and 'self' is a
   component to be used as lookup context.  The returned 'factory' is a
   'naming.IStreamFactory' that can then be '.open()'-ed for reading, or
   used in other ways as needed.

   Wherever practical, as we encounter them, we'll be changing PEAK API's
   that take filenames to also accept stream sources.

Changed paths:

Path Action Text Changes Prop Changes Diff to Previous
PEAK/CHANGES.txt modified X   (diff to previous)
PEAK/src/peak/config/config_components.py modified X   (diff to previous)
PEAK/src/peak/config/ini_files.py modified X   (diff to previous)
PEAK/src/peak/config/interfaces.py modified X   (diff to previous)
PEAK/src/peak/config/load_zconfig.py modified X   (diff to previous)
PEAK/src/peak/config/tests/__init__.py modified X   (diff to previous)

cvs-admin@eby-sarna.com

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help