CHANGES 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. 0.3.3
  2. - Added conditional to RichTraceback
  3. such that if no traceback is passed
  4. and sys.exc_info() has been reset,
  5. the formatter just returns blank
  6. for the "traceback" portion.
  7. [ticket:135]
  8. - Fixed sometimes incorrect usage of
  9. exc.__class__.__name__
  10. in html/text error templates when using
  11. Python 2.4 [ticket:131]
  12. - Fixed broken @property decorator on
  13. template.last_modified
  14. - Fixed error formatting when a stacktrace
  15. line contains no line number, as in when
  16. inside an eval/exec-generated function.
  17. [ticket:132]
  18. - When a .py is being created, the tempfile
  19. where the source is stored temporarily is
  20. now made in the same directory as that of
  21. the .py file. This ensures that the two
  22. files share the same filesystem, thus
  23. avoiding cross-filesystem synchronization
  24. issues. Thanks to Charles Cazabon.
  25. 0.3.2
  26. - Calling a def from the top, via
  27. template.get_def(...).render() now checks the
  28. argument signature the same way as it did in
  29. 0.2.5, so that TypeError is not raised.
  30. reopen of [ticket:116]
  31. 0.3.1
  32. - Fixed incorrect dir name in setup.py
  33. [ticket:129]
  34. 0.3
  35. - Python 2.3 support is dropped. [ticket:123]
  36. - Python 3 support is added ! See README.py3k
  37. for installation and testing notes.
  38. [ticket:119]
  39. - Unit tests now run with nose. [ticket:127]
  40. - Source code escaping has been simplified.
  41. In particular, module source files are now
  42. generated with the Python "magic encoding
  43. comment", and source code is passed through
  44. mostly unescaped, except for that code which
  45. is regenerated from parsed Python source.
  46. This fixes usage of unicode in
  47. <%namespace:defname> tags. [ticket:99]
  48. - RichTraceback(), html_error_template().render(),
  49. text_error_template().render() now accept "error"
  50. and "traceback" as optional arguments, and
  51. these are now actually used. [ticket:122]
  52. - The exception output generated when
  53. format_exceptions=True will now be as a Python
  54. unicode if it occurred during render_unicode(),
  55. or an encoded string if during render().
  56. - A percent sign can be emitted as the first
  57. non-whitespace character on a line by escaping
  58. it as in "%%". [ticket:112]
  59. - Template accepts empty control structure, i.e.
  60. % if: %endif, etc. [ticket:94]
  61. - The <%page args> tag can now be used in a base
  62. inheriting template - the full set of render()
  63. arguments are passed down through the inherits
  64. chain. Undeclared arguments go into **pageargs
  65. as usual. [ticket:116]
  66. - defs declared within a <%namespace> section, an
  67. uncommon feature, have been improved. The defs
  68. no longer get doubly-rendered in the body() scope,
  69. and now allow local variable assignment without
  70. breakage. [ticket:109]
  71. - Windows paths are handled correctly if a Template
  72. is passed only an absolute filename (i.e. with c:
  73. drive etc.) and no URI - the URI is converted
  74. to a forward-slash path and module_directory
  75. is treated as a windows path. [ticket:128]
  76. - TemplateLookup raises TopLevelLookupException for
  77. a given path that is a directory, not a filename,
  78. instead of passing through to the template to
  79. generate IOError. [ticket:73]
  80. 0.2.6
  81. - Fix mako function decorators to preserve the
  82. original function's name in all cases. Patch
  83. from Scott Torborg.
  84. - Support the <%namespacename:defname> syntax in
  85. the babel extractor. [ticket:118]
  86. - Further fixes to unicode handling of .py files with the
  87. html_error_template. [ticket:88]
  88. 0.2.5
  89. - Added a "decorator" kw argument to <%def>,
  90. allows custom decoration functions to wrap
  91. rendering callables. Mainly intended for
  92. custom caching algorithms, not sure what
  93. other uses there may be (but there may be).
  94. Examples are in the "filtering" docs.
  95. - When Mako creates subdirectories in which
  96. to store templates, it uses the more
  97. permissive mode of 0775 instead of 0750,
  98. helping out with certain multi-process
  99. scenarios. Note that the mode is always
  100. subject to the restrictions of the existing
  101. umask. [ticket:101]
  102. - Fixed namespace.__getattr__() to raise
  103. AttributeError on attribute not found
  104. instead of RuntimeError. [ticket:104]
  105. - Added last_modified accessor to Template,
  106. returns the time.time() when the module
  107. was created. [ticket:97]
  108. - Fixed lexing support for whitespace
  109. around '=' sign in defs. [ticket:102]
  110. - Removed errant "lower()" in the lexer which
  111. was causing tags to compile with
  112. case-insensitive names, thus messing up
  113. custom <%call> names. [ticket:108]
  114. - added "mako.__version__" attribute to
  115. the base module. [ticket:110]
  116. 0.2.4
  117. - Fixed compatibility with Jython 2.5b1.
  118. 0.2.3
  119. - the <%namespacename:defname> syntax described at
  120. http://techspot.zzzeek.org/?p=28 has now
  121. been added as a built in syntax, and is recommended
  122. as a more modern syntax versus <%call expr="expression">.
  123. The %call tag itself will always remain,
  124. with <%namespacename:defname> presenting a more HTML-like
  125. alternative to calling defs, both plain and
  126. nested. Many examples of the new syntax are in the
  127. "Calling a def with embedded content" section
  128. of the docs.
  129. - added support for Jython 2.5.
  130. - cache module now uses Beaker's CacheManager
  131. object directly, so that all cache types are included.
  132. memcached is available as both "ext:memcached" and
  133. "memcached", the latter for backwards compatibility.
  134. - added "cache" accessor to Template, Namespace.
  135. e.g. ${local.cache.get('somekey')} or
  136. template.cache.invalidate_body()
  137. - added "cache_enabled=True" flag to Template,
  138. TemplateLookup. Setting this to False causes cache
  139. operations to "pass through" and execute every time;
  140. this flag should be integrated in Pylons with its own
  141. cache_enabled configuration setting.
  142. - the Cache object now supports invalidate_def(name),
  143. invalidate_body(), invalidate_closure(name),
  144. invalidate(key), which will remove the given key
  145. from the cache, if it exists. The cache arguments
  146. (i.e. storage type) are derived from whatever has
  147. been already persisted for that template.
  148. [ticket:92]
  149. - For cache changes to work fully, Beaker 1.1 is required.
  150. 1.0.1 and up will work as well with the exception of
  151. cache expiry. Note that Beaker 1.1 is **required**
  152. for applications which use dynamically generated keys,
  153. since previous versions will permanently store state in memory
  154. for each individual key, thus consuming all available
  155. memory for an arbitrarily large number of distinct
  156. keys.
  157. - fixed bug whereby an <%included> template with
  158. <%page> args named the same as a __builtin__ would not
  159. honor the default value specified in <%page> [ticket:93]
  160. - fixed the html_error_template not handling tracebacks from
  161. normal .py files with a magic encoding comment [ticket:88]
  162. - RichTraceback() now accepts an optional traceback object
  163. to be used in place of sys.exc_info()[2]. html_error_template()
  164. and text_error_template() accept an optional
  165. render()-time argument "traceback" which is passed to the
  166. RichTraceback object.
  167. - added ModuleTemplate class, which allows the construction
  168. of a Template given a Python module generated by a previous
  169. Template. This allows Python modules alone to be used
  170. as templates with no compilation step. Source code
  171. and template source are optional but allow error reporting
  172. to work correctly.
  173. - fixed Python 2.3 compat. in mako.pyparser [ticket:90]
  174. - fix Babel 0.9.3 compatibility; stripping comment tags is now
  175. optional (and enabled by default).
  176. 0.2.2
  177. - cached blocks now use the current context when rendering
  178. an expired section, instead of the original context
  179. passed in [ticket:87]
  180. - fixed a critical issue regarding caching, whereby
  181. a cached block would raise an error when called within a
  182. cache-refresh operation that was initiated after the
  183. initiating template had completed rendering.
  184. 0.2.1
  185. - fixed bug where 'output_encoding' parameter would prevent
  186. render_unicode() from returning a unicode object.
  187. - bumped magic number, which forces template recompile for
  188. this version (fixes incompatible compile symbols from 0.1
  189. series).
  190. - added a few docs for cache options, specifically those that
  191. help with memcached.
  192. 0.2.0
  193. - Speed improvements (as though we needed them, but people
  194. contributed and there you go):
  195. - added "bytestring passthru" mode, via
  196. `disable_unicode=True` argument passed to Template or
  197. TemplateLookup. All unicode-awareness and filtering is
  198. turned off, and template modules are generated with
  199. the appropriate magic encoding comment. In this mode,
  200. template expressions can only receive raw bytestrings
  201. or Unicode objects which represent straight ASCII, and
  202. render_unicode() may not be used if multibyte
  203. characters are present. When enabled, speed
  204. improvement around 10-20%. [ticket:77] (courtesy
  205. anonymous guest)
  206. - inlined the "write" function of Context into a local
  207. template variable. This affords a 12-30% speedup in
  208. template render time. (idea courtesy same anonymous
  209. guest) [ticket:76]
  210. - New Features, API changes:
  211. - added "attr" accessor to namespaces. Returns
  212. attributes configured as module level attributes, i.e.
  213. within <%! %> sections. [ticket:62] i.e.:
  214. # somefile.html
  215. <%!
  216. foo = 27
  217. %>
  218. # some other template
  219. <%namespace name="myns" file="somefile.html"/>
  220. ${myns.attr.foo}
  221. The slight backwards incompatibility here is, you
  222. can't have namespace defs named "attr" since the
  223. "attr" descriptor will occlude it.
  224. - cache_key argument can now render arguments passed
  225. directly to the %page or %def, i.e. <%def
  226. name="foo(x)" cached="True" cache_key="${x}"/>
  227. [ticket:78]
  228. - some functions on Context are now private:
  229. _push_buffer(), _pop_buffer(),
  230. caller_stack._push_frame(), caller_stack._pop_frame().
  231. - added a runner script "mako-render" which renders
  232. standard input as a template to stdout [ticket:81]
  233. [ticket:56]
  234. - Bugfixes:
  235. - can now use most names from __builtins__ as variable
  236. names without explicit declaration (i.e. 'id',
  237. 'exception', 'range', etc.) [ticket:83] [ticket:84]
  238. - can also use builtin names as local variable names
  239. (i.e. dict, locals) (came from fix for [ticket:84])
  240. - fixed bug in python generation when variable names are
  241. used with identifiers like "else", "finally", etc.
  242. inside them [ticket:68]
  243. - fixed codegen bug which occured when using <%page>
  244. level caching, combined with an expression-based
  245. cache_key, combined with the usage of <%namespace
  246. import="*"/> - fixed lexer exceptions not cleaning up
  247. temporary files, which could lead to a maximum number
  248. of file descriptors used in the process [ticket:69]
  249. - fixed issue with inline format_exceptions that was
  250. producing blank exception pages when an inheriting
  251. template is present [ticket:71]
  252. - format_exceptions will apply the encoding options of
  253. html_error_template() to the buffered output
  254. - rewrote the "whitespace adjuster" function to work
  255. with more elaborate combinations of quotes and
  256. comments [ticket:75]
  257. 0.1.10
  258. - fixed propagation of 'caller' such that nested %def calls
  259. within a <%call> tag's argument list propigates 'caller'
  260. to the %call function itself (propigates to the inner
  261. calls too, this is a slight side effect which previously
  262. existed anyway)
  263. - fixed bug where local.get_namespace() could put an
  264. incorrect "self" in the current context
  265. - fixed another namespace bug where the namespace functions
  266. did not have access to the correct context containing
  267. their 'self' and 'parent'
  268. 0.1.9
  269. - filters.Decode filter can also accept a non-basestring
  270. object and will call str() + unicode() on it [ticket:47]
  271. - comments can be placed at the end of control lines,
  272. i.e. if foo: # a comment, [ticket:53], thanks to
  273. Paul Colomiets
  274. - fixed expressions and page tag arguments and with embedded
  275. newlines in CRLF templates, follow up to [ticket:16], thanks
  276. Eric Woroshow
  277. - added an IOError catch for source file not found in RichTraceback
  278. exception reporter [ticket:51]
  279. 0.1.8
  280. - variable names declared in render methods by internal
  281. codegen prefixed by "__M_" to prevent name collisions
  282. with user code
  283. - added a Babel (http://babel.edgewall.org/) extractor entry
  284. point, allowing extraction of gettext messages directly from
  285. mako templates via Babel [ticket:45]
  286. - fix to turbogears plugin to work with dot-separated names
  287. (i.e. load_template('foo.bar')). also takes file extension
  288. as a keyword argument (default is 'mak').
  289. - more tg fix: fixed [ticket:35], allowing string-based
  290. templates with tgplugin even if non-compatible args were sent
  291. 0.1.7
  292. - one small fix to the unit tests to support python 2.3
  293. - a slight hack to how cache.py detects Beaker's memcached,
  294. works around unexplained import behavior observed on some
  295. python 2.3 installations
  296. 0.1.6
  297. - caching is now supplied directly by Beaker, which has
  298. all of MyghtyUtils merged into it now. The latest Beaker
  299. (0.7.1) also fixes a bug related to how Mako was using the
  300. cache API.
  301. - fix to module_directory path generation when the path is "./"
  302. [ticket:34]
  303. - TGPlugin passes options to string-based templates [ticket:35]
  304. - added an explicit stack frame step to template runtime, which
  305. allows much simpler and hopefully bug-free tracking of 'caller',
  306. fixes #28
  307. - if plain Python defs are used with <%call>, a decorator
  308. @runtime.supports_callable exists to ensure that the "caller"
  309. stack is properly handled for the def.
  310. - fix to RichTraceback and exception reporting to get template
  311. source code as a unicode object #37
  312. - html_error_template includes options "full=True", "css=True"
  313. which control generation of HTML tags, CSS [ticket:39]
  314. - added the 'encoding_errors' parameter to Template/TemplateLookup
  315. for specifying the error handler associated with encoding to
  316. 'output_encoding' [ticket:40]
  317. - the Template returned by html_error_template now defaults to
  318. output_encoding=sys.getdefaultencoding(),
  319. encoding_errors='htmlentityreplace' [ticket:37]
  320. - control lines, i.e. % lines, support backslashes to continue long
  321. lines (#32)
  322. - fixed codegen bug when defining <%def> within <%call> within <%call>
  323. - leading utf-8 BOM in template files is honored according to pep-0263
  324. 0.1.5
  325. - AST expression generation - added in just about everything
  326. expression-wise from the AST module [ticket:26]
  327. - AST parsing, properly detects imports of the form "import foo.bar"
  328. [ticket:27]
  329. - fix to lexing of <%docs> tag nested in other tags
  330. - fix to context-arguments inside of <%include> tag which broke
  331. during 0.1.4 [ticket:29]
  332. - added "n" filter, disables *all* filters normally applied to an expression
  333. via <%page> or default_filters (but not those within the filter)
  334. - added buffer_filters argument, defines filters applied to the return value
  335. of buffered/cached/filtered %defs, after all filters defined with the %def
  336. itself have been applied. allows the creation of default expression filters
  337. that let the output of return-valued %defs "opt out" of that filtering
  338. via passing special attributes or objects.
  339. 0.1.4
  340. - got defs-within-defs to be cacheable
  341. - fixes to code parsing/whitespace adjusting where plain python comments
  342. may contain quote characters [ticket:23]
  343. - fix to variable scoping for identifiers only referenced within
  344. functions
  345. - added a path normalization step to lookup so URIs like
  346. "/foo/bar/../etc/../foo" pre-process the ".." tokens before checking
  347. the filesystem
  348. - fixed/improved "caller" semantics so that undefined caller is
  349. "UNDEFINED", propigates __nonzero__ method so it evaulates to False if
  350. not present, True otherwise. this way you can say % if caller:\n
  351. ${caller.body()}\n% endif
  352. - <%include> has an "args" attribute that can pass arguments to the
  353. called template (keyword arguments only, must be declared in that
  354. page's <%page> tag.)
  355. - <%include> plus arguments is also programmatically available via
  356. self.include_file(<filename>, **kwargs)
  357. - further escaping added for multibyte expressions in %def, %call
  358. attributes [ticket:24]
  359. 0.1.3
  360. - ***Small Syntax Change*** - the single line comment character is now
  361. *two* hash signs, i.e. "## this is a comment". This avoids a common
  362. collection with CSS selectors.
  363. - the magic "coding" comment (i.e. # coding:utf-8) will still work with
  364. either one "#" sign or two for now; two is preferred going forward, i.e.
  365. ## coding:<someencoding>.
  366. - new multiline comment form: "<%doc> a comment </%doc>"
  367. - UNDEFINED evaluates to False
  368. - improvement to scoping of "caller" variable when using <%call> tag
  369. - added lexer error for unclosed control-line (%) line
  370. - added "preprocessor" argument to Template, TemplateLookup - is a single
  371. callable or list of callables which will be applied to the template text
  372. before lexing. given the text as an argument, returns the new text.
  373. - added mako.ext.preprocessors package, contains one preprocessor so far:
  374. 'convert_comments', which will convert single # comments to the new ##
  375. format
  376. 0.1.2
  377. - fix to parsing of code/expression blocks to insure that non-ascii
  378. characters, combined with a template that indicates a non-standard
  379. encoding, are expanded into backslash-escaped glyphs before being AST
  380. parsed [ticket:11]
  381. - all template lexing converts the template to unicode first, to
  382. immediately catch any encoding issues and ensure internal unicode
  383. representation.
  384. - added module_filename argument to Template to allow specification of a
  385. specific module file
  386. - added modulename_callable to TemplateLookup to allow a function to
  387. determine module filenames (takes filename, uri arguments). used for
  388. [ticket:14]
  389. - added optional input_encoding flag to Template, to allow sending a
  390. unicode() object with no magic encoding comment
  391. - "expression_filter" argument in <%page> applies only to expressions
  392. - added "default_filters" argument to Template, TemplateLookup. applies only
  393. to expressions, gets prepended to "expression_filter" arg from <%page>.
  394. defaults to ["unicode"], so that all expressions get stringified into u''
  395. by default (this is what Mako already does). By setting to [], expressions
  396. are passed through raw.
  397. - added "imports" argument to Template, TemplateLookup. so you can predefine
  398. a list of import statements at the top of the template. can be used in
  399. conjunction with default_filters.
  400. - support for CRLF templates...whoops ! welcome to all the windows users.
  401. [ticket:16]
  402. - small fix to local variable propigation for locals that are conditionally
  403. declared
  404. - got "top level" def calls to work, i.e. template.get_def("somedef").render()
  405. 0.1.1
  406. - buffet plugin supports string-based templates, allows ToscaWidgets to work
  407. [ticket:8]
  408. - AST parsing fixes: fixed TryExcept identifier parsing
  409. - removed textmate tmbundle from contrib and into separate SVN location;
  410. windows users cant handle those files, setuptools not very good at
  411. "pruning" certain directories
  412. - fix so that "cache_timeout" parameter is propigated
  413. - fix to expression filters so that string conversion (actually unicode)
  414. properly occurs before filtering
  415. - better error message when a lookup is attempted with a template that has no
  416. lookup
  417. - implemented "module" attribute for namespace
  418. - fix to code generation to correctly track multiple defs with the same name
  419. - "directories" can be passed to TemplateLookup as a scalar in which case it
  420. gets converted to a list [ticket:9]
  421. 0.1.0
  422. Initial release.