File python-kid.spec of Package python-kid

# spec file for package python-kid (Version 0.9.6)
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
# Please submit bugfixes or comments via

# norootforbuild

Name:           python-kid
BuildRequires:  python-devel python-setuptools python-xml
Version:        0.9.6
Release:        1
Summary:        Kid - A simple and pythonic XML template language
Group:          Development/Libraries/Python
License:        X11/MIT
Source:         kid-%{version}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if %{suse_version} < 1020
BuildRequires:  python-elementtree
Requires:       python-elementtree
Requires:       python-xml


Kid is a simple Python based template language for generating and
transforming XML vocabularies. Kid was spawned as a result of a kinky
love triangle between XSLT, TAL, and PHP. We believe many of the best
features of these languages live on in Kid with much of the limitations
and complexity stamped out (well, eventually :).

Templates are compiled to native Python byte-code and may be imported
and used like normal Python modules.

    Ryan Tomayko <>

%setup -q -n kid-%{version}

python build

python install --prefix=%{_prefix} --root=$RPM_BUILD_ROOT


%doc COPYING HISTORY README doc/ examples/

* Tue Aug 07 2007 -
- update to version 0.9.6
  * Enhancements
  o The format parameter can now be set to 'straight' if you do not want
  any output formatting at all (the default format removes empty lines).
  * Bug Fixes
  o The Template _filters list is now an instance attribute (otherwise
  TurboKid may expand that list endlessly).
  o In some situations Kid printed misleading error tracebacks.
  o There was a small problem with indentation formatting.
  o The representation of the Format class was not correct.
* Sat Feb 17 2007 -
- specfile cleanup
* Fri Feb 16 2007 -
- update to version 0.9.5
  * Error messages
  o Error reporting has been taken a step further: Kid now tries to track
  down the location of errors to the original Kid template file instead
  of merely printing the error location in the compiled template module.
  This has been one of the most urgently requested features.
  * ElementTree not required any more
  o The dependency on the ElementTree package has been removed completely.
  * Auto recompilation
  o Kid 0.9.3 templates needed to be recompiled in order to run with newer
  versions. This recompilation is now done automatically in the
  background whenever there is a new version, in order to ensure
  compatibility and to benefit from improvements in template creation in
  newer versions.
  * Changes
  o The old Kid namespace URL is not supported
  any more. Please use the new URL which has
  been introduced already in Kid 0.6.
  * Bug Fixes
  o Combination of both py:layout and py:extends caused a problem.
  o Passing parameters to functions with default parameters which were
  defined with py:def did not work properly.
  o The XML encoding declaration in the template was not evaluated.
* Mon Jan 15 2007 -
- fix build, only use BuildRequires: python-elementtree on old dists
* Thu Jan 11 2007 -
- use python-xml requirement for python 2.5 only (because that's
  where elementtree lives since then)
* Tue Jan 09 2007 -
- re-add python-elementtree requirement if built with python < 2.5
* Mon Jan 08 2007 -
- update to version 0.9.4
  * Error messages
  o XML errors from the Expat parser are now shown along with the
  corresponding line of the erroneous XML code and the exact position of
  the error.
  o Kid is now much less picky about py:extends and py:layout expressions
  and will output much better error messages if they cause an error.
  o Kid will now also check that you dont' use a Template parameter that
  conflicts with the name of a member of the BaseTemplate class.  Output
  Format Control
  o The serialization methods now take an additional attribute format that
  must be an instance of the new Format class or a string referring to
  one of several predefined output formats. This class gives you more
  fine control over how the text content is serialized. You can do
  things like removing redundant whitespace, adding indentation, word
  wrapping, using named entities and using typographic characters for
  quotes etc. You can also plug-in your own text filters here. The
  chapter on Formatting in the User's Guide lists all available
  o The old filter methods of the Serializer class have been replaced by a
  more powerful general method incorporating the specified format.  HTML
  o As discussed on the mailing list, the HTML serializer now produces
  tags in lowercase. You can change this behavior with the transpose
  attribute or using the output method 'HTML' instead of 'html'.
  o Additional HTML output methods have been defined corresponding to
  Mozilla's "full standards mode", "almost standards mode" and "quirks
  mode." XHTML Serializer
  o The XHTML Serializer now also injects a meta tag with the content type
  at the top of the head section. This had been only done by the
  HTMLSerializer before. The content type is not injected if such a meta
  tag already exists. This automatism can be controlled with the
  inject_type parameter.  XML Comments
  o The rule when variable substitution is applied to XML comments has
  been slightly changed, as explained in the Language Specification.
  Additional parameters for parsing templates
  o The load_template() function now takes additional parameters
  entity_map and exec_module. This lets you choose a different XML
  entity map to be used when parsing the template, and gives you more
  control over the way in which the compiled template code is executed
  in the newly created module. The entity_map parameter can also be
  passed to some other functions such as XML() and compile_file().  Full
  compatibility with Python 2.5 and Python eggs
  o The enable_import mechanism has been completely rewritten to support
  both Python 2.5 and Python eggs. The old method based on ihooks is not
  used any more since ihooks is not compatible with Python eggs; and the
  old method based on path_hooks is not used any more since in Python 2.5,
  importers installed via path_hooks do not fall back to the built-in
  import mechanism any more, breaking the previous implementation.
  o The new implementation allows enabling imports from specified paths as
  well as imports from sys.path which is now implemented via meta_path.
  o Python versions older than Python 2.3 are not supported by Kid any
  * Changes
  o Due to optimizations in kid.template_util, Kid 0.9.3 templates need to
  be re-compiled in order to run with Kid 0.9.4.
  o The 'html' output method now produces lower-case tags. If you want
  upper-case tags, you have to use the 'HTML' method now.
  o The kid.parser and kid.pull modules have been renamed kid.codewriter
  and kid.parser respectively (in anticipation of a parsing subsystem).
  * Bug Fixes
  o A couple of bugs that had been reported as trac tickets have been
  o Using layout templates which are extended by another template did not
  work properly (as reported on the TurboGears mailing list); this has
  been fixed.
  o More unit tests have been added. The testing machinery now supports
  both py.test and nose, or you can simply use the script.
- removed obsolete Requires: python-elementtree
* Tue Nov 21 2006 -
- requires python-xml
* Mon Oct 02 2006 -
- fix build on older distributions
* Thu Sep 21 2006 -
- fix build with python 2.5
* Fri Aug 04 2006 -
- update to version 0.9.3
  * Re-applied a patch from ticket [66] that fix a bug where comments caused
  errors when in base templates.
  * Changed all of the links into
  * Added and updated a few tests
  * Removed the NamespaceStack.set method and made NamespaceStack.pop return
  the deleted value.
  * Set balanced blocks to be off by default.
  * Updated the parser to better handle interpolation of non-string types in
* Tue Jun 27 2006 -
- update to version 0.9.2
  * Enhancements
  o Updated to current version of
  o Improved, resolving tickets #103 (FutureWarnings) and 137
  [#](using new import hooks).
  o The testing code can now figure out what testing modules to run
  dynamically. In addition, the code also determines which functions are
  tests dynamically. Tests that need pylib are skipped for those that
  don't have it. If you run 'python' now you should be
  seeing more tests executed.
  o Removed the revision history from the language and and instead include
  a pointer to the Release Notes.
  * API Changes
  o Allow the kid command to accept XML piped into it's stdin when '-' is
  used as the filename.
  o Patch from #143. The load_template() function accepts an 'ns'keyword
  argument to pre-populate the template module namespace with global
  variables. Thanks!
  o Created an API to replace the various ways that configuration options
  are currently set.
  o Allow the XML function to take a new keword parameter (xmlns) that
  sets the default namespace for a fragment.
  * Add Support for Python 2.5
  o Added support for xml.etree, which is the ElementTree packaged with
  Python 2.5. Running 'make test' only checks xml.etree currently.
  o The __future__ imports have been moved to the top of the module to
  play nicely in Python 2.5. I have also added 2.5 to the makefile so
  it will be tested before each release.
  o makefile regression test includes Python 2.5.
* Thu May 25 2006 -
- update to version 0.9.1
  * Layout Templates:
  o The parameters passed to a template with a py:layout were not visible
  in named template functions or match templates.
  o A small bug existed in Python 2.3 where the dict.update() method was
  being called incorrectly. Python 2.4 allows a list of tuples to be
  passed to update(), whereas Python 2.3 does not.
  o There is a new feature in Kid for a template to specify a layout
  template to which match templates, named template definitions, and
  template parameters will be applied. This is useful for applying a
  generic set of headers, menus, footers, etc. to a many pages without
  duplicating large amounts of code in each page.
  * py:match:
  o The logic to apply the template matches has been reworked. This was
  due to the discovery of some odd behavior when using multiple template
  * Convenience Functions
  o Kid Template instances now provide convenience funcitons defined(name)
  and value_of(name).
  * Invisible Comments
  o XML comments starting with a ! character will not appear in the
  serialized output of a template.
* Tue Feb 28 2006 -
- updated to reflect python changes due to #149809
* Wed Jan 25 2006 -
- converted neededforbuild to BuildRequires
* Sat Dec 24 2005 -
- update to version 0.8
* Tue Nov 08 2005 -
- don't build as root
* Mon Sep 12 2005 -
- specfile cleanup
* Tue Aug 16 2005 -
- initial package (version 0.6.4)