Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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