Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 232 lines (199 sloc) 11.291 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
e07ad1e *** empty log message ***
hierro authored
10
448c9b0 *** empty log message ***
hierro authored
11 Requirements for 1.0
e07ad1e *** empty log message ***
hierro authored
12 =========================================================================
533f02a *** empty log message ***
hierro authored
13 - CheetahWrapper bugs: suppress verbose output if --stdout/-p. (MO)
7c2b7c4 *** empty log message ***
hierro authored
14 - NameMapper attributes before keys, both Python and C versions. NM should
15 look for a key first, then an attribute. But if (1) this is the first
16 component after $, and (2) isinstance(OBJ, dictTypes), *ignore the
17 attributes* to prevent matching methods like .update, .keys, etc.
18 "dictTypes" is a new compiler setting with the default value
19 (types.DictType, UserDict). (TR)
c79ab09 *** empty log message ***
hierro authored
20 - update User's Guide about changes to SkeletonPage (no more #settings,
21 etc) (TR)
72fd467 *** empty log message ***
hierro authored
22 - Decide on Cheetah's 1.0 license and update the Users' Guide. (TR)
de8d104 *** empty log message ***
hierro authored
23 - Add an example in the distribution of a simplified SkeletonPage
24 that used #block but does not have fancy esoteric methods like
25 style stuff. (MO)
859cd22 *** empty log message ***
tavis_rudd authored
26 - fix the --stdout option of CheetahWrapper so that it only prints
27 the generated python code.(TR)
e07ad1e *** empty log message ***
hierro authored
28
29
30 Other TODO Items
32567d8 Initial revision
tavis_rudd authored
31 ================================================================================
d1a5287 added notes and change the version number
tavis_rudd authored
32
533f02a *** empty log message ***
hierro authored
33 - CheetahWrapper stuff: (MO)
34 * "cheetah compile --shbang '#!/usr/bin/python2.2'"
35 * "cheetah code [options] [FILES]" print template-specific portion of main
36 method(s) to stdout, with line numbers.
37 * Refactor, make compile/fill/code routines callbacks using a bundle arg.
8e077f0 *** empty log message ***
hierro authored
38
533f02a *** empty log message ***
hierro authored
39 - Debugging tools. See section below.
99009bd *** empty log message ***
hierro authored
40
73ce5a8 *** empty log message ***
hierro authored
41 - revisit parsed #include directives. Are they necessary at all??
42 (This is a rhetorical question. They are necessary. However, the
43 Users' Guide needs better examples about when and when not to use
44 #include. Also, consider making '#include' do a raw include, and
45 something else do a parsed include ('#include parsed', '#include cheetah'?),
46 so that users get parsing only if they explicitly request it.
578d388 updated
tavis_rudd authored
47
47eece1 *** empty log message ***
tavis_rudd authored
48 - implement some better error handling for misformed #for, #if, #try directives,
49 etc. At the moment these errors are not caught until Python executes the
50 code.
6f5a89f *** empty log message ***
tavis_rudd authored
51
52 - create better error message for bad code such as:
53 ##cache
54 This is a cached region. $voom
55 #end cache
56
20f87b7 *** empty log message ***
tavis_rudd authored
57 - create a better error message for invalid syntax when a $var inside a
58 directive is enclosed in ${} or $(). E.g.:
59 #include raw source=${x}
60
1086d3c Elaborate whitespace-comment problem.
hierro authored
61 - Delete whitespace before a comment on the same line. The methods are
62 Parser.eatComment() and Parser.eatMultiLineComment(). It's already
63 working if the line contains 'STUFF#slurp ## comment'. Need to make
64 it work for 'STUFF ## comment' (but retain the EOL newline).
0beed83 *** empty log message ***
tavis_rudd authored
65
66 - 'python setup.py uninstall'. This may require hacking an uninstall feature
67 into distutils.
68
cbdb049 *** empty log message ***
hierro authored
69 - 'errorCatcher None' to stop catching errors in the middle of a template.
f4b3b51 *** empty log message ***
hierro authored
70
d1e5768 *** empty log message ***
hierro authored
71
8f06caf *** empty log message ***
hierro authored
72 Dump Tools
73 ==========
74 It would be nice to provide debugging tools for users who can't figure
75 out why a certain placeholder value isn't found or is being overridden.
76 My idea is to define $dumpSearchList() and $dumpSearchListFlat() in
77 Template, which would print a stanza in the output showing all searchList
78 variables and their values. $dumpSearchList would group by searchList
79 element; $dumpSearchListFlat would combine all into a single
80 alphabetical listing.
bb5709a *** empty log message ***
hierro authored
81 I made an experimental version but it printed only instance variables,
8f06caf *** empty log message ***
hierro authored
82 not methods and not inherited attributes. Also, it wouldn't print right
83 using the usual pattern of write-to-custom-StringIO-object-and-return-
84 the-.getvalue() and I couldn't figure out why.
bb5709a *** empty log message ***
hierro authored
85 The stanza should be set apart by a row of stars with the words
8f06caf *** empty log message ***
hierro authored
86 "BEGIN/END SEARCH LIST DUMP". Then for $dumpSearchList, precede each
87 group with "*** searchList[i], type <element type>, 142 variables ***".
bb5709a *** empty log message ***
hierro authored
88 Because some elements like 'self' may have hundreds of inherited
8f06caf *** empty log message ***
hierro authored
89 methods that would create a forest-through-trees situation for the user,
90 we may need an option to supress the variable listing for elements with
91 > 20 variables (just print the summary line instead). ?
bb5709a *** empty log message ***
hierro authored
92 The final version should be in Template so it has implicit
8f06caf *** empty log message ***
hierro authored
93 access to the searchList and perhaps later to other variables (locals,
94 globals, "#set global"s, builtins) too. This is such a central
95 debugging tool that you should not have to monopolize an #extends
96 (the template's only #extends) to use it. You could import it, however,
97 if you pass in the searchList explicitly as an argument. In that case,
98 perhaps we can base it on a generic module for dumping variables/values.
bb5709a *** empty log message ***
hierro authored
99 Note that we cannot simply depend on str() and pprint, because
8f06caf *** empty log message ***
hierro authored
100 we need to show instances as dictionaries. Likewise, dir() and vars()
101 may get us part of the distance, but only if they show methods and
102 inherited attributes too.
bb5709a *** empty log message ***
hierro authored
103 These functions should print only top-level variables, not
8f06caf *** empty log message ***
hierro authored
104 the subelements of collections. I.e, if the first searchList element
105 is a dictionary, show its keys/values, but do not expand any
106 subvalues if they are dictionaries too, unless the display tool happens
107 to default to that.
108
109
d1e5768 *** empty log message ***
hierro authored
110 Rewrite the caching framework
111 =============================
112 - add #cache varyBy= (tied to Tavis' proposed caching framework for Webware)
113
114 - #cache test= with a one-variable test produces invalid Python (an empty
115 if-block). Example in Cheetah Developers' Guide, section
116 "#cache with test: expression and method conditions".
117
118 - #cache id= seems to be ignoring the ID and generating a random numeric
119 ID instead. Is it working? Do cache IDs have to be numeric?
120
121 - Other ideas in Tavis' head.
122
c79ab09 *** empty log message ***
hierro authored
123 - Have an option to refresh the cache whenever an external
124 file is updated. This would allow a data structure to be kept in
125 sync whenever its text configuration file is changed.
126
55de2db Comment.
hierro authored
127 #entry $func($arg1, $arg2="default", $**kw)
625de1d *** empty log message ***
hierro authored
128 ===============================================================================
55de2db Comment.
hierro authored
129 Make a wrapper function in the .py template module that builds a searchList
130 from its positional arguments, then instantiates and fills a template and
131 returns the result. The preceding example would create a function thus:
bb5709a *** empty log message ***
hierro authored
132 def func(arg1, arg2="default", searchList=None, **kw):
133 """Function docstring."""
134 sl = {'arg1': arg1, 'arg2': arg2}
135 if searchList is None:
136 searchList = [sl]
137 elif type(searchList) == types.ListType:
138 searchList.insert(0, sl)
139 else:
140 raise TypeError("arg 'searchList'")
141 t = TheTemplate(searchList=searchList, **kw)
142 return str(t)
55de2db Comment.
hierro authored
143 ##doc-entry: and #*doc-entry: comments are appended to the function docstring.
bb5709a *** empty log message ***
hierro authored
144 Finally, make this function accessible directly from the shell.
625de1d *** empty log message ***
hierro authored
145 If there are any non-option arguments on the command line, call the function
146 instead of filling the template the normal way.
bb5709a *** empty log message ***
hierro authored
147 This would perhaps make more sense as arguments to .respond(). But
55de2db Comment.
hierro authored
148 .respond() has that pesky 'trans' argument that mustn't be interfered with,
149 and other programs may assume .respond() takes only one argument. Also,
150 when called via str(), str() cannot take arguments.
bb5709a *** empty log message ***
hierro authored
151
152 #indent
153 ========================================================================
154 The current indenter is a kludge that has an indentation object, with
155 implicit placeholder calls added at each line to generate the indentation,
156 and #silent calls to adjust the object. It should be reimplemented to
157 generate code to call the indentation object directly. Also, the user
158 interface should be cleaned up, the implementation and Users' Guide
159 synchronized, and test cases built.
160
161 The desired implementation revolves around self._indenter, which knows the
162 current indentation level (a non-negative integer), chars (the string output
163 per level, default four spaces), and stack (the previous indentation levels).
164 The .indent() method returns the indentation string currently appropriate.
165 The desired interface so far:
166 #indent strip ; strip leading whitespace from input lines
167 #indent add ; add indentation to output lines as appropriate
168 #indent on ; do both
169 #indent off ; do neither
170 #indent reset ; set level to 0 and clear stack
171 #indent ++ ; increment level
172 #indent -- ; decrement level
173 #indent pop [EXPR] ; revert to Nth previous level (default 1)
174 ; if pop past end of stack, set level to 0 and
175 ; clear stack. All +/-/= operations push the old level
176 ; onto the stack.
177 #indent debug ; dump level, chars and stack to template output
178
179 Possible extensions:
180 #indent =EXPR ; set level to N
181 #indent +EXPR ; add N to level (not very necessary)
182 #indent -EXPR ; subtract N from level (not very necessary)
183
184 There should be one indentation object per Template instance, shared by
185 methods and include files.
186
625de1d *** empty log message ***
hierro authored
187
63640d7 *** empty log message ***
hierro authored
188 Upload File
189 ========================================================================
190 A mixin method in Cheetah.Utils (for Template) that handles file uploads --
191 these are too complicated for .webInput(). The method should do a "safe"
192 file upload; e.g., http://us3.php.net/manual/en/features.file-upload.php ,
193 within the limitations of Python's cgi module. The user has the choice of
194 three destinations for the file contents: (A) copied to a local
195 path you specify, (B) placed in a namespace variable like .cgiImport()
196 does, or (C) returned. (B) parallels .webInput, but (A) will certainly be
197 desirable situations where we just want to save the file, not read it into
198 memory. Reject files larger than a user-specified size or not in a list of
199 user-approved MIME types. Define appropriate exceptions for typical
200 file-upload errors. Method name .webUploadFileAsString?
bb5709a *** empty log message ***
hierro authored
201 One situation to support is when form has a text(area) field
63640d7 *** empty log message ***
hierro authored
202 related to a file-upload control on the same form, and the user has the choice
203 of typing into the field or uploading a text file. We need a method that
204 updates the text field's value if there is an uploaded file, but not if there
205 isn't. This may be handled by the regular method(s) or may require a separate
206 method.
625de1d *** empty log message ***
hierro authored
207
a08b622 *** empty log message ***
hierro authored
208
32567d8 Initial revision
tavis_rudd authored
209 Test Suite
210 ================================================================================
211 - test cases for the SkeletonPage framework
0cbb2a2 updated
tavis_rudd authored
212 - add cases that test the cheetah-compile script
0916737 *** empty log message ***
hierro authored
213 - add cases that test the integration with WebKit. Since these must be called
214 from a running WebKit server, make a servlet that runs the tests and outputs
215 diagnostics to the browser.
32567d8 Initial revision
tavis_rudd authored
216
217 Website
218 ================================================================================
8d09b72 *** empty log message ***
tavis_rudd authored
219 - automate the documentation update
32567d8 Initial revision
tavis_rudd authored
220 - See if we can get WebKit working on Sourceforge...
221
222 Examples
223 ================================================================================
224 - create some non-html code generation examples
0cbb2a2 updated
tavis_rudd authored
225 - SQL
226 - LaTeX
227 - form email
6d1d0e1 *** empty log message ***
hierro authored
228 - Template definitions in a database. .py template modules in a
229 database? Caching template classes and/or instances extracted from
230 a database.
231 - Pickled templates?
Something went wrong with that request. Please try again.