Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 284 lines (248 sloc) 14.419 kb
32567d84 »
2001-06-13 Initial revision
1 Cheetah TODO list
5610e474 »
2001-06-13 added some instructions
2 -----------------
3 * If you are working on a task please put your initials at the end of the
4 description
9eb346f2 »
2001-07-13 updated the list
5 * When a task is completed please remember to note it in the CHANGES file
c79ab09a »
2002-09-12 *** empty log message ***
6 * Unresolved bugs are listed in the BUGS file. Resolved bugs are be listed
7 in the CHANGES file if the bug is considered significant enough and it
8 affected a released version of Cheetah.
5610e474 »
2001-06-13 added some instructions
9
e07ad1e6 »
2002-08-10 *** empty log message ***
10
448c9b00 »
2002-09-13 *** empty log message ***
11 Requirements for 1.0
e07ad1e6 »
2002-08-10 *** empty log message ***
12 =========================================================================
814c013a »
2003-06-02 *** empty log message ***
13 - Python 2.3(b1) causes 16 failures in SyntaxAndOutput.py because the result
14 of boolean expressions is now True and False instead of 1 and 0 (or 'True'
15 and 'False' instead of '1' and '0' when used as placeholders). The same
16 thing happens with $True and $False. Do we need a set of parallel tests
17 for Python >= 2.3?
50ca0cce »
2002-12-26 *** empty log message ***
18 - Simplify NameMapper.py while maintaining new behavior (ignore dictionary
19 attributes/methods when searching for match of first chunk in searchList
20 lookup). Modify _namemapper.c to conform. Make valueForKey error
21 messages more meaningful: for $placeholder.html it raises "NotFound: html";
c93f5a87 »
2002-12-26 *** empty log message ***
22 it should raise "NotFound: 'html' in $placeholder.html". Consider passing
23 the entire unparsed placeholder tag to all NameMapper functions for use in
24 a potential error message, the same way we're passing it to the output
25 filter. Also consider passing it to the errorCatcher. (TR)
c79ab09a »
2002-09-12 *** empty log message ***
26 - update User's Guide about changes to SkeletonPage (no more #settings,
27 etc) (TR)
677034c2 »
2002-12-23 *** empty log message ***
28 - Decide on Cheetah's 1.0 license and update the Users' Guide. Cheetah
29 will remain open source, and derived works (open or closed source) will be
30 allowed. The issue is how to make the second part more explicit. (TR)
de8d1046 »
2002-11-01 *** empty log message ***
31 - Add an example in the distribution of a simplified SkeletonPage
32 that used #block but does not have fancy esoteric methods like
33 style stuff. (MO)
7714276b »
2003-05-05 *** empty log message ***
34 - Eliminate obsolete #settings directive from
35 examples/webware_examples/cheetahSite/siteTemplate.tmpl (TR)
36 - Recognize the exception value as a local variable inside the
37 '#except Exception, ex' clause. Currently $ex raises NotFound.
e07ad1e6 »
2002-08-10 *** empty log message ***
38
39
40 Other TODO Items
32567d84 »
2001-06-13 Initial revision
41 ================================================================================
d1a5287f »
2001-09-07 added notes and change the version number
42
533f02a3 »
2002-11-20 *** empty log message ***
43 - CheetahWrapper stuff: (MO)
44 * "cheetah compile --shbang '#!/usr/bin/python2.2'"
677034c2 »
2002-12-23 *** empty log message ***
45 * "cheetah preview [options] [FILES]" print template-specific portion of main
46 method(s) to stdout, with line numbers based on the .py template module.
47 Make a Template method to do the same thing, a la .generatedModuleCode().
533f02a3 »
2002-11-20 *** empty log message ***
48 * Refactor, make compile/fill/code routines callbacks using a bundle arg.
7822fa3b »
2003-05-13 *** empty log message ***
49 * If an input file ends in a dot, intelligently add the input extension if
50 not found.
8e077f07 »
2002-10-04 *** empty log message ***
51
533f02a3 »
2002-11-20 *** empty log message ***
52 - Debugging tools. See section below.
99009bd1 »
2002-10-06 *** empty log message ***
53
7822fa3b »
2003-05-13 *** empty log message ***
54 - Add --error option to compiled templates and "cheetah fill". It would
55 activate the Echo error catcher for debugging. (Maybe --list-errors to
56 suppress output and instead list the not found placeholders? Less
57 important.)
58
533055d7 »
2003-03-02 *** empty log message ***
59 - Provide a utility to list the names of all placeholders in the template.
60 Requested by Tracy Ruggles on Feb 21, 2003.
61
47eece1f »
2002-04-08 *** empty log message ***
62 - implement some better error handling for misformed #for, #if, #try directives,
63 etc. At the moment these errors are not caught until Python executes the
64 code.
6f5a89f5 »
2002-05-01 *** empty log message ***
65
66 - create better error message for bad code such as:
67 ##cache
68 This is a cached region. $voom
69 #end cache
70
20f87b7c »
2002-10-15 *** empty log message ***
71 - create a better error message for invalid syntax when a $var inside a
72 directive is enclosed in ${} or $(). E.g.:
73 #include raw source=${x}
74
1086d3ce »
2002-06-10 Elaborate whitespace-comment problem.
75 - Delete whitespace before a comment on the same line. The methods are
76 Parser.eatComment() and Parser.eatMultiLineComment(). It's already
77 working if the line contains 'STUFF#slurp ## comment'. Need to make
78 it work for 'STUFF ## comment' (but retain the EOL newline).
0beed839 »
2002-04-30 *** empty log message ***
79
80 - 'python setup.py uninstall'. This may require hacking an uninstall feature
81 into distutils.
82
cbdb049e »
2002-05-15 *** empty log message ***
83 - 'errorCatcher None' to stop catching errors in the middle of a template.
f4b3b514 »
2002-04-11 *** empty log message ***
84
655c7cd3 »
2002-11-27 *** empty log message ***
85 - Utils.WebInputMixin: factor out Cheetah-specific code so it can be used in
86 non-Cheetah applications. Don't modify the searchList: have a Template
87 wrapper method do that. Consider turning it into a function that does not
88 require 'self'. Consider making Webware-specific code into plugins so that,
89 e.g., other cookie-handling methods can be grafted in. Maybe use callback
90 classes like the planned rewrite for CheetahWrapper. Low priority. (MO)
91
8c8ab98d »
2003-01-20 *** empty log message ***
92 - Look through Zope Page Templates (TAL) for ideas to borrow.
93 http://www.zope.org/Documentation/Books/ZopeBook/current/AppendixC.stx
94 http://www.owlfish.com/software/simpleTAL/index.html
d1e57688 »
2002-05-18 *** empty log message ***
95
7822fa3b »
2003-05-13 *** empty log message ***
96 Debugging Tools (Dump Tools)
97 ============================
8f06cafd »
2002-10-19 *** empty log message ***
98 It would be nice to provide debugging tools for users who can't figure
99 out why a certain placeholder value isn't found or is being overridden.
100 My idea is to define $dumpSearchList() and $dumpSearchListFlat() in
101 Template, which would print a stanza in the output showing all searchList
102 variables and their values. $dumpSearchList would group by searchList
103 element; $dumpSearchListFlat would combine all into a single
104 alphabetical listing.
bb5709a7 »
2002-11-21 *** empty log message ***
105 I made an experimental version but it printed only instance variables,
8f06cafd »
2002-10-19 *** empty log message ***
106 not methods and not inherited attributes. Also, it wouldn't print right
107 using the usual pattern of write-to-custom-StringIO-object-and-return-
108 the-.getvalue() and I couldn't figure out why.
bb5709a7 »
2002-11-21 *** empty log message ***
109 The stanza should be set apart by a row of stars with the words
8f06cafd »
2002-10-19 *** empty log message ***
110 "BEGIN/END SEARCH LIST DUMP". Then for $dumpSearchList, precede each
111 group with "*** searchList[i], type <element type>, 142 variables ***".
bb5709a7 »
2002-11-21 *** empty log message ***
112 Because some elements like 'self' may have hundreds of inherited
8f06cafd »
2002-10-19 *** empty log message ***
113 methods that would create a forest-through-trees situation for the user,
114 we may need an option to supress the variable listing for elements with
115 > 20 variables (just print the summary line instead). ?
bb5709a7 »
2002-11-21 *** empty log message ***
116 The final version should be in Template so it has implicit
8f06cafd »
2002-10-19 *** empty log message ***
117 access to the searchList and perhaps later to other variables (locals,
118 globals, "#set global"s, builtins) too. This is such a central
119 debugging tool that you should not have to monopolize an #extends
120 (the template's only #extends) to use it. You could import it, however,
121 if you pass in the searchList explicitly as an argument. In that case,
122 perhaps we can base it on a generic module for dumping variables/values.
bb5709a7 »
2002-11-21 *** empty log message ***
123 Note that we cannot simply depend on str() and pprint, because
8f06cafd »
2002-10-19 *** empty log message ***
124 we need to show instances as dictionaries. Likewise, dir() and vars()
125 may get us part of the distance, but only if they show methods and
126 inherited attributes too.
bb5709a7 »
2002-11-21 *** empty log message ***
127 These functions should print only top-level variables, not
8f06cafd »
2002-10-19 *** empty log message ***
128 the subelements of collections. I.e, if the first searchList element
129 is a dictionary, show its keys/values, but do not expand any
130 subvalues if they are dictionaries too, unless the display tool happens
131 to default to that.
132
133
d1e57688 »
2002-05-18 *** empty log message ***
134 Rewrite the caching framework
135 =============================
136 - add #cache varyBy= (tied to Tavis' proposed caching framework for Webware)
137
138 - #cache test= with a one-variable test produces invalid Python (an empty
139 if-block). Example in Cheetah Developers' Guide, section
140 "#cache with test: expression and method conditions".
141
142 - #cache id= seems to be ignoring the ID and generating a random numeric
143 ID instead. Is it working? Do cache IDs have to be numeric?
144
145 - Other ideas in Tavis' head.
146
c79ab09a »
2002-09-12 *** empty log message ***
147 - Have an option to refresh the cache whenever an external
148 file is updated. This would allow a data structure to be kept in
149 sync whenever its text configuration file is changed.
150
55de2dbe »
2002-06-23 Comment.
151 #entry $func($arg1, $arg2="default", $**kw)
625de1dc »
2002-05-30 *** empty log message ***
152 ===============================================================================
55de2dbe »
2002-06-23 Comment.
153 Make a wrapper function in the .py template module that builds a searchList
154 from its positional arguments, then instantiates and fills a template and
155 returns the result. The preceding example would create a function thus:
bb5709a7 »
2002-11-21 *** empty log message ***
156 def func(arg1, arg2="default", searchList=None, **kw):
157 """Function docstring."""
158 sl = {'arg1': arg1, 'arg2': arg2}
159 if searchList is None:
160 searchList = [sl]
161 elif type(searchList) == types.ListType:
162 searchList.insert(0, sl)
163 else:
164 raise TypeError("arg 'searchList'")
165 t = TheTemplate(searchList=searchList, **kw)
166 return str(t)
55de2dbe »
2002-06-23 Comment.
167 ##doc-entry: and #*doc-entry: comments are appended to the function docstring.
bb5709a7 »
2002-11-21 *** empty log message ***
168 Finally, make this function accessible directly from the shell.
625de1dc »
2002-05-30 *** empty log message ***
169 If there are any non-option arguments on the command line, call the function
170 instead of filling the template the normal way.
bb5709a7 »
2002-11-21 *** empty log message ***
171 This would perhaps make more sense as arguments to .respond(). But
55de2dbe »
2002-06-23 Comment.
172 .respond() has that pesky 'trans' argument that mustn't be interfered with,
173 and other programs may assume .respond() takes only one argument. Also,
174 when called via str(), str() cannot take arguments.
bb5709a7 »
2002-11-21 *** empty log message ***
175
176 #indent
177 ========================================================================
48941590 »
2002-11-26 *** empty log message ***
178 The current indenter (which exists but is undocumented) is a kludge that has an
179 indentation object, with implicit placeholder calls added at each line to
180 generate the indentation, and #silent calls to adjust the object. It should be
181 reimplemented to generate code to call the indentation object directly. Also,
182 the user interface should be cleaned up, the implementation and Users' Guide
bb5709a7 »
2002-11-21 *** empty log message ***
183 synchronized, and test cases built.
184
185 The desired implementation revolves around self._indenter, which knows the
186 current indentation level (a non-negative integer), chars (the string output
187 per level, default four spaces), and stack (the previous indentation levels).
188 The .indent() method returns the indentation string currently appropriate.
48941590 »
2002-11-26 *** empty log message ***
189 The desired interface for phase 1 (subject to change):
bb5709a7 »
2002-11-21 *** empty log message ***
190 #indent strip ; strip leading whitespace from input lines
191 #indent add ; add indentation to output lines as appropriate
192 #indent on ; do both
193 #indent off ; do neither
194 #indent reset ; set level to 0 and clear stack
195 #indent ++ ; increment level
196 #indent -- ; decrement level
197 #indent pop [EXPR] ; revert to Nth previous level (default 1)
198 ; if pop past end of stack, set level to 0 and
199 ; clear stack. All +/-/= operations push the old level
200 ; onto the stack.
201 #indent debug ; dump level, chars and stack to template output
202
203 Possible extensions:
48941590 »
2002-11-26 *** empty log message ***
204 #indent =EXPR ; set level to N (likely to be added to phase 1)
bb5709a7 »
2002-11-21 *** empty log message ***
205 #indent +EXPR ; add N to level (not very necessary)
206 #indent -EXPR ; subtract N from level (not very necessary)
48941590 »
2002-11-26 *** empty log message ***
207 #indent balance BOOL ; require all indent changes in a #def/#block to be
208 ; popped before exiting the method. (difficult to
209 ; implement)
210 #indent implicitPop BOOL ; automatically pop indent changes within a
211 ; #def/block when that method exits. (difficult to
212 ; implement)
213 #indent ?? ; a 3-way switch that combines unbalanced, balanced and
214 ; implicit pop. (difficult to implement)
215 #indent ?? ; smart stripping: strip input indentation according to
216 ; nested directive level; e.g.,
217 ; 01: #if foo=1
218 ; 02: public int foo()
219 ; 03: {
220 ; 04: return FOO;
221 ; 05: }
222 ; 06: #end if
223 ; With smart stripping, line 4 would be indented and the
224 ; others not. With "on" or "strip" stripping, all lines
225 ; 2-5 would be unindented. With "off" stripping,
226 ; lines 2-5 would not be stripped.
bb5709a7 »
2002-11-21 *** empty log message ***
227
228 There should be one indentation object per Template instance, shared by
229 methods and include files.
230
625de1dc »
2002-05-30 *** empty log message ***
231
63640d7b »
2002-06-10 *** empty log message ***
232 Upload File
233 ========================================================================
234 A mixin method in Cheetah.Utils (for Template) that handles file uploads --
235 these are too complicated for .webInput(). The method should do a "safe"
236 file upload; e.g., http://us3.php.net/manual/en/features.file-upload.php ,
237 within the limitations of Python's cgi module. The user has the choice of
238 three destinations for the file contents: (A) copied to a local
239 path you specify, (B) placed in a namespace variable like .cgiImport()
240 does, or (C) returned. (B) parallels .webInput, but (A) will certainly be
241 desirable situations where we just want to save the file, not read it into
242 memory. Reject files larger than a user-specified size or not in a list of
243 user-approved MIME types. Define appropriate exceptions for typical
244 file-upload errors. Method name .webUploadFileAsString?
bb5709a7 »
2002-11-21 *** empty log message ***
245 One situation to support is when form has a text(area) field
63640d7b »
2002-06-10 *** empty log message ***
246 related to a file-upload control on the same form, and the user has the choice
247 of typing into the field or uploading a text file. We need a method that
248 updates the text field's value if there is an uploaded file, but not if there
249 isn't. This may be handled by the regular method(s) or may require a separate
250 method.
625de1dc »
2002-05-30 *** empty log message ***
251
5e5892b6 »
2003-06-08 *** empty log message ***
252 User-defined directives
253 =======================================================================
254 IF we decide to support user-defined directives someday, consider Spyce's
255 interface. Spyce uses a base class which provides generic services to
256 custom "active tags".
257 http://spyce.sourceforge.net/doc-tag.html
258 http://spyce.sourceforge.net/doc-tag_new.html
259
a08b6224 »
2002-05-14 *** empty log message ***
260
32567d84 »
2001-06-13 Initial revision
261 Test Suite
262 ================================================================================
263 - test cases for the SkeletonPage framework
0cbb2a25 »
2001-11-05 updated
264 - add cases that test the cheetah-compile script
09167370 »
2002-03-30 *** empty log message ***
265 - add cases that test the integration with WebKit. Since these must be called
266 from a running WebKit server, make a servlet that runs the tests and outputs
267 diagnostics to the browser.
32567d84 »
2001-06-13 Initial revision
268
269 Website
270 ================================================================================
8d09b72a »
2001-08-16 *** empty log message ***
271 - automate the documentation update
32567d84 »
2001-06-13 Initial revision
272 - See if we can get WebKit working on Sourceforge...
273
274 Examples
275 ================================================================================
276 - create some non-html code generation examples
0cbb2a25 »
2001-11-05 updated
277 - SQL
278 - LaTeX
279 - form email
6d1d0e12 »
2002-04-26 *** empty log message ***
280 - Template definitions in a database. .py template modules in a
281 database? Caching template classes and/or instances extracted from
282 a database.
283 - Pickled templates?
Something went wrong with that request. Please try again.