[Subversion] / PEAK / CHANGES.txt  

Diff of /PEAK/CHANGES.txt

Parent Directory | Revision Log

version 1813, Thu Sep 30 19:29:17 2004 UTC version 1852, Wed Oct 13 00:54:49 2004 UTC
Line 1 
Line 1 
 Fixes and Enhancements since Version 0.5 alpha 3  Fixes and Enhancements since Version 0.5 alpha 3
   
    - 'web.IResource' is gone, replaced by 'web.IPlace'.  The notion of a place is
      broader than the notion of a resource, and we will soon need to have
      other "location" objects that implement 'IPlace'.
   
    - In order to support obtaining the line and column locations of problems in
      XML files, we are now using Python 2.4's version of the 'pyexpat' module,
      built as 'peak.util.pyexpat'.
   
    - There's a new class, 'config.IniLoader', that can be used to lazily load
      .ini files as configuration.  'IniLoader' instances have an 'iniFiles'
      attribute that lists the configuration sources (filenames/URLs/factories)
      to be used, and automatically load the .ini files as soon as you try to get
      any configuration data for them.  Previously, similar functionality was only
      available via 'config.makeRoot()'.
   
      Also, there's now an 'ini' reference type that instantiates an 'IniLoader'
      for one or more addresses.  You can use it like this::
   
        [Named Services]
   
        some.example = naming.Reference('ini',
            ['pkgfile:peak/peak.ini', '/etc/something.ini']
         )
   
        another.example = naming.LinkRef(
            'ref:ini@pkgfile:peak/peak.ini||/etc/something.ini'
         )
   
      The two examples above will each load the same pair of specified .ini files.
      You can also directly instantiate an 'IniLoader', as in::
   
        cfg = config.IniLoader(self, iniFiles=['pkgfile:peak/peak.ini'])
   
      Attempting to look up any configuration properties via the 'cfg' object
      will cause it to load the specified .ini file.
   
    - 'config.fileNearModule()' is DEPRECATED, in favor of 'config.packageFile()'.
      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()'.
   
    - 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.
   
    - The 'naming.IStreamFactory' interface now has an 'address' attribute, which
      is the string form of the canonical URL of the target stream.  This was
      added to make it easier to e.g. report errors in a stream that's being
      parsed, since the parser only needs the factory in order to report the
      location of an error.  (Note: if you implement 'naming.IStreamFactory', be
      sure to add this attribute to your implementations.)
   
    - The 'peak.util.WSGIServer' module has been moved to the
      'wsgiref.simple_server' module.  The 'wsgiref' reference library for WSGI
      (aka PEP 333) is now distributed with PEAK.
   
    - Added a 'WSGI' command to the 'peak' script, to allow you to run "foreign"
      (i.e. non-PEAK) PEP 333 applications in PEAK's various servers and
      launchers.  Basically, by prefixing 'WSGI' before the import specifier, you
      can now run such foreign apps.
   
      For example::
   
          peak launch WSGI import:some_app.application
   
      will run 'some_app.application' in the local web browser, and::
   
          peak CGI WSGI import:some_app.application
   
      will run it under the CGI/FastCGI runner.  Similarly, you can use this in
      the "Command" spec for the "peak supervise" pre-forking FastCGI supervisor
      subsystem.
   
    - There is a new 'running.IWSGIApplication' interface, for PEP 333-compliant
      "application" objects, and all of PEAK's provided applications now implement
      it instead of 'running.IRerunnableCGI'.  If you write your apps to the newer
      interface, they'll be portable to any PEP 333-compliant web server, not just
      the PEAK CGI, FastCGI, and "supervisor" containers.  There is a simple
      adapter that allows 'IWSGIApplication' objects to run in the CGI-based
      containers, but not the other way around, so using 'IRerunnableCGI' directly
      now limits your portability.  (For example, the "peak launch" and "peak
      serve" commands will soon require 'IWSGIApplication', and will not support
      'IRerunnableCGI' any more.)
   
      Of course, if you use the 'peak.web' framework, you don't need to worry
      about any of this; your apps will automatically be wrapped as
      'IWSGIApplication', and run in any PEAK server or gateway.
   
    - Most 'peak.web' interfaces have changed significantly.  If you implemented
      anything based on the older interfaces, and it still works, it's sheer
      bloody luck.  In particular, note that every method in 'web.IWebTraversable'
      now has different inputs and/or outputs than before.  Please read the new
      interface docs and update your code!  The changed interfaces offer much
      more flexibility and functionality than before, but they will require you to
      update your code.
   
    - 'web.ContainerAsTraversable' has been removed.  It was redundant, since the
      new default traversal mechanism used by 'Traversable' and 'Decorator' now
      handles getitem, getattr, and views.
   
  - Added Zope 3-like "namespaces" to 'peak.web'.  Path segments in a URL   - Added Zope 3-like "namespaces" to 'peak.web'.  Path segments in a URL
    may be prefixed with '"++some_id++"' in order to invoke a corresponding     may be prefixed with '"++some_id++"' in order to invoke a corresponding
    namespace handler registered under '"peak.web.namespaces.some_id".     namespace handler registered under '"peak.web.namespaces.some_id"'.
    Namespace handlers must implement 'web.INamespaceHandler', and they are     Namespace handlers must implement 'web.INamespaceHandler', and they are
    supplied with the original path segment as well as the separated namespace     supplied with the original path segment as well as the separated namespace
    and name.  Also, as in Zope 3, '"@@foo"' is a shortcut for '"++view++foo"'.     and name.  Also, as in Zope 3, '"@@foo"' is a shortcut for '"++view++foo"'.
    Builtin namespaces at this time include 'view', 'item', 'attr', 'skin', and     Builtin namespaces at this time include 'view', 'item', 'attr', 'skin', and
    'resources'.  'skin' treats the rest of its path segment as a skin name,     'resources'.  'skin' treats the rest of its path segment as a skin name,
    and sets the current skin, and 'resources' begins traversal to resources     and sets the current skin, while 'resources' begins traversal to resources
    found in the current skin.  The other namespaces are as described at:     found in the current skin.  The other namespaces are as described at:
   
    "Resources and traversal in peak.web":http://www.eby-sarna.com/pipermail/peak/2004-August/001712.html     "Resources and traversal in peak.web":http://www.eby-sarna.com/pipermail/peak/2004-August/001712.html
Line 170 
Line 292 
   
  - Added a 'zconfig.schema' factory, so that 'ref:zconfig.schema@streamURL'   - Added a 'zconfig.schema' factory, so that 'ref:zconfig.schema@streamURL'
    will load a schema loader.  Schema loaders are themselves object factories,     will load a schema loader.  Schema loaders are themselves object factories,
    so you can do something like:     so you can do something like::
   
      [Named Services]       [Named Services]
      peak.naming.factories.myschema = \       peak.naming.factories.myschema = \
          naming.LinkRef('ref:zconfig.schema@pkgfile:mypkg/Schema.xml')           naming.LinkRef('ref:zconfig.schema@pkgfile:mypkg/Schema.xml')
   
    in order to make URLs like 'ref:myschema@filename' work.  Note, by the way,     in order to make URLs like 'ref:myschema@filename' work.  Note, by the way,
    that the above could also read:     that the above could also read::
   
      [Named Services]       [Named Services]
      peak.naming.factories.myschema = \       peak.naming.factories.myschema = \


Generate output suitable for use with a patch program
Legend:
Removed from v.1813  
changed lines
  Added in v.1852

cvs-admin@eby-sarna.com

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help