Edgewall Software

Changeset 947

Show
Ignore:
Timestamp:
08/19/08 13:51:06 (4 years ago)
Author:
cmlenz
Message:

Ported [913], [927], and [928] to the 0.5.x branch.

Location:
branches/stable/0.5.x
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • branches/stable/0.5.x/ChangeLog

    r905 r947  
     1Version 0.5.2 
     2http://svn.edgewall.org/repos/genshi/tags/0.5.2/ 
     3(???, from branches/stable/0.5.x) 
     4 
     5 * Fix problem with I18n filter that would get confused by expressions in 
     6   attribute values when inside an `i18n:msg` block (ticket #250). 
     7 
     8 
    19Version 0.5.1 
    210http://svn.edgewall.org/repos/genshi/tags/0.5.1/ 
  • branches/stable/0.5.x/genshi/filters/i18n.py

    r903 r947  
    168168                    else: 
    169169                        newval = list(self(_ensure(value), ctxt, 
    170                             search_text=False, msgbuf=msgbuf) 
     170                            search_text=False) 
    171171                        ) 
    172172                    if newval != value: 
  • branches/stable/0.5.x/genshi/filters/tests/i18n.py

    r903 r947  
    301301          <p>Jim, sei gegrüßt!</p> 
    302302        </html>""", tmpl.generate(user=dict(name='Jim')).render()) 
     303 
     304    def test_translate_i18n_msg_with_attribute_param(self): 
     305        tmpl = MarkupTemplate("""<html xmlns:py="http://genshi.edgewall.org/" 
     306            xmlns:i18n="http://genshi.edgewall.org/i18n"> 
     307          <p i18n:msg=""> 
     308            Hello, <a href="#${anchor}">dude</a>! 
     309          </p> 
     310        </html>""") 
     311        gettext = lambda s: u"Sei gegrüßt, [1:Alter]!" 
     312        tmpl.filters.insert(0, Translator(gettext)) 
     313        self.assertEqual("""<html> 
     314          <p>Sei gegrüßt, <a href="#42">Alter</a>!</p> 
     315        </html>""", tmpl.generate(anchor='42').render()) 
    303316 
    304317    def test_extract_i18n_msg_with_two_params(self): 
  • branches/stable/0.5.x/genshi/filters/transform.py

    r881 r947  
    495495        >>> html = HTML('<html><head><title>Some Title</title></head>' 
    496496        ...             '<body>Some <em>body</em> text.</body></html>') 
    497         >>> print html | Transformer('title/text()').copy(buffer) \\ 
     497        >>> print html | Transformer('head/title/text()').copy(buffer) \\ 
    498498        ...     .end().select('body').prepend(tag.h1(buffer)) 
    499499        <html><head><title>Some Title</title></head><body><h1>Some 
  • branches/stable/0.5.x/setup.py

    r908 r947  
    2121try: 
    2222    from setuptools import setup, Extension, Feature 
     23    from setuptools.command.bdist_egg import bdist_egg 
    2324except ImportError: 
    2425    from distutils.core import setup, Extension 
    2526    Feature = None 
     27    bdist_egg = None 
    2628import sys 
    2729 
     
    3234    build_doc = test_doc = None 
    3335 
     36_speedup_available = False 
    3437 
    3538class optional_build_ext(build_ext): 
     
    4447        try: 
    4548            build_ext.build_extension(self, ext) 
     49            global _speedup_available 
     50            _speedup_available = True 
    4651        except CCompilerError, x: 
    4752            self._unavailable() 
     
    6671    speedups = None 
    6772 
     73 
     74# Setuptools need some help figuring out if the egg is "zip_safe" or not 
     75if bdist_egg: 
     76    class my_bdist_egg(bdist_egg): 
     77        def zip_safe(self): 
     78            return not _speedup_available and bdist_egg.zip_safe(self) 
     79 
     80 
     81cmdclass = {'build_doc': build_doc, 'test_doc': test_doc, 
     82            'build_ext': optional_build_ext} 
     83if bdist_egg: 
     84    cmdclass['bdist_egg'] = my_bdist_egg 
     85 
    6886setup( 
    6987    name = 'Genshi', 
     
    8098    url = 'http://genshi.edgewall.org/', 
    8199    download_url = 'http://genshi.edgewall.org/wiki/Download', 
    82     zip_safe = True, 
    83100 
    84101    classifiers = [ 
     
    113130 
    114131    features = {'speedups': speedups}, 
    115     cmdclass = {'build_doc': build_doc, 'test_doc': test_doc, 
    116                 'build_ext': optional_build_ext} 
     132    cmdclass = cmdclass 
    117133)