Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 262 lines (226 sloc) 12.857 kb
32567d8 Initial revision
tavis_rudd authored
1 Cheetah TODO list
5610e47 added some instructions
tavis_rudd authored
2 -----------------
3 * If you are working on a task please put your initials at the end of the
4 description
9eb346f updated the list
tavis_rudd authored
5 * When a task is completed please remember to note it in the CHANGES file
c79ab09 *** empty log message ***
hierro authored
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.
5610e47 added some instructions
tavis_rudd authored
9
f5408e6 Docs.
hierro authored
10 Required for Cheetah 2.0
11 ========================
12 - Replace Optik with Python's optparse. Optik license has been removed from
13 Users' Guide.
14
262e3d4 Docs.
hierro authored
15 Desired for Cheetah 2.0
16 =======================
17 - Smart HTML filter that escapes all values except those individually marked as
18 preformatted, a la Kid/PTL/QPY. (MO)
19
f5408e6 Docs.
hierro authored
20
a7da875 update
tavis_rudd authored
21 TODO Items (many are just ideas. This is not an official roadmap!)
22 ================================================================================
e07ad1e *** empty log message ***
hierro authored
23
e9877cf *** empty log message ***
hierro authored
24 - "cheetah test" problem: subcommands fail mysteriously on Windows. Rewrite
25 to avoid using subcommands. Instead, set sys.argv and call the appropriate
26 main() for each test.
27
0becec0 updates
tavis_rudd authored
28 - Documentation: document #encoding. Explain problems "cheetah test" if they
29 haven't been fixed yet.
e9877cf *** empty log message ***
hierro authored
30
31 - There's a kludge in CheetahWrapper.py to abort with a helpful error message
32 if the user runs 'cheetah test' but doesn't have write permission in the
33 current directory. The tests should instead put their temporary files
34 under the system tmp directory.
35
9f5ff68 *** empty log message ***
hierro authored
36 - Reset the current filter to the default (or to the constructor's filter
37 if specified) at the beginning of each fill. Currently, filter changes
38 leak from one fill to the next.
e07ad1e *** empty log message ***
hierro authored
39
533f02a *** empty log message ***
hierro authored
40 - CheetahWrapper stuff: (MO)
41 * "cheetah compile --shbang '#!/usr/bin/python2.2'"
677034c *** empty log message ***
hierro authored
42 * "cheetah preview [options] [FILES]" print template-specific portion of main
43 method(s) to stdout, with line numbers based on the .py template module.
44 Make a Template method to do the same thing, a la .generatedModuleCode().
533f02a *** empty log message ***
hierro authored
45 * Refactor, make compile/fill/code routines callbacks using a bundle arg.
7822fa3 *** empty log message ***
hierro authored
46 * If an input file ends in a dot, intelligently add the input extension if
47 not found.
8e077f0 *** empty log message ***
hierro authored
48
533f02a *** empty log message ***
hierro authored
49 - Debugging tools. See section below.
99009bd *** empty log message ***
hierro authored
50
533055d *** empty log message ***
tavis_rudd authored
51 - Provide a utility to list the names of all placeholders in the template.
52 Requested by Tracy Ruggles on Feb 21, 2003.
f5408e6 Docs.
hierro authored
53
cbdb049 *** empty log message ***
hierro authored
54 - 'errorCatcher None' to stop catching errors in the middle of a template.
f4b3b51 *** empty log message ***
hierro authored
55
655c7cd *** empty log message ***
hierro authored
56 - Utils.WebInputMixin: factor out Cheetah-specific code so it can be used in
57 non-Cheetah applications. Don't modify the searchList: have a Template
58 wrapper method do that. Consider turning it into a function that does not
59 require 'self'. Consider making Webware-specific code into plugins so that,
60 e.g., other cookie-handling methods can be grafted in. Maybe use callback
61 classes like the planned rewrite for CheetahWrapper. Low priority. (MO)
62
8c8ab98 *** empty log message ***
hierro authored
63 - Look through Zope Page Templates (TAL) for ideas to borrow.
64 http://www.zope.org/Documentation/Books/ZopeBook/current/AppendixC.stx
65 http://www.owlfish.com/software/simpleTAL/index.html
d1e5768 *** empty log message ***
hierro authored
66
7822fa3 *** empty log message ***
hierro authored
67 Debugging Tools (Dump Tools)
68 ============================
8f06caf *** empty log message ***
hierro authored
69 It would be nice to provide debugging tools for users who can't figure
70 out why a certain placeholder value isn't found or is being overridden.
71 My idea is to define $dumpSearchList() and $dumpSearchListFlat() in
72 Template, which would print a stanza in the output showing all searchList
73 variables and their values. $dumpSearchList would group by searchList
74 element; $dumpSearchListFlat would combine all into a single
75 alphabetical listing.
bb5709a *** empty log message ***
hierro authored
76 I made an experimental version but it printed only instance variables,
8f06caf *** empty log message ***
hierro authored
77 not methods and not inherited attributes. Also, it wouldn't print right
78 using the usual pattern of write-to-custom-StringIO-object-and-return-
79 the-.getvalue() and I couldn't figure out why.
bb5709a *** empty log message ***
hierro authored
80 The stanza should be set apart by a row of stars with the words
8f06caf *** empty log message ***
hierro authored
81 "BEGIN/END SEARCH LIST DUMP". Then for $dumpSearchList, precede each
82 group with "*** searchList[i], type <element type>, 142 variables ***".
bb5709a *** empty log message ***
hierro authored
83 Because some elements like 'self' may have hundreds of inherited
8f06caf *** empty log message ***
hierro authored
84 methods that would create a forest-through-trees situation for the user,
85 we may need an option to supress the variable listing for elements with
86 > 20 variables (just print the summary line instead). ?
bb5709a *** empty log message ***
hierro authored
87 The final version should be in Template so it has implicit
8f06caf *** empty log message ***
hierro authored
88 access to the searchList and perhaps later to other variables (locals,
89 globals, "#set global"s, builtins) too. This is such a central
90 debugging tool that you should not have to monopolize an #extends
91 (the template's only #extends) to use it. You could import it, however,
92 if you pass in the searchList explicitly as an argument. In that case,
93 perhaps we can base it on a generic module for dumping variables/values.
bb5709a *** empty log message ***
hierro authored
94 Note that we cannot simply depend on str() and pprint, because
8f06caf *** empty log message ***
hierro authored
95 we need to show instances as dictionaries. Likewise, dir() and vars()
96 may get us part of the distance, but only if they show methods and
97 inherited attributes too.
bb5709a *** empty log message ***
hierro authored
98 These functions should print only top-level variables, not
8f06caf *** empty log message ***
hierro authored
99 the subelements of collections. I.e, if the first searchList element
100 is a dictionary, show its keys/values, but do not expand any
101 subvalues if they are dictionaries too, unless the display tool happens
102 to default to that.
103
55de2db Comment.
hierro authored
104 #entry $func($arg1, $arg2="default", $**kw)
625de1d *** empty log message ***
hierro authored
105 ===============================================================================
55de2db Comment.
hierro authored
106 Make a wrapper function in the .py template module that builds a searchList
107 from its positional arguments, then instantiates and fills a template and
108 returns the result. The preceding example would create a function thus:
bb5709a *** empty log message ***
hierro authored
109 def func(arg1, arg2="default", searchList=None, **kw):
110 """Function docstring."""
111 sl = {'arg1': arg1, 'arg2': arg2}
112 if searchList is None:
113 searchList = [sl]
114 elif type(searchList) == types.ListType:
115 searchList.insert(0, sl)
116 else:
117 raise TypeError("arg 'searchList'")
118 t = TheTemplate(searchList=searchList, **kw)
119 return str(t)
55de2db Comment.
hierro authored
120 ##doc-entry: and #*doc-entry: comments are appended to the function docstring.
bb5709a *** empty log message ***
hierro authored
121 Finally, make this function accessible directly from the shell.
625de1d *** empty log message ***
hierro authored
122 If there are any non-option arguments on the command line, call the function
123 instead of filling the template the normal way.
bb5709a *** empty log message ***
hierro authored
124 This would perhaps make more sense as arguments to .respond(). But
55de2db Comment.
hierro authored
125 .respond() has that pesky 'trans' argument that mustn't be interfered with,
126 and other programs may assume .respond() takes only one argument. Also,
127 when called via str(), str() cannot take arguments.
bb5709a *** empty log message ***
hierro authored
128
129 #indent
130 ========================================================================
4894159 *** empty log message ***
hierro authored
131 The current indenter (which exists but is undocumented) is a kludge that has an
132 indentation object, with implicit placeholder calls added at each line to
133 generate the indentation, and #silent calls to adjust the object. It should be
134 reimplemented to generate code to call the indentation object directly. Also,
135 the user interface should be cleaned up, the implementation and Users' Guide
bb5709a *** empty log message ***
hierro authored
136 synchronized, and test cases built.
137
138 The desired implementation revolves around self._indenter, which knows the
139 current indentation level (a non-negative integer), chars (the string output
140 per level, default four spaces), and stack (the previous indentation levels).
141 The .indent() method returns the indentation string currently appropriate.
4894159 *** empty log message ***
hierro authored
142 The desired interface for phase 1 (subject to change):
bb5709a *** empty log message ***
hierro authored
143 #indent strip ; strip leading whitespace from input lines
144 #indent add ; add indentation to output lines as appropriate
145 #indent on ; do both
146 #indent off ; do neither
147 #indent reset ; set level to 0 and clear stack
148 #indent ++ ; increment level
149 #indent -- ; decrement level
150 #indent pop [EXPR] ; revert to Nth previous level (default 1)
151 ; if pop past end of stack, set level to 0 and
152 ; clear stack. All +/-/= operations push the old level
153 ; onto the stack.
154 #indent debug ; dump level, chars and stack to template output
155
156 Possible extensions:
4894159 *** empty log message ***
hierro authored
157 #indent =EXPR ; set level to N (likely to be added to phase 1)
bb5709a *** empty log message ***
hierro authored
158 #indent +EXPR ; add N to level (not very necessary)
159 #indent -EXPR ; subtract N from level (not very necessary)
4894159 *** empty log message ***
hierro authored
160 #indent balance BOOL ; require all indent changes in a #def/#block to be
161 ; popped before exiting the method. (difficult to
162 ; implement)
163 #indent implicitPop BOOL ; automatically pop indent changes within a
164 ; #def/block when that method exits. (difficult to
165 ; implement)
166 #indent ?? ; a 3-way switch that combines unbalanced, balanced and
167 ; implicit pop. (difficult to implement)
168 #indent ?? ; smart stripping: strip input indentation according to
169 ; nested directive level; e.g.,
170 ; 01: #if foo=1
171 ; 02: public int foo()
172 ; 03: {
173 ; 04: return FOO;
174 ; 05: }
175 ; 06: #end if
176 ; With smart stripping, line 4 would be indented and the
177 ; others not. With "on" or "strip" stripping, all lines
178 ; 2-5 would be unindented. With "off" stripping,
179 ; lines 2-5 would not be stripped.
bb5709a *** empty log message ***
hierro authored
180
181 There should be one indentation object per Template instance, shared by
182 methods and include files.
183
625de1d *** empty log message ***
hierro authored
184
63640d7 *** empty log message ***
hierro authored
185 Upload File
186 ========================================================================
164322a general updates
tavis_rudd authored
187 @@TR: This is way outside Cheetah's scope!
188
63640d7 *** empty log message ***
hierro authored
189 A mixin method in Cheetah.Utils (for Template) that handles file uploads --
190 these are too complicated for .webInput(). The method should do a "safe"
191 file upload; e.g., http://us3.php.net/manual/en/features.file-upload.php ,
192 within the limitations of Python's cgi module. The user has the choice of
193 three destinations for the file contents: (A) copied to a local
194 path you specify, (B) placed in a namespace variable like .cgiImport()
195 does, or (C) returned. (B) parallels .webInput, but (A) will certainly be
196 desirable situations where we just want to save the file, not read it into
197 memory. Reject files larger than a user-specified size or not in a list of
198 user-approved MIME types. Define appropriate exceptions for typical
199 file-upload errors. Method name .webUploadFileAsString?
bb5709a *** empty log message ***
hierro authored
200 One situation to support is when form has a text(area) field
63640d7 *** empty log message ***
hierro authored
201 related to a file-upload control on the same form, and the user has the choice
202 of typing into the field or uploading a text file. We need a method that
203 updates the text field's value if there is an uploaded file, but not if there
204 isn't. This may be handled by the regular method(s) or may require a separate
205 method.
625de1d *** empty log message ***
hierro authored
206
e9877cf *** empty log message ***
hierro authored
207 RPM Building
208 ============
209 From: John Landahl <john@landahl.org>
210 To: cheetahtemplate-discuss@lists.sourceforge.net
211 Subject: [Cheetahtemplate-discuss] Building Cheetah RPMs
212 Date: Wed, 05 Nov 2003 01:27:24 -0800
213
214 If anyone is interested in building Cheetah RPMs, simply add the following
215 lines to a file called MANIFEST.in in the Cheetah directory and you'll be
216 able to use the "bdist_rpm" option to setup.py (i.e. "python setup.py
217 bdist_rpm"):
218
219 include SetupTools.py
220 include SetupConfig.py
221 include bin/*
222
223 Also, I've found that using /usr/lib/site-python for add-on Python
224 packages is much more convenient than the default of
225 /usr/lib/pythonX/site-packages, especially when jumping back and forth
226 between 2.2 and 2.3. If you'd like Cheetah in /usr/lib/site-python,
227 createa a setup.cfg with the following contents:
228
229 [install]
230 install-lib = /usr/lib/site-python
231
232 Of course if you do have version specific libraries they should stay in
233 /usr/lib/pythonX/site-packages, but Cheetah seems happy in both 2.2 and
234 2.3 and so is a good candidate for /usr/lib/site-python.
235
236
5e5892b *** empty log message ***
hierro authored
237 User-defined directives
238 =======================================================================
239 IF we decide to support user-defined directives someday, consider Spyce's
240 interface. Spyce uses a base class which provides generic services to
241 custom "active tags".
242 http://spyce.sourceforge.net/doc-tag.html
243 http://spyce.sourceforge.net/doc-tag_new.html
244
a08b622 *** empty log message ***
hierro authored
245
32567d8 Initial revision
tavis_rudd authored
246 Test Suite
247 ================================================================================
0cbb2a2 updated
tavis_rudd authored
248 - add cases that test the cheetah-compile script
2b1d9df removed some crap that has been done and some stuff that is no longer re...
tavis_rudd authored
249 - add cases that test the integration with various webdev frameworks
32567d8 Initial revision
tavis_rudd authored
250
251 Examples
252 ================================================================================
253 - create some non-html code generation examples
0cbb2a2 updated
tavis_rudd authored
254 - SQL
255 - LaTeX
256 - form email
6d1d0e1 *** empty log message ***
hierro authored
257 - Template definitions in a database. .py template modules in a
258 database? Caching template classes and/or instances extracted from
259 a database.
260 - Pickled templates?
5329f63 *** empty log message ***
hierro authored
261
Something went wrong with that request. Please try again.