~ubuntu-branches/ubuntu/vivid/mako/vivid-proposed

« back to all changes in this revision

Viewing changes to doc/_sources/changelog.txt

  • Committer: Package Import Robot
  • Author(s): Piotr Ożarowski
  • Date: 2014-06-10 20:38:26 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20140610203826-5gtppywd9v3gf14a
Tags: 1.0.0-1
* New upstream release
* Add python-changelog and python-sphinx-paramlinks to Build-Depends
  (needed while rebuilding documentation)
* Enable Python 3.X tests during build (add necessary packages to
  Build-Depends)
* Update links to upstream changelog (now points to changelog.rst)
* Add lintian override for source-is-missing doc/searchindex.js
  (this file is generated by sphinx-build, all sources are in the tarball)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
=========
 
2
Changelog
 
3
=========
 
4
 
 
5
1.0
 
6
===
 
7
 
 
8
.. changelog::
 
9
    :version: 1.0.0
 
10
    :released: Sun Jun 8 2014
 
11
 
 
12
    .. change::
 
13
        :tags: bug, py2k
 
14
        :pullreq: bitbucket:8
 
15
 
 
16
      Improved the error re-raise operation when a custom
 
17
      :paramref:`.Template.error_handler` is used that does not handle
 
18
      the exception; the original stack trace etc. is now preserved.
 
19
      Pull request courtesy Manfred Haltner.
 
20
 
 
21
    .. change::
 
22
        :tags: bug, py2k, filters
 
23
        :pullreq: bitbucket:7
 
24
 
 
25
      Added an html_escape filter that works in "non unicode" mode.
 
26
      Previously, when using ``disable_unicode=True``, the ``u`` filter
 
27
      would fail to handle non-ASCII bytes properly.  Pull request
 
28
      courtesy George Xie.
 
29
 
 
30
    .. change::
 
31
        :tags: general
 
32
 
 
33
      Compatibility changes; in order to modernize the codebase, Mako
 
34
      is now dropping support for Python 2.4 and Python 2.5 altogether.
 
35
      The source base is now targeted at Python 2.6 and forwards.
 
36
 
 
37
    .. change::
 
38
        :tags: feature
 
39
 
 
40
      Template modules now generate a JSON "metadata" structure at the bottom
 
41
      of the source file which includes parseable information about the
 
42
      templates' source file, encoding etc. as well as a mapping of module
 
43
      source lines to template lines, thus replacing the "# SOURCE LINE"
 
44
      markers throughout the source code.  The structure also indicates those
 
45
      lines that are explicitly not part of the template's source; the goal
 
46
      here is to allow better integration with coverage and other tools.
 
47
 
 
48
    .. change::
 
49
        :tags: bug, py3k
 
50
 
 
51
      Fixed bug in ``decode.<encoding>`` filter where a non-string object
 
52
      would not be correctly interpreted in Python 3.
 
53
 
 
54
    .. change::
 
55
        :tags: bug, py3k
 
56
        :tickets: 227
 
57
 
 
58
      Fixed bug in Python parsing logic which would fail on Python 3
 
59
      when a "try/except" targeted a tuple of exception types, rather
 
60
      than a single exception.
 
61
 
 
62
    .. change::
 
63
        :tags: feature
 
64
        :pullreq: bitbucket:5
 
65
 
 
66
      mako-render is now implemented as a setuptools entrypoint script;
 
67
      a standalone mako.cmd.cmdline() callable is now available, and the
 
68
      system also uses argparse now instead of optparse.  Pull request
 
69
      courtesy Derek Harland.
 
70
 
 
71
    .. change::
 
72
        :tags: feature
 
73
        :pullreq: bitbucket:4
 
74
 
 
75
      The mako-render script will now catch exceptions and run them
 
76
      into the text error handler, and exit with a non-zero exit code.
 
77
      Pull request courtesy Derek Harland.
 
78
 
 
79
    .. change::
 
80
        :tags: bug
 
81
        :pullreq: bitbucket:2
 
82
 
 
83
      A rework of the mako-render script allows the script to run
 
84
      correctly when given a file pathname that is outside of the current
 
85
      directory, e.g. ``mako-render ../some_template.mako``.  In this case,
 
86
      the "template root" defaults to the directory in which the template
 
87
      is located, instead of ".".  The script also accepts a new argument
 
88
      ``--template-dir`` which can be specified multiple times to establish
 
89
      template lookup directories.  Standard input for templates also works
 
90
      now too.  Pull request courtesy Derek Harland.
 
91
 
 
92
    .. change::
 
93
        :tags: feature, py3k
 
94
        :pullreq: github:7
 
95
 
 
96
      Support is added for Python 3 "keyword only" arguments, as used in
 
97
      defs.  Pull request courtesy Eevee.
 
98
 
 
99
 
 
100
0.9
 
101
===
 
102
 
 
103
.. changelog::
 
104
    :version: 0.9.1
 
105
    :released: Thu Dec 26 2013
 
106
 
 
107
    .. change::
 
108
        :tags: bug
 
109
        :tickets: 225
 
110
 
 
111
      Fixed bug in Babel plugin where translator comments
 
112
      would be lost if intervening text nodes were encountered.
 
113
      Fix courtesy Ned Batchelder.
 
114
 
 
115
    .. change::
 
116
        :tags: bug
 
117
        :tickets:
 
118
 
 
119
      Fixed TGPlugin.render method to support unicode template
 
120
      names in Py2K - courtesy Vladimir Magamedov.
 
121
 
 
122
    .. change::
 
123
        :tags: bug
 
124
        :tickets:
 
125
 
 
126
      Fixed an AST issue that was preventing correct operation
 
127
      under alpha versions of Python 3.4.  Pullreq courtesy Zer0-.
 
128
 
 
129
    .. change::
 
130
        :tags: bug
 
131
        :tickets:
 
132
 
 
133
      Changed the format of the "source encoding" header output
 
134
      by the code generator to use the format ``# -*- coding:%s -*-``
 
135
      instead of ``# -*- encoding:%s -*-``; the former is more common
 
136
      and compatible with emacs.  Courtesy Martin Geisler.
 
137
 
 
138
    .. change::
 
139
        :tags: bug
 
140
        :tickets: 224
 
141
 
 
142
      Fixed issue where an old lexer rule prevented a template line
 
143
      which looked like "#*" from being correctly parsed.
 
144
 
 
145
.. changelog::
 
146
    :version: 0.9.0
 
147
    :released: Tue Aug 27 2013
 
148
 
 
149
    .. change::
 
150
        :tags: bug
 
151
        :tickets: 219
 
152
 
 
153
      The Context.locals_() method becomes a private underscored
 
154
      method, as this method has a specific internal use. The purpose
 
155
      of Context.kwargs has been clarified, in that it only delivers
 
156
      top level keyword arguments originally passed to template.render().
 
157
 
 
158
    .. change::
 
159
        :tags: bug
 
160
        :tickets:
 
161
 
 
162
      Fixed the babel plugin to properly interpret ${} sections
 
163
      inside of a "call" tag, i.e. <%self:some_tag attr="${_('foo')}"/>.
 
164
      Code that's subject to babel escapes in here needs to be
 
165
      specified as a Python expression, not a literal.  This change
 
166
      is backwards incompatible vs. code that is relying upon a _('')
 
167
      translation to be working within a call tag.
 
168
 
 
169
    .. change::
 
170
        :tags: bug
 
171
        :tickets: 187
 
172
 
 
173
      The Babel plugin has been repaired to work on Python 3.
 
174
 
 
175
    .. change::
 
176
        :tags: bug
 
177
        :tickets: 207
 
178
 
 
179
      Using <%namespace import="*" module="somemodule"/> now
 
180
      skips over module elements that are not explcitly callable,
 
181
      avoiding TypeError when trying to produce partials.
 
182
 
 
183
    .. change::
 
184
        :tags: bug
 
185
        :tickets: 190
 
186
 
 
187
      Fixed Py3K bug where a "lambda" expression was not
 
188
      interpreted correctly within a template tag; also
 
189
      fixed in Py2.4.
 
190
 
 
191
0.8
 
192
===
 
193
 
 
194
.. changelog::
 
195
    :version: 0.8.1
 
196
    :released: Fri May 24 2013
 
197
 
 
198
    .. change::
 
199
        :tags: bug
 
200
        :tickets: 216
 
201
 
 
202
      Changed setup.py to skip installing markupsafe
 
203
      if Python version is < 2.6 or is between 3.0 and
 
204
      less than 3.3, as Markupsafe now only supports 2.6->2.X,
 
205
      3.3->3.X.
 
206
 
 
207
    .. change::
 
208
        :tags: bug
 
209
        :tickets: 214
 
210
 
 
211
      Fixed regression where "entity" filter wasn't
 
212
      converted for py3k properly (added tests.)
 
213
 
 
214
    .. change::
 
215
        :tags: bug
 
216
        :tickets: 212
 
217
 
 
218
      Fixed bug where mako-render script wasn't
 
219
      compatible with Py3k.
 
220
 
 
221
    .. change::
 
222
        :tags: bug
 
223
        :tickets: 213
 
224
 
 
225
      Cleaned up all the various deprecation/
 
226
      file warnings when running the tests under
 
227
      various Pythons with warnings turned on.
 
228
 
 
229
.. changelog::
 
230
    :version: 0.8.0
 
231
    :released: Wed Apr 10 2013
 
232
 
 
233
    .. change::
 
234
        :tags: feature
 
235
        :tickets:
 
236
 
 
237
      Performance improvement to the
 
238
      "legacy" HTML escape feature, used for XML
 
239
      escaping and when markupsafe isn't present,
 
240
      courtesy George Xie.
 
241
 
 
242
    .. change::
 
243
        :tags: bug
 
244
        :tickets: 209
 
245
 
 
246
      Fixed bug whereby an exception in Python 3
 
247
      against a module compiled to the filesystem would
 
248
      fail trying to produce a RichTraceback due to the
 
249
      content being in bytes.
 
250
 
 
251
    .. change::
 
252
        :tags: bug
 
253
        :tickets: 208
 
254
 
 
255
      Change default for compile()->reserved_names
 
256
      from tuple to frozenset, as this is expected to be
 
257
      a set by default.
 
258
 
 
259
    .. change::
 
260
        :tags: feature
 
261
        :tickets:
 
262
 
 
263
      Code has been reworked to support Python 2.4->
 
264
      Python 3.xx in place.  2to3 no longer needed.
 
265
 
 
266
    .. change::
 
267
        :tags: feature
 
268
        :tickets:
 
269
 
 
270
      Added lexer_cls argument to Template,
 
271
      TemplateLookup, allows alternate Lexer classes
 
272
      to be used.
 
273
 
 
274
    .. change::
 
275
        :tags: feature
 
276
        :tickets:
 
277
 
 
278
      Added future_imports parameter to Template
 
279
      and TemplateLookup, renders the __future__ header
 
280
      with desired capabilities at the top of the generated
 
281
      template module.  Courtesy Ben Trofatter.
 
282
 
 
283
0.7
 
284
===
 
285
 
 
286
.. changelog::
 
287
    :version: 0.7.3
 
288
    :released: Wed Nov 7 2012
 
289
 
 
290
    .. change::
 
291
        :tags: bug
 
292
        :tickets:
 
293
 
 
294
      legacy_html_escape function, used when
 
295
      Markupsafe isn't installed, was using an inline-compiled
 
296
      regexp which causes major slowdowns on Python 3.3;
 
297
      is now precompiled.
 
298
 
 
299
    .. change::
 
300
        :tags: bug
 
301
        :tickets: 201
 
302
 
 
303
      AST supporting now supports tuple-packed
 
304
      function arguments inside pure-python def
 
305
      or lambda expressions.
 
306
 
 
307
    .. change::
 
308
        :tags: bug
 
309
        :tickets:
 
310
 
 
311
      Fixed Py3K bug in the Babel extension.
 
312
 
 
313
    .. change::
 
314
        :tags: bug
 
315
        :tickets:
 
316
 
 
317
      Fixed the "filter" attribute of the
 
318
      <%text> tag so that it pulls locally specified
 
319
      identifiers from the context the same
 
320
      way as that of <%block> and <%filter>.
 
321
 
 
322
    .. change::
 
323
        :tags: bug
 
324
        :tickets:
 
325
 
 
326
      Fixed bug in plugin loader to correctly
 
327
      raise exception when non-existent plugin
 
328
      is specified.
 
329
 
 
330
.. changelog::
 
331
    :version: 0.7.2
 
332
    :released: Fri Jul 20 2012
 
333
 
 
334
    .. change::
 
335
        :tags: bug
 
336
        :tickets: 193
 
337
 
 
338
      Fixed regression in 0.7.1 where AST
 
339
      parsing for Py2.4 was broken.
 
340
 
 
341
.. changelog::
 
342
    :version: 0.7.1
 
343
    :released: Sun Jul 8 2012
 
344
 
 
345
    .. change::
 
346
        :tags: feature
 
347
        :tickets: 146
 
348
 
 
349
      Control lines with no bodies will
 
350
      now succeed, as "pass" is added for these
 
351
      when no statements are otherwise present.
 
352
      Courtesy Ben Trofatter
 
353
 
 
354
    .. change::
 
355
        :tags: bug
 
356
        :tickets: 192
 
357
 
 
358
      Fixed some long-broken scoping behavior
 
359
      involving variables declared in defs and such,
 
360
      which only became apparent when
 
361
      the strict_undefined flag was turned on.
 
362
 
 
363
    .. change::
 
364
        :tags: bug
 
365
        :tickets: 191
 
366
 
 
367
      Can now use strict_undefined at the
 
368
      same time args passed to def() are used
 
369
      by other elements of the <%def> tag.
 
370
 
 
371
.. changelog::
 
372
    :version: 0.7.0
 
373
    :released: Fri Mar 30 2012
 
374
 
 
375
    .. change::
 
376
        :tags: feature
 
377
        :tickets: 125
 
378
 
 
379
      Added new "loop" variable to templates,
 
380
      is provided within a % for block to provide
 
381
      info about the loop such as index, first/last,
 
382
      odd/even, etc.  A migration path is also provided
 
383
      for legacy templates via the "enable_loop" argument
 
384
      available on Template, TemplateLookup, and <%page>.
 
385
      Thanks to Ben Trofatter for all
 
386
      the work on this
 
387
 
 
388
    .. change::
 
389
        :tags: feature
 
390
        :tickets:
 
391
 
 
392
      Added a real check for "reserved"
 
393
      names, that is names which are never pulled
 
394
      from the context and cannot be passed to
 
395
      the template.render() method.  Current names
 
396
      are "context", "loop", "UNDEFINED".
 
397
 
 
398
    .. change::
 
399
        :tags: feature
 
400
        :tickets: 95
 
401
 
 
402
      The html_error_template() will now
 
403
      apply Pygments highlighting to the source
 
404
      code displayed in the traceback, if Pygments
 
405
      if available.  Courtesy Ben Trofatter
 
406
 
 
407
    .. change::
 
408
        :tags: feature
 
409
        :tickets: 147
 
410
 
 
411
      Added support for context managers,
 
412
      i.e. "% with x as e:/ % endwith" support.
 
413
      Courtesy Ben Trofatter
 
414
 
 
415
    .. change::
 
416
        :tags: feature
 
417
        :tickets: 185
 
418
 
 
419
      Added class-level flag to CacheImpl
 
420
      "pass_context"; when True, the keyword argument
 
421
      'context' will be passed to get_or_create()
 
422
      containing the Mako Context object.
 
423
 
 
424
    .. change::
 
425
        :tags: bug
 
426
        :tickets: 182
 
427
 
 
428
      Fixed some Py3K resource warnings due
 
429
      to filehandles being implicitly closed.
 
430
 
 
431
    .. change::
 
432
        :tags: bug
 
433
        :tickets: 186
 
434
 
 
435
      Fixed endless recursion bug when
 
436
      nesting multiple def-calls with content.
 
437
      Thanks to Jeff Dairiki.
 
438
 
 
439
    .. change::
 
440
        :tags: feature
 
441
        :tickets:
 
442
 
 
443
      Added Jinja2 to the example
 
444
      benchmark suite, courtesy Vincent Férotin
 
445
 
 
446
Older Versions
 
447
==============
 
448
 
 
449
.. changelog::
 
450
    :version: 0.6.2
 
451
    :released: Thu Feb 2 2012
 
452
 
 
453
    .. change::
 
454
        :tags: bug
 
455
        :tickets: 86, 20
 
456
 
 
457
      The ${{"foo":"bar"}} parsing issue is fixed!!
 
458
      The legendary Eevee has slain the dragon!.  Also fixes quoting issue
 
459
      at.
 
460
 
 
461
.. changelog::
 
462
    :version: 0.6.1
 
463
    :released: Sat Jan 28 2012
 
464
 
 
465
    .. change::
 
466
        :tags: bug
 
467
        :tickets:
 
468
 
 
469
      Added special compatibility for the 0.5.0
 
470
      Cache() constructor, which was preventing file
 
471
      version checks and not allowing Mako 0.6 to
 
472
      recompile the module files.
 
473
 
 
474
.. changelog::
 
475
    :version: 0.6.0
 
476
    :released: Sat Jan 21 2012
 
477
 
 
478
    .. change::
 
479
        :tags: feature
 
480
        :tickets:
 
481
 
 
482
      Template caching has been converted into a plugin
 
483
      system, whereby the usage of Beaker is just the
 
484
      default plugin.   Template and TemplateLookup
 
485
      now accept a string "cache_impl" parameter which
 
486
      refers to the name of a cache plugin, defaulting
 
487
      to the name 'beaker'.  New plugins can be
 
488
      registered as pkg_resources entrypoints under
 
489
      the group "mako.cache", or registered directly
 
490
      using mako.cache.register_plugin().  The
 
491
      core plugin is the mako.cache.CacheImpl
 
492
      class.
 
493
 
 
494
    .. change::
 
495
        :tags: feature
 
496
        :tickets:
 
497
 
 
498
      Added support for Beaker cache regions
 
499
      in templates.   Usage of regions should be considered
 
500
      as superseding the very obsolete idea of passing in
 
501
      backend options, timeouts, etc. within templates.
 
502
 
 
503
    .. change::
 
504
        :tags: feature
 
505
        :tickets:
 
506
 
 
507
      The 'put' method on Cache is now
 
508
      'set'.  'put' is there for backwards compatibility.
 
509
 
 
510
    .. change::
 
511
        :tags: feature
 
512
        :tickets:
 
513
 
 
514
      The <%def>, <%block> and <%page> tags now accept
 
515
      any argument named "cache_*", and the key
 
516
      minus the "cache_" prefix will be passed as keyword
 
517
      arguments to the CacheImpl methods.
 
518
 
 
519
    .. change::
 
520
        :tags: feature
 
521
        :tickets:
 
522
 
 
523
      Template and TemplateLookup now accept an argument
 
524
      cache_args, which refers to a dictionary containing
 
525
      cache parameters.  The cache_dir, cache_url, cache_type,
 
526
      cache_timeout arguments are deprecated (will probably
 
527
      never be removed, however) and can be passed
 
528
      now as cache_args={'url':<some url>, 'type':'memcached',
 
529
      'timeout':50, 'dir':'/path/to/some/directory'}
 
530
 
 
531
    .. change::
 
532
        :tags: feature/bug
 
533
        :tickets: 180
 
534
 
 
535
      Can now refer to context variables
 
536
      within extra arguments to <%block>, <%def>, i.e.
 
537
      <%block name="foo" cache_key="${somekey}">.
 
538
      Filters can also be used in this way, i.e.
 
539
      <%def name="foo()" filter="myfilter">
 
540
      then template.render(myfilter=some_callable)
 
541
 
 
542
    .. change::
 
543
        :tags: feature
 
544
        :tickets: 178
 
545
 
 
546
      Added "--var name=value" option to the mako-render
 
547
      script, allows passing of kw to the template from
 
548
      the command line.
 
549
 
 
550
    .. change::
 
551
        :tags: feature
 
552
        :tickets: 181
 
553
 
 
554
      Added module_writer argument to Template,
 
555
      TemplateLookup, allows a callable to be passed which
 
556
      takes over the writing of the template's module source
 
557
      file, so that special environment-specific steps
 
558
      can be taken.
 
559
 
 
560
    .. change::
 
561
        :tags: bug
 
562
        :tickets: 142
 
563
 
 
564
      The exception message in the html_error_template
 
565
      is now escaped with the HTML filter.
 
566
 
 
567
    .. change::
 
568
        :tags: bug
 
569
        :tickets: 173
 
570
 
 
571
      Added "white-space:pre" style to html_error_template()
 
572
      for code blocks so that indentation is preserved
 
573
 
 
574
    .. change::
 
575
        :tags: bug
 
576
        :tickets: 175
 
577
 
 
578
      The "benchmark" example is now Python 3 compatible
 
579
      (even though several of those old template libs aren't
 
580
      available on Py3K, so YMMV)
 
581
 
 
582
 
 
583
.. changelog::
 
584
    :version: 0.5.0
 
585
    :released: Wed Sep 28 2011
 
586
 
 
587
    .. change::
 
588
        :tags:
 
589
        :tickets: 174
 
590
 
 
591
      A Template is explicitly disallowed
 
592
      from having a url that normalizes to relative outside
 
593
      of the root.   That is, if the Lookup is based
 
594
      at /home/mytemplates, an include that would place
 
595
      the ultimate template at
 
596
      /home/mytemplates/../some_other_directory,
 
597
      i.e. outside of /home/mytemplates,
 
598
      is disallowed.   This usage was never intended
 
599
      despite the lack of an explicit check.
 
600
      The main issue this causes
 
601
      is that module files can be written outside
 
602
      of the module root (or raise an error, if file perms aren't
 
603
      set up), and can also lead to the same template being
 
604
      cached in the lookup under multiple, relative roots.
 
605
      TemplateLookup instead has always supported multiple
 
606
      file roots for this purpose.
 
607
 
 
608
 
 
609
.. changelog::
 
610
    :version: 0.4.2
 
611
    :released: Fri Aug 5 2011
 
612
 
 
613
    .. change::
 
614
        :tags:
 
615
        :tickets: 170
 
616
 
 
617
      Fixed bug regarding <%call>/def calls w/ content
 
618
      whereby the identity of the "caller" callable
 
619
      inside the <%def> would be corrupted by the
 
620
      presence of another <%call> in the same block.
 
621
 
 
622
    .. change::
 
623
        :tags:
 
624
        :tickets: 169
 
625
 
 
626
      Fixed the babel plugin to accommodate <%block>
 
627
 
 
628
.. changelog::
 
629
    :version: 0.4.1
 
630
    :released: Wed Apr 6 2011
 
631
 
 
632
    .. change::
 
633
        :tags:
 
634
        :tickets: 164
 
635
 
 
636
      New tag: <%block>.  A variant on <%def> that
 
637
      evaluates its contents in-place.
 
638
      Can be named or anonymous,
 
639
      the named version is intended for inheritance
 
640
      layouts where any given section can be
 
641
      surrounded by the <%block> tag in order for
 
642
      it to become overrideable by inheriting
 
643
      templates, without the need to specify a
 
644
      top-level <%def> plus explicit call.
 
645
      Modified scoping and argument rules as well as a
 
646
      more strictly enforced usage scheme make it ideal
 
647
      for this purpose without at all replacing most
 
648
      other things that defs are still good for.
 
649
      Lots of new docs.
 
650
 
 
651
    .. change::
 
652
        :tags:
 
653
        :tickets: 165
 
654
 
 
655
      a slight adjustment to the "highlight" logic
 
656
      for generating template bound stacktraces.
 
657
      Will stick to known template source lines
 
658
      without any extra guessing.
 
659
 
 
660
.. changelog::
 
661
    :version: 0.4.0
 
662
    :released: Sun Mar 6 2011
 
663
 
 
664
    .. change::
 
665
        :tags:
 
666
        :tickets:
 
667
 
 
668
      A 20% speedup for a basic two-page
 
669
      inheritance setup rendering
 
670
      a table of escaped data
 
671
      (see http://techspot.zzzeek.org/2010/11/19/quick-mako-vs.-jinja-speed-test/).
 
672
      A few configurational changes which
 
673
      affect those in the I-don't-do-unicode
 
674
      camp should be noted below.
 
675
 
 
676
    .. change::
 
677
        :tags:
 
678
        :tickets:
 
679
 
 
680
      The FastEncodingBuffer is now used
 
681
      by default instead of cStringIO or StringIO,
 
682
      regardless of whether output_encoding
 
683
      is set to None or not.  FEB is faster than
 
684
      both.  Only StringIO allows bytestrings
 
685
      of unknown encoding to pass right
 
686
      through, however - while it is of course
 
687
      not recommended to send bytestrings of unknown
 
688
      encoding to the output stream, this
 
689
      mode of usage can be re-enabled by
 
690
      setting the flag bytestring_passthrough
 
691
      to True.
 
692
 
 
693
    .. change::
 
694
        :tags:
 
695
        :tickets:
 
696
 
 
697
      disable_unicode mode requires that
 
698
      output_encoding be set to None - it also
 
699
      forces the bytestring_passthrough flag
 
700
      to True.
 
701
 
 
702
    .. change::
 
703
        :tags:
 
704
        :tickets: 156
 
705
 
 
706
      the <%namespace> tag raises an error
 
707
      if the 'template' and 'module' attributes
 
708
      are specified at the same time in
 
709
      one tag.  A different class is used
 
710
      for each case which allows a reduction in
 
711
      runtime conditional logic and function
 
712
      call overhead.
 
713
 
 
714
    .. change::
 
715
        :tags:
 
716
        :tickets: 159
 
717
 
 
718
      the keys() in the Context, as well as
 
719
      it's internal _data dictionary, now
 
720
      include just what was specified to
 
721
      render() as well as Mako builtins
 
722
      'caller', 'capture'.  The contents
 
723
      of __builtin__ are no longer copied.
 
724
      Thanks to Daniel Lopez for pointing
 
725
      this out.
 
726
 
 
727
 
 
728
.. changelog::
 
729
    :version: 0.3.6
 
730
    :released: Sat Nov 13 2010
 
731
 
 
732
    .. change::
 
733
        :tags:
 
734
        :tickets: 126
 
735
 
 
736
      Documentation is on Sphinx.
 
737
 
 
738
    .. change::
 
739
        :tags:
 
740
        :tickets: 154
 
741
 
 
742
      Beaker is now part of "extras" in
 
743
      setup.py instead of "install_requires".
 
744
      This to produce a lighter weight install
 
745
      for those who don't use the caching
 
746
      as well as to conform to Pyramid
 
747
      deployment practices.
 
748
 
 
749
    .. change::
 
750
        :tags:
 
751
        :tickets: 153
 
752
 
 
753
      The Beaker import (or attempt thereof)
 
754
      is delayed until actually needed;
 
755
      this to remove the performance penalty
 
756
      from startup, particularly for
 
757
      "single execution" environments
 
758
      such as shell scripts.
 
759
 
 
760
    .. change::
 
761
        :tags:
 
762
        :tickets: 155
 
763
 
 
764
      Patch to lexer to not generate an empty
 
765
      '' write in the case of backslash-ended
 
766
      lines.
 
767
 
 
768
    .. change::
 
769
        :tags:
 
770
        :tickets: 148
 
771
 
 
772
      Fixed missing **extra collection in
 
773
      setup.py which prevented setup.py
 
774
      from running 2to3 on install.
 
775
 
 
776
    .. change::
 
777
        :tags:
 
778
        :tickets:
 
779
 
 
780
      New flag on Template, TemplateLookup -
 
781
      strict_undefined=True, will cause
 
782
      variables not found in the context to
 
783
      raise a NameError immediately, instead of
 
784
      defaulting to the UNDEFINED value.
 
785
 
 
786
    .. change::
 
787
        :tags:
 
788
        :tickets:
 
789
 
 
790
      The range of Python identifiers that
 
791
      are considered "undefined", meaning they
 
792
      are pulled from the context, has been
 
793
      trimmed back to not include variables
 
794
      declared inside of expressions (i.e. from
 
795
      list comprehensions), as well as
 
796
      in the argument list of lambdas.  This
 
797
      to better support the strict_undefined
 
798
      feature.  The change should be
 
799
      fully backwards-compatible but involved
 
800
      a little bit of tinkering in the AST code,
 
801
      which hadn't really been touched for
 
802
      a couple of years, just FYI.
 
803
 
 
804
.. changelog::
 
805
    :version: 0.3.5
 
806
    :released: Sun Oct 24 2010
 
807
 
 
808
    .. change::
 
809
        :tags:
 
810
        :tickets: 141
 
811
 
 
812
      The <%namespace> tag allows expressions
 
813
      for the `file` argument, i.e. with ${}.
 
814
      The `context` variable, if needed,
 
815
      must be referenced explicitly.
 
816
 
 
817
    .. change::
 
818
        :tags:
 
819
        :tickets:
 
820
 
 
821
      ${} expressions embedded in tags,
 
822
      such as <%foo:bar x="${...}">, now
 
823
      allow multiline Python expressions.
 
824
 
 
825
    .. change::
 
826
        :tags:
 
827
        :tickets:
 
828
 
 
829
      Fixed previously non-covered regular
 
830
      expression, such that using a ${} expression
 
831
      inside of a tag element that doesn't allow
 
832
      them raises a CompileException instead of
 
833
      silently failing.
 
834
 
 
835
    .. change::
 
836
        :tags:
 
837
        :tickets: 151
 
838
 
 
839
      Added a try/except around "import markupsafe".
 
840
      This to support GAE which can't run markupsafe. No idea whatsoever if the
 
841
      install_requires in setup.py also breaks GAE,
 
842
      couldn't get an answer on this.
 
843
 
 
844
.. changelog::
 
845
    :version: 0.3.4
 
846
    :released: Tue Jun 22 2010
 
847
 
 
848
    .. change::
 
849
        :tags:
 
850
        :tickets:
 
851
 
 
852
      Now using MarkupSafe for HTML escaping,
 
853
      i.e. in place of cgi.escape().  Faster
 
854
      C-based implementation and also escapes
 
855
      single quotes for additional security.
 
856
      Supports the __html__ attribute for
 
857
      the given expression as well.
 
858
 
 
859
      When using "disable_unicode" mode,
 
860
      a pure Python HTML escaper function
 
861
      is used which also quotes single quotes.
 
862
 
 
863
      Note that Pylons by default doesn't
 
864
      use Mako's filter - check your
 
865
      environment.py file.
 
866
 
 
867
    .. change::
 
868
        :tags:
 
869
        :tickets: 137
 
870
 
 
871
      Fixed call to "unicode.strip" in
 
872
      exceptions.text_error_template which
 
873
      is not Py3k compatible.
 
874
 
 
875
.. changelog::
 
876
    :version: 0.3.3
 
877
    :released: Mon May 31 2010
 
878
 
 
879
    .. change::
 
880
        :tags:
 
881
        :tickets: 135
 
882
 
 
883
      Added conditional to RichTraceback
 
884
      such that if no traceback is passed
 
885
      and sys.exc_info() has been reset,
 
886
      the formatter just returns blank
 
887
      for the "traceback" portion.
 
888
 
 
889
    .. change::
 
890
        :tags:
 
891
        :tickets: 131
 
892
 
 
893
      Fixed sometimes incorrect usage of
 
894
      exc.__class__.__name__
 
895
      in html/text error templates when using
 
896
      Python 2.4
 
897
 
 
898
    .. change::
 
899
        :tags:
 
900
        :tickets:
 
901
 
 
902
      Fixed broken @property decorator on
 
903
      template.last_modified
 
904
 
 
905
    .. change::
 
906
        :tags:
 
907
        :tickets: 132
 
908
 
 
909
      Fixed error formatting when a stacktrace
 
910
      line contains no line number, as in when
 
911
      inside an eval/exec-generated function.
 
912
 
 
913
    .. change::
 
914
        :tags:
 
915
        :tickets:
 
916
 
 
917
      When a .py is being created, the tempfile
 
918
      where the source is stored temporarily is
 
919
      now made in the same directory as that of
 
920
      the .py file.  This ensures that the two
 
921
      files share the same filesystem, thus
 
922
      avoiding cross-filesystem synchronization
 
923
      issues.  Thanks to Charles Cazabon.
 
924
 
 
925
.. changelog::
 
926
    :version: 0.3.2
 
927
    :released: Thu Mar 11 2010
 
928
 
 
929
    .. change::
 
930
        :tags:
 
931
        :tickets: 116
 
932
 
 
933
      Calling a def from the top, via
 
934
      template.get_def(...).render() now checks the
 
935
      argument signature the same way as it did in
 
936
      0.2.5, so that TypeError is not raised.
 
937
      reopen of
 
938
 
 
939
.. changelog::
 
940
    :version: 0.3.1
 
941
    :released: Sun Mar 7 2010
 
942
 
 
943
    .. change::
 
944
        :tags:
 
945
        :tickets: 129
 
946
 
 
947
      Fixed incorrect dir name in setup.py
 
948
 
 
949
.. changelog::
 
950
    :version: 0.3.0
 
951
    :released: Fri Mar 5 2010
 
952
 
 
953
    .. change::
 
954
        :tags:
 
955
        :tickets: 123
 
956
 
 
957
      Python 2.3 support is dropped.
 
958
 
 
959
    .. change::
 
960
        :tags:
 
961
        :tickets: 119
 
962
 
 
963
      Python 3 support is added ! See README.py3k
 
964
      for installation and testing notes.
 
965
 
 
966
    .. change::
 
967
        :tags:
 
968
        :tickets: 127
 
969
 
 
970
      Unit tests now run with nose.
 
971
 
 
972
    .. change::
 
973
        :tags:
 
974
        :tickets: 99
 
975
 
 
976
      Source code escaping has been simplified.
 
977
      In particular, module source files are now
 
978
      generated with the Python "magic encoding
 
979
      comment", and source code is passed through
 
980
      mostly unescaped, except for that code which
 
981
      is regenerated from parsed Python source.
 
982
      This fixes usage of unicode in
 
983
      <%namespace:defname> tags.
 
984
 
 
985
    .. change::
 
986
        :tags:
 
987
        :tickets: 122
 
988
 
 
989
      RichTraceback(), html_error_template().render(),
 
990
      text_error_template().render() now accept "error"
 
991
      and "traceback" as optional arguments, and
 
992
      these are now actually used.
 
993
 
 
994
    .. change::
 
995
        :tags:
 
996
        :tickets:
 
997
 
 
998
      The exception output generated when
 
999
      format_exceptions=True will now be as a Python
 
1000
      unicode if it occurred during render_unicode(),
 
1001
      or an encoded string if during render().
 
1002
 
 
1003
    .. change::
 
1004
        :tags:
 
1005
        :tickets: 112
 
1006
 
 
1007
      A percent sign can be emitted as the first
 
1008
      non-whitespace character on a line by escaping
 
1009
      it as in "%%".
 
1010
 
 
1011
    .. change::
 
1012
        :tags:
 
1013
        :tickets: 94
 
1014
 
 
1015
      Template accepts empty control structure, i.e.
 
1016
      % if: %endif, etc.
 
1017
 
 
1018
    .. change::
 
1019
        :tags:
 
1020
        :tickets: 116
 
1021
 
 
1022
      The <%page args> tag can now be used in a base
 
1023
      inheriting template - the full set of render()
 
1024
      arguments are passed down through the inherits
 
1025
      chain.  Undeclared arguments go into **pageargs
 
1026
      as usual.
 
1027
 
 
1028
    .. change::
 
1029
        :tags:
 
1030
        :tickets: 109
 
1031
 
 
1032
      defs declared within a <%namespace> section, an
 
1033
      uncommon feature, have been improved.  The defs
 
1034
      no longer get doubly-rendered in the body() scope,
 
1035
      and now allow local variable assignment without
 
1036
      breakage.
 
1037
 
 
1038
    .. change::
 
1039
        :tags:
 
1040
        :tickets: 128
 
1041
 
 
1042
      Windows paths are handled correctly if a Template
 
1043
      is passed only an absolute filename (i.e. with c:
 
1044
      drive etc.)  and no URI - the URI is converted
 
1045
      to a forward-slash path and module_directory
 
1046
      is treated as a windows path.
 
1047
 
 
1048
    .. change::
 
1049
        :tags:
 
1050
        :tickets: 73
 
1051
 
 
1052
      TemplateLookup raises TopLevelLookupException for
 
1053
      a given path that is a directory, not a filename,
 
1054
      instead of passing through to the template to
 
1055
      generate IOError.
 
1056
 
 
1057
 
 
1058
.. changelog::
 
1059
    :version: 0.2.6
 
1060
    :released:
 
1061
 
 
1062
    .. change::
 
1063
        :tags:
 
1064
        :tickets:
 
1065
 
 
1066
      Fix mako function decorators to preserve the
 
1067
      original function's name in all cases. Patch
 
1068
      from Scott Torborg.
 
1069
 
 
1070
    .. change::
 
1071
        :tags:
 
1072
        :tickets: 118
 
1073
 
 
1074
      Support the <%namespacename:defname> syntax in
 
1075
      the babel extractor.
 
1076
 
 
1077
    .. change::
 
1078
        :tags:
 
1079
        :tickets: 88
 
1080
 
 
1081
      Further fixes to unicode handling of .py files with the
 
1082
      html_error_template.
 
1083
 
 
1084
.. changelog::
 
1085
    :version: 0.2.5
 
1086
    :released: Mon Sep  7 2009
 
1087
 
 
1088
    .. change::
 
1089
        :tags:
 
1090
        :tickets:
 
1091
 
 
1092
      Added a "decorator" kw argument to <%def>,
 
1093
      allows custom decoration functions to wrap
 
1094
      rendering callables.  Mainly intended for
 
1095
      custom caching algorithms, not sure what
 
1096
      other uses there may be (but there may be).
 
1097
      Examples are in the "filtering" docs.
 
1098
 
 
1099
    .. change::
 
1100
        :tags:
 
1101
        :tickets: 101
 
1102
 
 
1103
      When Mako creates subdirectories in which
 
1104
      to store templates, it uses the more
 
1105
      permissive mode of 0775 instead of 0750,
 
1106
      helping out with certain multi-process
 
1107
      scenarios. Note that the mode is always
 
1108
      subject to the restrictions of the existing
 
1109
      umask.
 
1110
 
 
1111
    .. change::
 
1112
        :tags:
 
1113
        :tickets: 104
 
1114
 
 
1115
      Fixed namespace.__getattr__() to raise
 
1116
      AttributeError on attribute not found
 
1117
      instead of RuntimeError.
 
1118
 
 
1119
    .. change::
 
1120
        :tags:
 
1121
        :tickets: 97
 
1122
 
 
1123
      Added last_modified accessor to Template,
 
1124
      returns the time.time() when the module
 
1125
      was created.
 
1126
 
 
1127
    .. change::
 
1128
        :tags:
 
1129
        :tickets: 102
 
1130
 
 
1131
      Fixed lexing support for whitespace
 
1132
      around '=' sign in defs.
 
1133
 
 
1134
    .. change::
 
1135
        :tags:
 
1136
        :tickets: 108
 
1137
 
 
1138
      Removed errant "lower()" in the lexer which
 
1139
      was causing tags to compile with
 
1140
      case-insensitive names, thus messing up
 
1141
      custom <%call> names.
 
1142
 
 
1143
    .. change::
 
1144
        :tags:
 
1145
        :tickets: 110
 
1146
 
 
1147
      added "mako.__version__" attribute to
 
1148
      the base module.
 
1149
 
 
1150
.. changelog::
 
1151
    :version: 0.2.4
 
1152
    :released: Tue Dec 23 2008
 
1153
 
 
1154
    .. change::
 
1155
        :tags:
 
1156
        :tickets:
 
1157
 
 
1158
      Fixed compatibility with Jython 2.5b1.
 
1159
 
 
1160
.. changelog::
 
1161
    :version: 0.2.3
 
1162
    :released: Sun Nov 23 2008
 
1163
 
 
1164
    .. change::
 
1165
        :tags:
 
1166
        :tickets:
 
1167
 
 
1168
      the <%namespacename:defname> syntax described at
 
1169
      http://techspot.zzzeek.org/?p=28 has now
 
1170
      been added as a built in syntax, and is recommended
 
1171
      as a more modern syntax versus <%call expr="expression">.
 
1172
      The %call tag itself will always remain,
 
1173
      with <%namespacename:defname> presenting a more HTML-like
 
1174
      alternative to calling defs, both plain and
 
1175
      nested.  Many examples of the new syntax are in the
 
1176
      "Calling a def with embedded content" section
 
1177
      of the docs.
 
1178
 
 
1179
    .. change::
 
1180
        :tags:
 
1181
        :tickets:
 
1182
 
 
1183
      added support for Jython 2.5.
 
1184
 
 
1185
    .. change::
 
1186
        :tags:
 
1187
        :tickets:
 
1188
 
 
1189
      cache module now uses Beaker's CacheManager
 
1190
      object directly, so that all cache types are included.
 
1191
      memcached is available as both "ext:memcached" and
 
1192
      "memcached", the latter for backwards compatibility.
 
1193
 
 
1194
    .. change::
 
1195
        :tags:
 
1196
        :tickets:
 
1197
 
 
1198
      added "cache" accessor to Template, Namespace.
 
1199
      e.g.  ${local.cache.get('somekey')} or
 
1200
      template.cache.invalidate_body()
 
1201
 
 
1202
    .. change::
 
1203
        :tags:
 
1204
        :tickets:
 
1205
 
 
1206
      added "cache_enabled=True" flag to Template,
 
1207
      TemplateLookup.  Setting this to False causes cache
 
1208
      operations to "pass through" and execute every time;
 
1209
      this flag should be integrated in Pylons with its own
 
1210
      cache_enabled configuration setting.
 
1211
 
 
1212
    .. change::
 
1213
        :tags:
 
1214
        :tickets: 92
 
1215
 
 
1216
      the Cache object now supports invalidate_def(name),
 
1217
      invalidate_body(), invalidate_closure(name),
 
1218
      invalidate(key), which will remove the given key
 
1219
      from the cache, if it exists.  The cache arguments
 
1220
      (i.e. storage type) are derived from whatever has
 
1221
      been already persisted for that template.
 
1222
 
 
1223
    .. change::
 
1224
        :tags:
 
1225
        :tickets:
 
1226
 
 
1227
      For cache changes to work fully, Beaker 1.1 is required.
 
1228
      1.0.1 and up will work as well with the exception of
 
1229
      cache expiry.  Note that Beaker 1.1 is **required**
 
1230
      for applications which use dynamically generated keys,
 
1231
      since previous versions will permanently store state in memory
 
1232
      for each individual key, thus consuming all available
 
1233
      memory for an arbitrarily large number of distinct
 
1234
      keys.
 
1235
 
 
1236
    .. change::
 
1237
        :tags:
 
1238
        :tickets: 93
 
1239
 
 
1240
      fixed bug whereby an <%included> template with
 
1241
      <%page> args named the same as a __builtin__ would not
 
1242
      honor the default value specified in <%page>
 
1243
 
 
1244
    .. change::
 
1245
        :tags:
 
1246
        :tickets: 88
 
1247
 
 
1248
      fixed the html_error_template not handling tracebacks from
 
1249
      normal .py files with a magic encoding comment
 
1250
 
 
1251
    .. change::
 
1252
        :tags:
 
1253
        :tickets:
 
1254
 
 
1255
      RichTraceback() now accepts an optional traceback object
 
1256
      to be used in place of sys.exc_info()[2].  html_error_template()
 
1257
      and text_error_template() accept an optional
 
1258
      render()-time argument "traceback" which is passed to the
 
1259
      RichTraceback object.
 
1260
 
 
1261
    .. change::
 
1262
        :tags:
 
1263
        :tickets:
 
1264
 
 
1265
      added ModuleTemplate class, which allows the construction
 
1266
      of a Template given a Python module generated by a previous
 
1267
      Template.   This allows Python modules alone to be used
 
1268
      as templates with no compilation step.   Source code
 
1269
      and template source are optional but allow error reporting
 
1270
      to work correctly.
 
1271
 
 
1272
    .. change::
 
1273
        :tags:
 
1274
        :tickets: 90
 
1275
 
 
1276
      fixed Python 2.3 compat. in mako.pyparser
 
1277
 
 
1278
    .. change::
 
1279
        :tags:
 
1280
        :tickets:
 
1281
 
 
1282
      fix Babel 0.9.3 compatibility; stripping comment tags is now
 
1283
      optional (and enabled by default).
 
1284
 
 
1285
.. changelog::
 
1286
    :version: 0.2.2
 
1287
    :released: Mon Jun 23 2008
 
1288
 
 
1289
    .. change::
 
1290
        :tags:
 
1291
        :tickets: 87
 
1292
 
 
1293
      cached blocks now use the current context when rendering
 
1294
      an expired section, instead of the original context
 
1295
      passed in
 
1296
 
 
1297
    .. change::
 
1298
        :tags:
 
1299
        :tickets:
 
1300
 
 
1301
      fixed a critical issue regarding caching, whereby
 
1302
      a cached block would raise an error when called within a
 
1303
      cache-refresh operation that was initiated after the
 
1304
      initiating template had completed rendering.
 
1305
 
 
1306
.. changelog::
 
1307
    :version: 0.2.1
 
1308
    :released: Mon Jun 16 2008
 
1309
 
 
1310
    .. change::
 
1311
        :tags:
 
1312
        :tickets:
 
1313
 
 
1314
      fixed bug where 'output_encoding' parameter would prevent
 
1315
      render_unicode() from returning a unicode object.
 
1316
 
 
1317
    .. change::
 
1318
        :tags:
 
1319
        :tickets:
 
1320
 
 
1321
      bumped magic number, which forces template recompile for
 
1322
      this version (fixes incompatible compile symbols from 0.1
 
1323
      series).
 
1324
 
 
1325
    .. change::
 
1326
        :tags:
 
1327
        :tickets:
 
1328
 
 
1329
      added a few docs for cache options, specifically those that
 
1330
      help with memcached.
 
1331
 
 
1332
.. changelog::
 
1333
    :version: 0.2.0
 
1334
    :released: Tue Jun  3 2008
 
1335
 
 
1336
    .. change::
 
1337
        :tags:
 
1338
        :tickets:
 
1339
 
 
1340
      Speed improvements (as though we needed them, but people
 
1341
      contributed and there you go):
 
1342
 
 
1343
    .. change::
 
1344
        :tags:
 
1345
        :tickets: 77
 
1346
 
 
1347
      added "bytestring passthru" mode, via
 
1348
      `disable_unicode=True` argument passed to Template or
 
1349
      TemplateLookup. All unicode-awareness and filtering is
 
1350
      turned off, and template modules are generated with
 
1351
      the appropriate magic encoding comment. In this mode,
 
1352
      template expressions can only receive raw bytestrings
 
1353
      or Unicode objects which represent straight ASCII, and
 
1354
      render_unicode() may not be used if multibyte
 
1355
      characters are present. When enabled, speed
 
1356
      improvement around 10-20%. (courtesy
 
1357
      anonymous guest)
 
1358
 
 
1359
    .. change::
 
1360
        :tags:
 
1361
        :tickets: 76
 
1362
 
 
1363
      inlined the "write" function of Context into a local
 
1364
      template variable. This affords a 12-30% speedup in
 
1365
      template render time. (idea courtesy same anonymous
 
1366
      guest)
 
1367
 
 
1368
    .. change::
 
1369
        :tags:
 
1370
        :tickets:
 
1371
 
 
1372
      New Features, API changes:
 
1373
 
 
1374
    .. change::
 
1375
        :tags:
 
1376
        :tickets: 62
 
1377
 
 
1378
      added "attr" accessor to namespaces. Returns
 
1379
      attributes configured as module level attributes, i.e.
 
1380
      within <%! %> sections.  i.e.:
 
1381
 
 
1382
      # somefile.html
 
1383
      <%!
 
1384
          foo = 27
 
1385
      %>
 
1386
 
 
1387
      # some other template
 
1388
      <%namespace name="myns" file="somefile.html"/>
 
1389
      ${myns.attr.foo}
 
1390
 
 
1391
      The slight backwards incompatibility here is, you
 
1392
      can't have namespace defs named "attr" since the
 
1393
      "attr" descriptor will occlude it.
 
1394
 
 
1395
    .. change::
 
1396
        :tags:
 
1397
        :tickets: 78
 
1398
 
 
1399
      cache_key argument can now render arguments passed
 
1400
      directly to the %page or %def, i.e. <%def
 
1401
      name="foo(x)" cached="True" cache_key="${x}"/>
 
1402
 
 
1403
    .. change::
 
1404
        :tags:
 
1405
        :tickets:
 
1406
 
 
1407
      some functions on Context are now private:
 
1408
      _push_buffer(), _pop_buffer(),
 
1409
      caller_stack._push_frame(), caller_stack._pop_frame().
 
1410
 
 
1411
    .. change::
 
1412
        :tags:
 
1413
        :tickets: 56, 81
 
1414
 
 
1415
      added a runner script "mako-render" which renders
 
1416
      standard input as a template to stdout
 
1417
 
 
1418
    .. change::
 
1419
        :tags: bugfixes
 
1420
        :tickets: 83, 84
 
1421
 
 
1422
      can now use most names from __builtins__ as variable
 
1423
      names without explicit declaration (i.e. 'id',
 
1424
      'exception', 'range', etc.)
 
1425
 
 
1426
    .. change::
 
1427
        :tags: bugfixes
 
1428
        :tickets: 84
 
1429
 
 
1430
      can also use builtin names as local variable names
 
1431
      (i.e. dict, locals) (came from fix for)
 
1432
 
 
1433
    .. change::
 
1434
        :tags: bugfixes
 
1435
        :tickets: 68
 
1436
 
 
1437
      fixed bug in python generation when variable names are
 
1438
      used with identifiers like "else", "finally", etc.
 
1439
      inside them
 
1440
 
 
1441
    .. change::
 
1442
        :tags: bugfixes
 
1443
        :tickets: 69
 
1444
 
 
1445
      fixed codegen bug which occured when using <%page>
 
1446
      level caching, combined with an expression-based
 
1447
      cache_key, combined with the usage of <%namespace
 
1448
      import="*"/> - fixed lexer exceptions not cleaning up
 
1449
      temporary files, which could lead to a maximum number
 
1450
      of file descriptors used in the process
 
1451
 
 
1452
    .. change::
 
1453
        :tags: bugfixes
 
1454
        :tickets: 71
 
1455
 
 
1456
      fixed issue with inline format_exceptions that was
 
1457
      producing blank exception pages when an inheriting
 
1458
      template is present
 
1459
 
 
1460
    .. change::
 
1461
        :tags: bugfixes
 
1462
        :tickets:
 
1463
 
 
1464
      format_exceptions will apply the encoding options of
 
1465
      html_error_template() to the buffered output
 
1466
 
 
1467
    .. change::
 
1468
        :tags: bugfixes
 
1469
        :tickets: 75
 
1470
 
 
1471
      rewrote the "whitespace adjuster" function to work
 
1472
      with more elaborate combinations of quotes and
 
1473
      comments
 
1474
 
 
1475
 
 
1476
.. changelog::
 
1477
    :version: 0.1.10
 
1478
    :released:
 
1479
 
 
1480
    .. change::
 
1481
        :tags:
 
1482
        :tickets:
 
1483
 
 
1484
      fixed propagation of 'caller' such that nested %def calls
 
1485
      within a <%call> tag's argument list propigates 'caller'
 
1486
      to the %call function itself (propigates to the inner
 
1487
      calls too, this is a slight side effect which previously
 
1488
      existed anyway)
 
1489
 
 
1490
    .. change::
 
1491
        :tags:
 
1492
        :tickets:
 
1493
 
 
1494
      fixed bug where local.get_namespace() could put an
 
1495
      incorrect "self" in the current context
 
1496
 
 
1497
    .. change::
 
1498
        :tags:
 
1499
        :tickets:
 
1500
 
 
1501
      fixed another namespace bug where the namespace functions
 
1502
      did not have access to the correct context containing
 
1503
      their 'self' and 'parent'
 
1504
 
 
1505
.. changelog::
 
1506
    :version: 0.1.9
 
1507
    :released:
 
1508
 
 
1509
    .. change::
 
1510
        :tags:
 
1511
        :tickets: 47
 
1512
 
 
1513
      filters.Decode filter can also accept a non-basestring
 
1514
      object and will call str() + unicode() on it
 
1515
 
 
1516
    .. change::
 
1517
        :tags:
 
1518
        :tickets: 53
 
1519
 
 
1520
      comments can be placed at the end of control lines,
 
1521
      i.e. if foo: # a comment,, thanks to
 
1522
      Paul Colomiets
 
1523
 
 
1524
    .. change::
 
1525
        :tags:
 
1526
        :tickets: 16
 
1527
 
 
1528
      fixed expressions and page tag arguments and with embedded
 
1529
      newlines in CRLF templates, follow up to, thanks
 
1530
      Eric Woroshow
 
1531
 
 
1532
    .. change::
 
1533
        :tags:
 
1534
        :tickets: 51
 
1535
 
 
1536
      added an IOError catch for source file not found in RichTraceback
 
1537
      exception reporter
 
1538
 
 
1539
.. changelog::
 
1540
    :version: 0.1.8
 
1541
    :released: Tue Jun 26 2007
 
1542
 
 
1543
    .. change::
 
1544
        :tags:
 
1545
        :tickets:
 
1546
 
 
1547
      variable names declared in render methods by internal
 
1548
      codegen prefixed by "__M_" to prevent name collisions
 
1549
      with user code
 
1550
 
 
1551
    .. change::
 
1552
        :tags:
 
1553
        :tickets: 45
 
1554
 
 
1555
      added a Babel (http://babel.edgewall.org/) extractor entry
 
1556
      point, allowing extraction of gettext messages directly from
 
1557
      mako templates via Babel
 
1558
 
 
1559
    .. change::
 
1560
        :tags:
 
1561
        :tickets:
 
1562
 
 
1563
      fix to turbogears plugin to work with dot-separated names
 
1564
      (i.e. load_template('foo.bar')).  also takes file extension
 
1565
      as a keyword argument (default is 'mak').
 
1566
 
 
1567
    .. change::
 
1568
        :tags:
 
1569
        :tickets: 35
 
1570
 
 
1571
      more tg fix:  fixed, allowing string-based
 
1572
      templates with tgplugin even if non-compatible args were sent
 
1573
 
 
1574
.. changelog::
 
1575
    :version: 0.1.7
 
1576
    :released: Wed Jun 13 2007
 
1577
 
 
1578
    .. change::
 
1579
        :tags:
 
1580
        :tickets:
 
1581
 
 
1582
      one small fix to the unit tests to support python 2.3
 
1583
 
 
1584
    .. change::
 
1585
        :tags:
 
1586
        :tickets:
 
1587
 
 
1588
      a slight hack to how cache.py detects Beaker's memcached,
 
1589
      works around unexplained import behavior observed on some
 
1590
      python 2.3 installations
 
1591
 
 
1592
.. changelog::
 
1593
    :version: 0.1.6
 
1594
    :released: Fri May 18 2007
 
1595
 
 
1596
    .. change::
 
1597
        :tags:
 
1598
        :tickets:
 
1599
 
 
1600
      caching is now supplied directly by Beaker, which has
 
1601
      all of MyghtyUtils merged into it now.  The latest Beaker
 
1602
      (0.7.1) also fixes a bug related to how Mako was using the
 
1603
      cache API.
 
1604
 
 
1605
    .. change::
 
1606
        :tags:
 
1607
        :tickets: 34
 
1608
 
 
1609
      fix to module_directory path generation when the path is "./"
 
1610
 
 
1611
    .. change::
 
1612
        :tags:
 
1613
        :tickets: 35
 
1614
 
 
1615
      TGPlugin passes options to string-based templates
 
1616
 
 
1617
    .. change::
 
1618
        :tags:
 
1619
        :tickets: 28
 
1620
 
 
1621
      added an explicit stack frame step to template runtime, which
 
1622
      allows much simpler and hopefully bug-free tracking of 'caller',
 
1623
      fixes
 
1624
 
 
1625
    .. change::
 
1626
        :tags:
 
1627
        :tickets:
 
1628
 
 
1629
      if plain Python defs are used with <%call>, a decorator
 
1630
      @runtime.supports_callable exists to ensure that the "caller"
 
1631
      stack is properly handled for the def.
 
1632
 
 
1633
    .. change::
 
1634
        :tags:
 
1635
        :tickets: 37
 
1636
 
 
1637
      fix to RichTraceback and exception reporting to get template
 
1638
      source code as a unicode object
 
1639
 
 
1640
    .. change::
 
1641
        :tags:
 
1642
        :tickets: 39
 
1643
 
 
1644
      html_error_template includes options "full=True", "css=True"
 
1645
      which control generation of HTML tags, CSS
 
1646
 
 
1647
    .. change::
 
1648
        :tags:
 
1649
        :tickets: 40
 
1650
 
 
1651
      added the 'encoding_errors' parameter to Template/TemplateLookup
 
1652
      for specifying the error handler associated with encoding to
 
1653
      'output_encoding'
 
1654
 
 
1655
    .. change::
 
1656
        :tags:
 
1657
        :tickets: 37
 
1658
 
 
1659
      the Template returned by html_error_template now defaults to
 
1660
      output_encoding=sys.getdefaultencoding(),
 
1661
      encoding_errors='htmlentityreplace'
 
1662
 
 
1663
    .. change::
 
1664
        :tags:
 
1665
        :tickets:
 
1666
 
 
1667
      control lines, i.e. % lines, support backslashes to continue long
 
1668
      lines (#32)
 
1669
 
 
1670
    .. change::
 
1671
        :tags:
 
1672
        :tickets:
 
1673
 
 
1674
      fixed codegen bug when defining <%def> within <%call> within <%call>
 
1675
 
 
1676
    .. change::
 
1677
        :tags:
 
1678
        :tickets:
 
1679
 
 
1680
      leading utf-8 BOM in template files is honored according to pep-0263
 
1681
 
 
1682
.. changelog::
 
1683
    :version: 0.1.5
 
1684
    :released: Sat Mar 31 2007
 
1685
 
 
1686
    .. change::
 
1687
        :tags:
 
1688
        :tickets: 26
 
1689
 
 
1690
      AST expression generation - added in just about everything
 
1691
      expression-wise from the AST module
 
1692
 
 
1693
    .. change::
 
1694
        :tags:
 
1695
        :tickets: 27
 
1696
 
 
1697
      AST parsing, properly detects imports of the form "import foo.bar"
 
1698
 
 
1699
    .. change::
 
1700
        :tags:
 
1701
        :tickets:
 
1702
 
 
1703
      fix to lexing of <%docs> tag nested in other tags
 
1704
 
 
1705
    .. change::
 
1706
        :tags:
 
1707
        :tickets: 29
 
1708
 
 
1709
      fix to context-arguments inside of <%include> tag which broke
 
1710
      during 0.1.4
 
1711
 
 
1712
    .. change::
 
1713
        :tags:
 
1714
        :tickets:
 
1715
 
 
1716
      added "n" filter, disables *all* filters normally applied to an expression
 
1717
      via <%page> or default_filters (but not those within the filter)
 
1718
 
 
1719
    .. change::
 
1720
        :tags:
 
1721
        :tickets:
 
1722
 
 
1723
      added buffer_filters argument, defines filters applied to the return value
 
1724
      of buffered/cached/filtered %defs, after all filters defined with the %def
 
1725
      itself have been applied.  allows the creation of default expression filters
 
1726
      that let the output of return-valued %defs "opt out" of that filtering
 
1727
      via passing special attributes or objects.
 
1728
 
 
1729
.. changelog::
 
1730
    :version: 0.1.4
 
1731
    :released: Sat Mar 10 2007
 
1732
 
 
1733
    .. change::
 
1734
        :tags:
 
1735
        :tickets:
 
1736
 
 
1737
      got defs-within-defs to be cacheable
 
1738
 
 
1739
    .. change::
 
1740
        :tags:
 
1741
        :tickets: 23
 
1742
 
 
1743
      fixes to code parsing/whitespace adjusting where plain python comments
 
1744
      may contain quote characters
 
1745
 
 
1746
    .. change::
 
1747
        :tags:
 
1748
        :tickets:
 
1749
 
 
1750
      fix to variable scoping for identifiers only referenced within
 
1751
      functions
 
1752
 
 
1753
    .. change::
 
1754
        :tags:
 
1755
        :tickets:
 
1756
 
 
1757
      added a path normalization step to lookup so URIs like
 
1758
      "/foo/bar/../etc/../foo" pre-process the ".." tokens before checking
 
1759
      the filesystem
 
1760
 
 
1761
    .. change::
 
1762
        :tags:
 
1763
        :tickets:
 
1764
 
 
1765
      fixed/improved "caller" semantics so that undefined caller is
 
1766
      "UNDEFINED", propigates __nonzero__ method so it evaulates to False if
 
1767
      not present, True otherwise. this way you can say % if caller:\n
 
1768
      ${caller.body()}\n% endif
 
1769
 
 
1770
    .. change::
 
1771
        :tags:
 
1772
        :tickets:
 
1773
 
 
1774
      <%include> has an "args" attribute that can pass arguments to the
 
1775
      called template (keyword arguments only, must be declared in that
 
1776
      page's <%page> tag.)
 
1777
 
 
1778
    .. change::
 
1779
        :tags:
 
1780
        :tickets:
 
1781
 
 
1782
      <%include> plus arguments is also programmatically available via
 
1783
      self.include_file(<filename>, **kwargs)
 
1784
 
 
1785
    .. change::
 
1786
        :tags:
 
1787
        :tickets: 24
 
1788
 
 
1789
      further escaping added for multibyte expressions in %def, %call
 
1790
      attributes
 
1791
 
 
1792
.. changelog::
 
1793
    :version: 0.1.3
 
1794
    :released: Wed Feb 21 2007
 
1795
 
 
1796
    .. change::
 
1797
        :tags:
 
1798
        :tickets:
 
1799
 
 
1800
      ***Small Syntax Change*** - the single line comment character is now
 
1801
      *two* hash signs, i.e. "## this is a comment".  This avoids a common
 
1802
      collection with CSS selectors.
 
1803
 
 
1804
    .. change::
 
1805
        :tags:
 
1806
        :tickets:
 
1807
 
 
1808
      the magic "coding" comment (i.e. # coding:utf-8) will still work with
 
1809
      either one "#" sign or two for now; two is preferred going forward, i.e.
 
1810
      ## coding:<someencoding>.
 
1811
 
 
1812
    .. change::
 
1813
        :tags:
 
1814
        :tickets:
 
1815
 
 
1816
      new multiline comment form: "<%doc> a comment </%doc>"
 
1817
 
 
1818
    .. change::
 
1819
        :tags:
 
1820
        :tickets:
 
1821
 
 
1822
      UNDEFINED evaluates to False
 
1823
 
 
1824
    .. change::
 
1825
        :tags:
 
1826
        :tickets:
 
1827
 
 
1828
      improvement to scoping of "caller" variable when using <%call> tag
 
1829
 
 
1830
    .. change::
 
1831
        :tags:
 
1832
        :tickets:
 
1833
 
 
1834
      added lexer error for unclosed control-line (%) line
 
1835
 
 
1836
    .. change::
 
1837
        :tags:
 
1838
        :tickets:
 
1839
 
 
1840
      added "preprocessor" argument to Template, TemplateLookup - is a single
 
1841
      callable or list of callables which will be applied to the template text
 
1842
      before lexing.  given the text as an argument, returns the new text.
 
1843
 
 
1844
    .. change::
 
1845
        :tags:
 
1846
        :tickets:
 
1847
 
 
1848
      added mako.ext.preprocessors package, contains one preprocessor so far:
 
1849
      'convert_comments', which will convert single # comments to the new ##
 
1850
      format
 
1851
 
 
1852
.. changelog::
 
1853
    :version: 0.1.2
 
1854
    :released: Thu Feb  1 2007
 
1855
 
 
1856
    .. change::
 
1857
        :tags:
 
1858
        :tickets: 11
 
1859
 
 
1860
      fix to parsing of code/expression blocks to insure that non-ascii
 
1861
      characters, combined with a template that indicates a non-standard
 
1862
      encoding, are expanded into backslash-escaped glyphs before being AST
 
1863
      parsed
 
1864
 
 
1865
    .. change::
 
1866
        :tags:
 
1867
        :tickets:
 
1868
 
 
1869
      all template lexing converts the template to unicode first, to
 
1870
      immediately catch any encoding issues and ensure internal unicode
 
1871
      representation.
 
1872
 
 
1873
    .. change::
 
1874
        :tags:
 
1875
        :tickets:
 
1876
 
 
1877
      added module_filename argument to Template to allow specification of a
 
1878
      specific module file
 
1879
 
 
1880
    .. change::
 
1881
        :tags:
 
1882
        :tickets: 14
 
1883
 
 
1884
      added modulename_callable to TemplateLookup to allow a function to
 
1885
      determine module filenames (takes filename, uri arguments). used for
 
1886
 
 
1887
    .. change::
 
1888
        :tags:
 
1889
        :tickets:
 
1890
 
 
1891
      added optional input_encoding flag to Template, to allow sending a
 
1892
      unicode() object with no magic encoding comment
 
1893
 
 
1894
    .. change::
 
1895
        :tags:
 
1896
        :tickets:
 
1897
 
 
1898
      "expression_filter" argument in <%page> applies only to expressions
 
1899
 
 
1900
    .. change::
 
1901
        :tags: "unicode"
 
1902
        :tickets:
 
1903
 
 
1904
      added "default_filters" argument to Template, TemplateLookup. applies only
 
1905
      to expressions, gets prepended to "expression_filter" arg from <%page>.
 
1906
      defaults to, so that all expressions get stringified into u''
 
1907
      by default (this is what Mako already does). By setting to [], expressions
 
1908
      are passed through raw.
 
1909
 
 
1910
    .. change::
 
1911
        :tags:
 
1912
        :tickets:
 
1913
 
 
1914
      added "imports" argument to Template, TemplateLookup. so you can predefine
 
1915
      a list of import statements at the top of the template. can be used in
 
1916
      conjunction with default_filters.
 
1917
 
 
1918
    .. change::
 
1919
        :tags:
 
1920
        :tickets: 16
 
1921
 
 
1922
      support for CRLF templates...whoops ! welcome to all the windows users.
 
1923
 
 
1924
    .. change::
 
1925
        :tags:
 
1926
        :tickets:
 
1927
 
 
1928
      small fix to local variable propigation for locals that are conditionally
 
1929
      declared
 
1930
 
 
1931
    .. change::
 
1932
        :tags:
 
1933
        :tickets:
 
1934
 
 
1935
      got "top level" def calls to work, i.e. template.get_def("somedef").render()
 
1936
 
 
1937
.. changelog::
 
1938
    :version: 0.1.1
 
1939
    :released: Sun Jan 14 2007
 
1940
 
 
1941
    .. change::
 
1942
        :tags:
 
1943
        :tickets: 8
 
1944
 
 
1945
      buffet plugin supports string-based templates, allows ToscaWidgets to work
 
1946
 
 
1947
    .. change::
 
1948
        :tags:
 
1949
        :tickets:
 
1950
 
 
1951
      AST parsing fixes: fixed TryExcept identifier parsing
 
1952
 
 
1953
    .. change::
 
1954
        :tags:
 
1955
        :tickets:
 
1956
 
 
1957
      removed textmate tmbundle from contrib and into separate SVN location;
 
1958
      windows users cant handle those files, setuptools not very good at
 
1959
      "pruning" certain directories
 
1960
 
 
1961
    .. change::
 
1962
        :tags:
 
1963
        :tickets:
 
1964
 
 
1965
      fix so that "cache_timeout" parameter is propigated
 
1966
 
 
1967
    .. change::
 
1968
        :tags:
 
1969
        :tickets:
 
1970
 
 
1971
      fix to expression filters so that string conversion (actually unicode)
 
1972
      properly occurs before filtering
 
1973
 
 
1974
    .. change::
 
1975
        :tags:
 
1976
        :tickets:
 
1977
 
 
1978
      better error message when a lookup is attempted with a template that has no
 
1979
      lookup
 
1980
 
 
1981
    .. change::
 
1982
        :tags:
 
1983
        :tickets:
 
1984
 
 
1985
      implemented "module" attribute for namespace
 
1986
 
 
1987
    .. change::
 
1988
        :tags:
 
1989
        :tickets:
 
1990
 
 
1991
      fix to code generation to correctly track multiple defs with the same name
 
1992
 
 
1993
    .. change::
 
1994
        :tags:
 
1995
        :tickets: 9
 
1996
 
 
1997
      "directories" can be passed to TemplateLookup as a scalar in which case it
 
1998
      gets converted to a list