CHANGES 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825
  1. 0.7.2
  2. - [bug] Fixed regression in 0.7.1 where AST
  3. parsing for Py2.4 was broken.
  4. [ticket:193]
  5. 0.7.1
  6. - [feature] Control lines with no bodies will
  7. now succeed, as "pass" is added for these
  8. when no statements are otherwise present.
  9. Courtesy Ben Trofatter [ticket:146]
  10. - [bug] Fixed some long-broken scoping behavior
  11. involving variables declared in defs and such,
  12. which only became apparent when
  13. the strict_undefined flag was turned on.
  14. [ticket:192]
  15. - [bug] Can now use strict_undefined at the
  16. same time args passed to def() are used
  17. by other elements of the <%def> tag.
  18. [ticket:191]
  19. 0.7.0
  20. - [feature] Added new "loop" variable to templates,
  21. is provided within a % for block to provide
  22. info about the loop such as index, first/last,
  23. odd/even, etc. A migration path is also provided
  24. for legacy templates via the "enable_loop" argument
  25. available on Template, TemplateLookup, and <%page>.
  26. Thanks to Ben Trofatter for all
  27. the work on this [ticket:125]
  28. - [feature] Added a real check for "reserved"
  29. names, that is names which are never pulled
  30. from the context and cannot be passed to
  31. the template.render() method. Current names
  32. are "context", "loop", "UNDEFINED".
  33. - [feature] The html_error_template() will now
  34. apply Pygments highlighting to the source
  35. code displayed in the traceback, if Pygments
  36. if available. Courtesy Ben Trofatter
  37. [ticket:95]
  38. - [feature] Added support for context managers,
  39. i.e. "% with x as e:/ % endwith" support.
  40. Courtesy Ben Trofatter [ticket:147]
  41. - [feature] Added class-level flag to CacheImpl
  42. "pass_context"; when True, the keyword argument
  43. 'context' will be passed to get_or_create()
  44. containing the Mako Context object.
  45. [ticket:185]
  46. - [bug] Fixed some Py3K resource warnings due
  47. to filehandles being implicitly closed.
  48. [ticket:182]
  49. - [bug] Fixed endless recursion bug when
  50. nesting multiple def-calls with content.
  51. Thanks to Jeff Dairiki. [ticket:186]
  52. - [feature] Added Jinja2 to the example
  53. benchmark suite, courtesy Vincent Férotin
  54. 0.6.2
  55. - [bug] The ${{"foo":"bar"}} parsing issue is fixed!!
  56. The legendary Eevee has slain the dragon!
  57. [ticket:20]. Also fixes quoting issue
  58. at [ticket:86].
  59. 0.6.1
  60. - [bug] Added special compatibility for the 0.5.0
  61. Cache() constructor, which was preventing file
  62. version checks and not allowing Mako 0.6 to
  63. recompile the module files.
  64. 0.6.0
  65. - [feature] Template caching has been converted into a plugin
  66. system, whereby the usage of Beaker is just the
  67. default plugin. Template and TemplateLookup
  68. now accept a string "cache_impl" parameter which
  69. refers to the name of a cache plugin, defaulting
  70. to the name 'beaker'. New plugins can be
  71. registered as pkg_resources entrypoints under
  72. the group "mako.cache", or registered directly
  73. using mako.cache.register_plugin(). The
  74. core plugin is the mako.cache.CacheImpl
  75. class.
  76. - [feature] Added support for Beaker cache regions
  77. in templates. Usage of regions should be considered
  78. as superseding the very obsolete idea of passing in
  79. backend options, timeouts, etc. within templates.
  80. - [feature] The 'put' method on Cache is now
  81. 'set'. 'put' is there for backwards compatibility.
  82. - [feature] The <%def>, <%block> and <%page> tags now accept
  83. any argument named "cache_*", and the key
  84. minus the "cache_" prefix will be passed as keyword
  85. arguments to the CacheImpl methods.
  86. - [feature] Template and TemplateLookup now accept an argument
  87. cache_args, which refers to a dictionary containing
  88. cache parameters. The cache_dir, cache_url, cache_type,
  89. cache_timeout arguments are deprecated (will probably
  90. never be removed, however) and can be passed
  91. now as cache_args={'url':<some url>, 'type':'memcached',
  92. 'timeout':50, 'dir':'/path/to/some/directory'}
  93. - [feature/bug] Can now refer to context variables
  94. within extra arguments to <%block>, <%def>, i.e.
  95. <%block name="foo" cache_key="${somekey}">.
  96. Filters can also be used in this way, i.e.
  97. <%def name="foo()" filter="myfilter">
  98. then template.render(myfilter=some_callable)
  99. [ticket:180]
  100. - [feature] Added "--var name=value" option to the mako-render
  101. script, allows passing of kw to the template from
  102. the command line. [ticket:178]
  103. - [feature] Added module_writer argument to Template,
  104. TemplateLookup, allows a callable to be passed which
  105. takes over the writing of the template's module source
  106. file, so that special environment-specific steps
  107. can be taken. [ticket:181]
  108. - [bug] The exception message in the html_error_template
  109. is now escaped with the HTML filter. [ticket:142]
  110. - [bug] Added "white-space:pre" style to html_error_template()
  111. for code blocks so that indentation is preserved
  112. [ticket:173]
  113. - [bug] The "benchmark" example is now Python 3 compatible
  114. (even though several of those old template libs aren't
  115. available on Py3K, so YMMV) [ticket:175]
  116. 0.5
  117. - A Template is explicitly disallowed
  118. from having a url that normalizes to relative outside
  119. of the root. That is, if the Lookup is based
  120. at /home/mytemplates, an include that would place
  121. the ultimate template at
  122. /home/mytemplates/../some_other_directory,
  123. i.e. outside of /home/mytemplates,
  124. is disallowed. This usage was never intended
  125. despite the lack of an explicit check.
  126. The main issue this causes
  127. is that module files can be written outside
  128. of the module root (or raise an error, if file perms aren't
  129. set up), and can also lead to the same template being
  130. cached in the lookup under multiple, relative roots.
  131. TemplateLookup instead has always supported multiple
  132. file roots for this purpose.
  133. [ticket:174]
  134. 0.4.2
  135. - Fixed bug regarding <%call>/def calls w/ content
  136. whereby the identity of the "caller" callable
  137. inside the <%def> would be corrupted by the
  138. presence of another <%call> in the same block.
  139. [ticket:170]
  140. - Fixed the babel plugin to accommodate <%block>
  141. [ticket:169]
  142. 0.4.1
  143. - New tag: <%block>. A variant on <%def> that
  144. evaluates its contents in-place.
  145. Can be named or anonymous,
  146. the named version is intended for inheritance
  147. layouts where any given section can be
  148. surrounded by the <%block> tag in order for
  149. it to become overrideable by inheriting
  150. templates, without the need to specify a
  151. top-level <%def> plus explicit call.
  152. Modified scoping and argument rules as well as a
  153. more strictly enforced usage scheme make it ideal
  154. for this purpose without at all replacing most
  155. other things that defs are still good for.
  156. Lots of new docs. [ticket:164]
  157. - a slight adjustment to the "highlight" logic
  158. for generating template bound stacktraces.
  159. Will stick to known template source lines
  160. without any extra guessing. [ticket:165]
  161. 0.4.0
  162. - A 20% speedup for a basic two-page
  163. inheritance setup rendering
  164. a table of escaped data
  165. (see http://techspot.zzzeek.org/2010/11/19/quick-mako-vs.-jinja-speed-test/).
  166. A few configurational changes which
  167. affect those in the I-don't-do-unicode
  168. camp should be noted below.
  169. - The FastEncodingBuffer is now used
  170. by default instead of cStringIO or StringIO,
  171. regardless of whether output_encoding
  172. is set to None or not. FEB is faster than
  173. both. Only StringIO allows bytestrings
  174. of unknown encoding to pass right
  175. through, however - while it is of course
  176. not recommended to send bytestrings of unknown
  177. encoding to the output stream, this
  178. mode of usage can be re-enabled by
  179. setting the flag bytestring_passthrough
  180. to True.
  181. - disable_unicode mode requires that
  182. output_encoding be set to None - it also
  183. forces the bytestring_passthrough flag
  184. to True.
  185. - the <%namespace> tag raises an error
  186. if the 'template' and 'module' attributes
  187. are specified at the same time in
  188. one tag. A different class is used
  189. for each case which allows a reduction in
  190. runtime conditional logic and function
  191. call overhead. [ticket:156]
  192. - the keys() in the Context, as well as
  193. it's internal _data dictionary, now
  194. include just what was specified to
  195. render() as well as Mako builtins
  196. 'caller', 'capture'. The contents
  197. of __builtin__ are no longer copied.
  198. Thanks to Daniel Lopez for pointing
  199. this out. [ticket:159]
  200. 0.3.6
  201. - Documentation is on Sphinx.
  202. [ticket:126]
  203. - Beaker is now part of "extras" in
  204. setup.py instead of "install_requires".
  205. This to produce a lighter weight install
  206. for those who don't use the caching
  207. as well as to conform to Pyramid
  208. deployment practices. [ticket:154]
  209. - The Beaker import (or attempt thereof)
  210. is delayed until actually needed;
  211. this to remove the performance penalty
  212. from startup, particularly for
  213. "single execution" environments
  214. such as shell scripts. [ticket:153]
  215. - Patch to lexer to not generate an empty
  216. '' write in the case of backslash-ended
  217. lines. [ticket:155]
  218. - Fixed missing **extra collection in
  219. setup.py which prevented setup.py
  220. from running 2to3 on install.
  221. [ticket:148]
  222. - New flag on Template, TemplateLookup -
  223. strict_undefined=True, will cause
  224. variables not found in the context to
  225. raise a NameError immediately, instead of
  226. defaulting to the UNDEFINED value.
  227. - The range of Python identifiers that
  228. are considered "undefined", meaning they
  229. are pulled from the context, has been
  230. trimmed back to not include variables
  231. declared inside of expressions (i.e. from
  232. list comprehensions), as well as
  233. in the argument list of lambdas. This
  234. to better support the strict_undefined
  235. feature. The change should be
  236. fully backwards-compatible but involved
  237. a little bit of tinkering in the AST code,
  238. which hadn't really been touched for
  239. a couple of years, just FYI.
  240. 0.3.5
  241. - The <%namespace> tag allows expressions
  242. for the `file` argument, i.e. with ${}.
  243. The `context` variable, if needed,
  244. must be referenced explicitly.
  245. [ticket:141]
  246. - ${} expressions embedded in tags,
  247. such as <%foo:bar x="${...}">, now
  248. allow multiline Python expressions.
  249. - Fixed previously non-covered regular
  250. expression, such that using a ${} expression
  251. inside of a tag element that doesn't allow
  252. them raises a CompileException instead of
  253. silently failing.
  254. - Added a try/except around "import markupsafe".
  255. This to support GAE which can't run markupsafe.
  256. [ticket:151] No idea whatsoever if the
  257. install_requires in setup.py also breaks GAE,
  258. couldn't get an answer on this.
  259. 0.3.4
  260. - Now using MarkupSafe for HTML escaping,
  261. i.e. in place of cgi.escape(). Faster
  262. C-based implementation and also escapes
  263. single quotes for additional security.
  264. Supports the __html__ attribute for
  265. the given expression as well.
  266. When using "disable_unicode" mode,
  267. a pure Python HTML escaper function
  268. is used which also quotes single quotes.
  269. Note that Pylons by default doesn't
  270. use Mako's filter - check your
  271. environment.py file.
  272. - Fixed call to "unicode.strip" in
  273. exceptions.text_error_template which
  274. is not Py3k compatible. [ticket:137]
  275. 0.3.3
  276. - Added conditional to RichTraceback
  277. such that if no traceback is passed
  278. and sys.exc_info() has been reset,
  279. the formatter just returns blank
  280. for the "traceback" portion.
  281. [ticket:135]
  282. - Fixed sometimes incorrect usage of
  283. exc.__class__.__name__
  284. in html/text error templates when using
  285. Python 2.4 [ticket:131]
  286. - Fixed broken @property decorator on
  287. template.last_modified
  288. - Fixed error formatting when a stacktrace
  289. line contains no line number, as in when
  290. inside an eval/exec-generated function.
  291. [ticket:132]
  292. - When a .py is being created, the tempfile
  293. where the source is stored temporarily is
  294. now made in the same directory as that of
  295. the .py file. This ensures that the two
  296. files share the same filesystem, thus
  297. avoiding cross-filesystem synchronization
  298. issues. Thanks to Charles Cazabon.
  299. 0.3.2
  300. - Calling a def from the top, via
  301. template.get_def(...).render() now checks the
  302. argument signature the same way as it did in
  303. 0.2.5, so that TypeError is not raised.
  304. reopen of [ticket:116]
  305. 0.3.1
  306. - Fixed incorrect dir name in setup.py
  307. [ticket:129]
  308. 0.3
  309. - Python 2.3 support is dropped. [ticket:123]
  310. - Python 3 support is added ! See README.py3k
  311. for installation and testing notes.
  312. [ticket:119]
  313. - Unit tests now run with nose. [ticket:127]
  314. - Source code escaping has been simplified.
  315. In particular, module source files are now
  316. generated with the Python "magic encoding
  317. comment", and source code is passed through
  318. mostly unescaped, except for that code which
  319. is regenerated from parsed Python source.
  320. This fixes usage of unicode in
  321. <%namespace:defname> tags. [ticket:99]
  322. - RichTraceback(), html_error_template().render(),
  323. text_error_template().render() now accept "error"
  324. and "traceback" as optional arguments, and
  325. these are now actually used. [ticket:122]
  326. - The exception output generated when
  327. format_exceptions=True will now be as a Python
  328. unicode if it occurred during render_unicode(),
  329. or an encoded string if during render().
  330. - A percent sign can be emitted as the first
  331. non-whitespace character on a line by escaping
  332. it as in "%%". [ticket:112]
  333. - Template accepts empty control structure, i.e.
  334. % if: %endif, etc. [ticket:94]
  335. - The <%page args> tag can now be used in a base
  336. inheriting template - the full set of render()
  337. arguments are passed down through the inherits
  338. chain. Undeclared arguments go into **pageargs
  339. as usual. [ticket:116]
  340. - defs declared within a <%namespace> section, an
  341. uncommon feature, have been improved. The defs
  342. no longer get doubly-rendered in the body() scope,
  343. and now allow local variable assignment without
  344. breakage. [ticket:109]
  345. - Windows paths are handled correctly if a Template
  346. is passed only an absolute filename (i.e. with c:
  347. drive etc.) and no URI - the URI is converted
  348. to a forward-slash path and module_directory
  349. is treated as a windows path. [ticket:128]
  350. - TemplateLookup raises TopLevelLookupException for
  351. a given path that is a directory, not a filename,
  352. instead of passing through to the template to
  353. generate IOError. [ticket:73]
  354. 0.2.6
  355. - Fix mako function decorators to preserve the
  356. original function's name in all cases. Patch
  357. from Scott Torborg.
  358. - Support the <%namespacename:defname> syntax in
  359. the babel extractor. [ticket:118]
  360. - Further fixes to unicode handling of .py files with the
  361. html_error_template. [ticket:88]
  362. 0.2.5
  363. - Added a "decorator" kw argument to <%def>,
  364. allows custom decoration functions to wrap
  365. rendering callables. Mainly intended for
  366. custom caching algorithms, not sure what
  367. other uses there may be (but there may be).
  368. Examples are in the "filtering" docs.
  369. - When Mako creates subdirectories in which
  370. to store templates, it uses the more
  371. permissive mode of 0775 instead of 0750,
  372. helping out with certain multi-process
  373. scenarios. Note that the mode is always
  374. subject to the restrictions of the existing
  375. umask. [ticket:101]
  376. - Fixed namespace.__getattr__() to raise
  377. AttributeError on attribute not found
  378. instead of RuntimeError. [ticket:104]
  379. - Added last_modified accessor to Template,
  380. returns the time.time() when the module
  381. was created. [ticket:97]
  382. - Fixed lexing support for whitespace
  383. around '=' sign in defs. [ticket:102]
  384. - Removed errant "lower()" in the lexer which
  385. was causing tags to compile with
  386. case-insensitive names, thus messing up
  387. custom <%call> names. [ticket:108]
  388. - added "mako.__version__" attribute to
  389. the base module. [ticket:110]
  390. 0.2.4
  391. - Fixed compatibility with Jython 2.5b1.
  392. 0.2.3
  393. - the <%namespacename:defname> syntax described at
  394. http://techspot.zzzeek.org/?p=28 has now
  395. been added as a built in syntax, and is recommended
  396. as a more modern syntax versus <%call expr="expression">.
  397. The %call tag itself will always remain,
  398. with <%namespacename:defname> presenting a more HTML-like
  399. alternative to calling defs, both plain and
  400. nested. Many examples of the new syntax are in the
  401. "Calling a def with embedded content" section
  402. of the docs.
  403. - added support for Jython 2.5.
  404. - cache module now uses Beaker's CacheManager
  405. object directly, so that all cache types are included.
  406. memcached is available as both "ext:memcached" and
  407. "memcached", the latter for backwards compatibility.
  408. - added "cache" accessor to Template, Namespace.
  409. e.g. ${local.cache.get('somekey')} or
  410. template.cache.invalidate_body()
  411. - added "cache_enabled=True" flag to Template,
  412. TemplateLookup. Setting this to False causes cache
  413. operations to "pass through" and execute every time;
  414. this flag should be integrated in Pylons with its own
  415. cache_enabled configuration setting.
  416. - the Cache object now supports invalidate_def(name),
  417. invalidate_body(), invalidate_closure(name),
  418. invalidate(key), which will remove the given key
  419. from the cache, if it exists. The cache arguments
  420. (i.e. storage type) are derived from whatever has
  421. been already persisted for that template.
  422. [ticket:92]
  423. - For cache changes to work fully, Beaker 1.1 is required.
  424. 1.0.1 and up will work as well with the exception of
  425. cache expiry. Note that Beaker 1.1 is **required**
  426. for applications which use dynamically generated keys,
  427. since previous versions will permanently store state in memory
  428. for each individual key, thus consuming all available
  429. memory for an arbitrarily large number of distinct
  430. keys.
  431. - fixed bug whereby an <%included> template with
  432. <%page> args named the same as a __builtin__ would not
  433. honor the default value specified in <%page> [ticket:93]
  434. - fixed the html_error_template not handling tracebacks from
  435. normal .py files with a magic encoding comment [ticket:88]
  436. - RichTraceback() now accepts an optional traceback object
  437. to be used in place of sys.exc_info()[2]. html_error_template()
  438. and text_error_template() accept an optional
  439. render()-time argument "traceback" which is passed to the
  440. RichTraceback object.
  441. - added ModuleTemplate class, which allows the construction
  442. of a Template given a Python module generated by a previous
  443. Template. This allows Python modules alone to be used
  444. as templates with no compilation step. Source code
  445. and template source are optional but allow error reporting
  446. to work correctly.
  447. - fixed Python 2.3 compat. in mako.pyparser [ticket:90]
  448. - fix Babel 0.9.3 compatibility; stripping comment tags is now
  449. optional (and enabled by default).
  450. 0.2.2
  451. - cached blocks now use the current context when rendering
  452. an expired section, instead of the original context
  453. passed in [ticket:87]
  454. - fixed a critical issue regarding caching, whereby
  455. a cached block would raise an error when called within a
  456. cache-refresh operation that was initiated after the
  457. initiating template had completed rendering.
  458. 0.2.1
  459. - fixed bug where 'output_encoding' parameter would prevent
  460. render_unicode() from returning a unicode object.
  461. - bumped magic number, which forces template recompile for
  462. this version (fixes incompatible compile symbols from 0.1
  463. series).
  464. - added a few docs for cache options, specifically those that
  465. help with memcached.
  466. 0.2.0
  467. - Speed improvements (as though we needed them, but people
  468. contributed and there you go):
  469. - added "bytestring passthru" mode, via
  470. `disable_unicode=True` argument passed to Template or
  471. TemplateLookup. All unicode-awareness and filtering is
  472. turned off, and template modules are generated with
  473. the appropriate magic encoding comment. In this mode,
  474. template expressions can only receive raw bytestrings
  475. or Unicode objects which represent straight ASCII, and
  476. render_unicode() may not be used if multibyte
  477. characters are present. When enabled, speed
  478. improvement around 10-20%. [ticket:77] (courtesy
  479. anonymous guest)
  480. - inlined the "write" function of Context into a local
  481. template variable. This affords a 12-30% speedup in
  482. template render time. (idea courtesy same anonymous
  483. guest) [ticket:76]
  484. - New Features, API changes:
  485. - added "attr" accessor to namespaces. Returns
  486. attributes configured as module level attributes, i.e.
  487. within <%! %> sections. [ticket:62] i.e.:
  488. # somefile.html
  489. <%!
  490. foo = 27
  491. %>
  492. # some other template
  493. <%namespace name="myns" file="somefile.html"/>
  494. ${myns.attr.foo}
  495. The slight backwards incompatibility here is, you
  496. can't have namespace defs named "attr" since the
  497. "attr" descriptor will occlude it.
  498. - cache_key argument can now render arguments passed
  499. directly to the %page or %def, i.e. <%def
  500. name="foo(x)" cached="True" cache_key="${x}"/>
  501. [ticket:78]
  502. - some functions on Context are now private:
  503. _push_buffer(), _pop_buffer(),
  504. caller_stack._push_frame(), caller_stack._pop_frame().
  505. - added a runner script "mako-render" which renders
  506. standard input as a template to stdout [ticket:81]
  507. [ticket:56]
  508. - Bugfixes:
  509. - can now use most names from __builtins__ as variable
  510. names without explicit declaration (i.e. 'id',
  511. 'exception', 'range', etc.) [ticket:83] [ticket:84]
  512. - can also use builtin names as local variable names
  513. (i.e. dict, locals) (came from fix for [ticket:84])
  514. - fixed bug in python generation when variable names are
  515. used with identifiers like "else", "finally", etc.
  516. inside them [ticket:68]
  517. - fixed codegen bug which occured when using <%page>
  518. level caching, combined with an expression-based
  519. cache_key, combined with the usage of <%namespace
  520. import="*"/> - fixed lexer exceptions not cleaning up
  521. temporary files, which could lead to a maximum number
  522. of file descriptors used in the process [ticket:69]
  523. - fixed issue with inline format_exceptions that was
  524. producing blank exception pages when an inheriting
  525. template is present [ticket:71]
  526. - format_exceptions will apply the encoding options of
  527. html_error_template() to the buffered output
  528. - rewrote the "whitespace adjuster" function to work
  529. with more elaborate combinations of quotes and
  530. comments [ticket:75]
  531. 0.1.10
  532. - fixed propagation of 'caller' such that nested %def calls
  533. within a <%call> tag's argument list propigates 'caller'
  534. to the %call function itself (propigates to the inner
  535. calls too, this is a slight side effect which previously
  536. existed anyway)
  537. - fixed bug where local.get_namespace() could put an
  538. incorrect "self" in the current context
  539. - fixed another namespace bug where the namespace functions
  540. did not have access to the correct context containing
  541. their 'self' and 'parent'
  542. 0.1.9
  543. - filters.Decode filter can also accept a non-basestring
  544. object and will call str() + unicode() on it [ticket:47]
  545. - comments can be placed at the end of control lines,
  546. i.e. if foo: # a comment, [ticket:53], thanks to
  547. Paul Colomiets
  548. - fixed expressions and page tag arguments and with embedded
  549. newlines in CRLF templates, follow up to [ticket:16], thanks
  550. Eric Woroshow
  551. - added an IOError catch for source file not found in RichTraceback
  552. exception reporter [ticket:51]
  553. 0.1.8
  554. - variable names declared in render methods by internal
  555. codegen prefixed by "__M_" to prevent name collisions
  556. with user code
  557. - added a Babel (http://babel.edgewall.org/) extractor entry
  558. point, allowing extraction of gettext messages directly from
  559. mako templates via Babel [ticket:45]
  560. - fix to turbogears plugin to work with dot-separated names
  561. (i.e. load_template('foo.bar')). also takes file extension
  562. as a keyword argument (default is 'mak').
  563. - more tg fix: fixed [ticket:35], allowing string-based
  564. templates with tgplugin even if non-compatible args were sent
  565. 0.1.7
  566. - one small fix to the unit tests to support python 2.3
  567. - a slight hack to how cache.py detects Beaker's memcached,
  568. works around unexplained import behavior observed on some
  569. python 2.3 installations
  570. 0.1.6
  571. - caching is now supplied directly by Beaker, which has
  572. all of MyghtyUtils merged into it now. The latest Beaker
  573. (0.7.1) also fixes a bug related to how Mako was using the
  574. cache API.
  575. - fix to module_directory path generation when the path is "./"
  576. [ticket:34]
  577. - TGPlugin passes options to string-based templates [ticket:35]
  578. - added an explicit stack frame step to template runtime, which
  579. allows much simpler and hopefully bug-free tracking of 'caller',
  580. fixes #28
  581. - if plain Python defs are used with <%call>, a decorator
  582. @runtime.supports_callable exists to ensure that the "caller"
  583. stack is properly handled for the def.
  584. - fix to RichTraceback and exception reporting to get template
  585. source code as a unicode object #37
  586. - html_error_template includes options "full=True", "css=True"
  587. which control generation of HTML tags, CSS [ticket:39]
  588. - added the 'encoding_errors' parameter to Template/TemplateLookup
  589. for specifying the error handler associated with encoding to
  590. 'output_encoding' [ticket:40]
  591. - the Template returned by html_error_template now defaults to
  592. output_encoding=sys.getdefaultencoding(),
  593. encoding_errors='htmlentityreplace' [ticket:37]
  594. - control lines, i.e. % lines, support backslashes to continue long
  595. lines (#32)
  596. - fixed codegen bug when defining <%def> within <%call> within <%call>
  597. - leading utf-8 BOM in template files is honored according to pep-0263
  598. 0.1.5
  599. - AST expression generation - added in just about everything
  600. expression-wise from the AST module [ticket:26]
  601. - AST parsing, properly detects imports of the form "import foo.bar"
  602. [ticket:27]
  603. - fix to lexing of <%docs> tag nested in other tags
  604. - fix to context-arguments inside of <%include> tag which broke
  605. during 0.1.4 [ticket:29]
  606. - added "n" filter, disables *all* filters normally applied to an expression
  607. via <%page> or default_filters (but not those within the filter)
  608. - added buffer_filters argument, defines filters applied to the return value
  609. of buffered/cached/filtered %defs, after all filters defined with the %def
  610. itself have been applied. allows the creation of default expression filters
  611. that let the output of return-valued %defs "opt out" of that filtering
  612. via passing special attributes or objects.
  613. 0.1.4
  614. - got defs-within-defs to be cacheable
  615. - fixes to code parsing/whitespace adjusting where plain python comments
  616. may contain quote characters [ticket:23]
  617. - fix to variable scoping for identifiers only referenced within
  618. functions
  619. - added a path normalization step to lookup so URIs like
  620. "/foo/bar/../etc/../foo" pre-process the ".." tokens before checking
  621. the filesystem
  622. - fixed/improved "caller" semantics so that undefined caller is
  623. "UNDEFINED", propigates __nonzero__ method so it evaulates to False if
  624. not present, True otherwise. this way you can say % if caller:\n
  625. ${caller.body()}\n% endif
  626. - <%include> has an "args" attribute that can pass arguments to the
  627. called template (keyword arguments only, must be declared in that
  628. page's <%page> tag.)
  629. - <%include> plus arguments is also programmatically available via
  630. self.include_file(<filename>, **kwargs)
  631. - further escaping added for multibyte expressions in %def, %call
  632. attributes [ticket:24]
  633. 0.1.3
  634. - ***Small Syntax Change*** - the single line comment character is now
  635. *two* hash signs, i.e. "## this is a comment". This avoids a common
  636. collection with CSS selectors.
  637. - the magic "coding" comment (i.e. # coding:utf-8) will still work with
  638. either one "#" sign or two for now; two is preferred going forward, i.e.
  639. ## coding:<someencoding>.
  640. - new multiline comment form: "<%doc> a comment </%doc>"
  641. - UNDEFINED evaluates to False
  642. - improvement to scoping of "caller" variable when using <%call> tag
  643. - added lexer error for unclosed control-line (%) line
  644. - added "preprocessor" argument to Template, TemplateLookup - is a single
  645. callable or list of callables which will be applied to the template text
  646. before lexing. given the text as an argument, returns the new text.
  647. - added mako.ext.preprocessors package, contains one preprocessor so far:
  648. 'convert_comments', which will convert single # comments to the new ##
  649. format
  650. 0.1.2
  651. - fix to parsing of code/expression blocks to insure that non-ascii
  652. characters, combined with a template that indicates a non-standard
  653. encoding, are expanded into backslash-escaped glyphs before being AST
  654. parsed [ticket:11]
  655. - all template lexing converts the template to unicode first, to
  656. immediately catch any encoding issues and ensure internal unicode
  657. representation.
  658. - added module_filename argument to Template to allow specification of a
  659. specific module file
  660. - added modulename_callable to TemplateLookup to allow a function to
  661. determine module filenames (takes filename, uri arguments). used for
  662. [ticket:14]
  663. - added optional input_encoding flag to Template, to allow sending a
  664. unicode() object with no magic encoding comment
  665. - "expression_filter" argument in <%page> applies only to expressions
  666. - added "default_filters" argument to Template, TemplateLookup. applies only
  667. to expressions, gets prepended to "expression_filter" arg from <%page>.
  668. defaults to ["unicode"], so that all expressions get stringified into u''
  669. by default (this is what Mako already does). By setting to [], expressions
  670. are passed through raw.
  671. - added "imports" argument to Template, TemplateLookup. so you can predefine
  672. a list of import statements at the top of the template. can be used in
  673. conjunction with default_filters.
  674. - support for CRLF templates...whoops ! welcome to all the windows users.
  675. [ticket:16]
  676. - small fix to local variable propigation for locals that are conditionally
  677. declared
  678. - got "top level" def calls to work, i.e. template.get_def("somedef").render()
  679. 0.1.1
  680. - buffet plugin supports string-based templates, allows ToscaWidgets to work
  681. [ticket:8]
  682. - AST parsing fixes: fixed TryExcept identifier parsing
  683. - removed textmate tmbundle from contrib and into separate SVN location;
  684. windows users cant handle those files, setuptools not very good at
  685. "pruning" certain directories
  686. - fix so that "cache_timeout" parameter is propigated
  687. - fix to expression filters so that string conversion (actually unicode)
  688. properly occurs before filtering
  689. - better error message when a lookup is attempted with a template that has no
  690. lookup
  691. - implemented "module" attribute for namespace
  692. - fix to code generation to correctly track multiple defs with the same name
  693. - "directories" can be passed to TemplateLookup as a scalar in which case it
  694. gets converted to a list [ticket:9]
  695. 0.1.0
  696. Initial release.