Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 184 lines (153 sloc) 8.608 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 =========================================================================
13 - write a formalized grammar for Cheetah in BNF
c79ab09 *** empty log message ***
hierro authored
14 - update User's Guide about changes to SkeletonPage (no more #settings,
15 etc) (TR)
448c9b0 *** empty log message ***
hierro authored
16 - document all methods/attributes inherited from Template and
17 WebKit.Servlet/Cheetah.DummyServlet, for section 11.5 of the Users' Guide.
18 Distinguish those that are frequently used by the template maintainer,
19 those occasionally used, and those never used. These must be documented
20 to avoid unknowingly overriding a Template/Servlet variable and causing
21 side effects.
c79ab09 *** empty log message ***
hierro authored
22 - decide whether/when to change the way local/global/builtin variables
23 are looked up (see below).
e07ad1e *** empty log message ***
hierro authored
24
25
26 Other TODO Items
32567d8 Initial revision
tavis_rudd authored
27 ================================================================================
d1a5287 added notes and change the version number
tavis_rudd authored
28
73ce5a8 *** empty log message ***
hierro authored
29 - revisit parsed #include directives. Are they necessary at all??
30 (This is a rhetorical question. They are necessary. However, the
31 Users' Guide needs better examples about when and when not to use
32 #include. Also, consider making '#include' do a raw include, and
33 something else do a parsed include ('#include parsed', '#include cheetah'?),
34 so that users get parsing only if they explicitly request it.
578d388 updated
tavis_rudd authored
35
47eece1 *** empty log message ***
tavis_rudd authored
36 - implement some better error handling for misformed #for, #if, #try directives,
37 etc. At the moment these errors are not caught until Python executes the
38 code.
6f5a89f *** empty log message ***
tavis_rudd authored
39
40 - create better error message for bad code such as:
41 ##cache
42 This is a cached region. $voom
43 #end cache
44
1086d3c Elaborate whitespace-comment problem.
hierro authored
45 - Delete whitespace before a comment on the same line. The methods are
46 Parser.eatComment() and Parser.eatMultiLineComment(). It's already
47 working if the line contains 'STUFF#slurp ## comment'. Need to make
48 it work for 'STUFF ## comment' (but retain the EOL newline).
0beed83 *** empty log message ***
tavis_rudd authored
49
50 - 'python setup.py uninstall'. This may require hacking an uninstall feature
51 into distutils.
52
cbdb049 *** empty log message ***
hierro authored
53 - 'errorCatcher None' to stop catching errors in the middle of a template.
f4b3b51 *** empty log message ***
hierro authored
54
0c131e3 *** empty log message ***
hierro authored
55 - #del is the only statement that's missing, and there seems to be no other way
56 to do it. #silent wants an expression, not a statement. I'm mainly thinking
57 about deleting keys from local dictionaries -- delattr() doesn't do this --
58 but there's no reason it shouldn't work on local subscripts, attributes and
59 variables too. Leave open the possibility for '#del global' (opposite of
60 '#set global') in the future if it's needed, and
61 '#del searchList $var["key"]' too. I don't know about '#del searchList $var':
62 that could be hard to implement, but maybe somebody will want it someday.
63
982f7b9 *** empty log message ***
hierro authored
64 - Finish up changes to #indent so that it matches the Users' Guide. (MO)
65
d1e5768 *** empty log message ***
hierro authored
66
67 Rewrite the caching framework
68 =============================
69 - add #cache varyBy= (tied to Tavis' proposed caching framework for Webware)
70
71 - #cache test= with a one-variable test produces invalid Python (an empty
72 if-block). Example in Cheetah Developers' Guide, section
73 "#cache with test: expression and method conditions".
74
75 - #cache id= seems to be ignoring the ID and generating a random numeric
76 ID instead. Is it working? Do cache IDs have to be numeric?
77
78 - Other ideas in Tavis' head.
79
c79ab09 *** empty log message ***
hierro authored
80 - Have an option to refresh the cache whenever an external
81 file is updated. This would allow a data structure to be kept in
82 sync whenever its text configuration file is changed.
83
84
85
86 local/global/builtin variable lookup
87 ==============================================================================
88 Cheetah currently does not allow users to override Python's builtin functions.
89 This provides safety because it prevents users from overriding e.g. $str and
90 breaking Cheetah horribly. However, it also prevents users from using common
91 placeholder names such as $file, $max, $property, etc.; often requiring
92 convoluted circumlocutions to shadow a database field that's named one of
93 those. Worse, the application developer (template maintainer) can't be sure
94 the user's version of Python won't have a new builtin defined that will make
95 the template fail.
96
97 Related to this is the question of whether to use bare variable names for
98 lookup of local/global/builtin variables. Currently at compile time, Cheetah
99 looks for a local/global/builtin variable and, if found, generates a bare
100 variable name. If it's not found, it generates a a NameMapper lookup instead.
101 Lookup of bare variable names is much faster, but it complicates the
102 implementation and may contribute to the can't-override-builtins problem.
103
104 To get rid of bare variable names in compiled templates, we'd need to add
105 the equivalent objects to the searchList:
106 1) locals()
107 2) "#set global" variables
108 3) ... [user-defined searchList] ...
109 4) self -- the compiled template object
110 4) globals() -- for imported objects
111 5) __builtins__
112 The order these objects appear in the searchList may be subject to debate.
a08b622 *** empty log message ***
hierro authored
113
55de2db Comment.
hierro authored
114 #entry $func($arg1, $arg2="default", $**kw)
625de1d *** empty log message ***
hierro authored
115 ===============================================================================
55de2db Comment.
hierro authored
116 Make a wrapper function in the .py template module that builds a searchList
117 from its positional arguments, then instantiates and fills a template and
118 returns the result. The preceding example would create a function thus:
119 def func(arg1, arg2="default", searchList=None, **kw):
625de1d *** empty log message ***
hierro authored
120 """Function docstring."""
55de2db Comment.
hierro authored
121 sl = {'arg1': arg1, 'arg2': arg2}
122 if searchList is None:
123 searchList = [sl]
124 elif type(searchList) == types.ListType:
125 searchList.insert(0, sl)
126 else:
127 raise TypeError("arg 'searchList'")
128 t = TheTemplate(searchList=searchList, **kw)
625de1d *** empty log message ***
hierro authored
129 return str(t)
55de2db Comment.
hierro authored
130 ##doc-entry: and #*doc-entry: comments are appended to the function docstring.
625de1d *** empty log message ***
hierro authored
131 Finally, make this function accessible directly from the shell.
132 If there are any non-option arguments on the command line, call the function
133 instead of filling the template the normal way.
55de2db Comment.
hierro authored
134 This would perhaps make more sense as arguments to .respond(). But
135 .respond() has that pesky 'trans' argument that mustn't be interfered with,
136 and other programs may assume .respond() takes only one argument. Also,
137 when called via str(), str() cannot take arguments.
625de1d *** empty log message ***
hierro authored
138
139
63640d7 *** empty log message ***
hierro authored
140 Upload File
141 ========================================================================
142 A mixin method in Cheetah.Utils (for Template) that handles file uploads --
143 these are too complicated for .webInput(). The method should do a "safe"
144 file upload; e.g., http://us3.php.net/manual/en/features.file-upload.php ,
145 within the limitations of Python's cgi module. The user has the choice of
146 three destinations for the file contents: (A) copied to a local
147 path you specify, (B) placed in a namespace variable like .cgiImport()
148 does, or (C) returned. (B) parallels .webInput, but (A) will certainly be
149 desirable situations where we just want to save the file, not read it into
150 memory. Reject files larger than a user-specified size or not in a list of
151 user-approved MIME types. Define appropriate exceptions for typical
152 file-upload errors. Method name .webUploadFileAsString?
153 One situation to support is when form has a text(area) field
154 related to a file-upload control on the same form, and the user has the choice
155 of typing into the field or uploading a text file. We need a method that
156 updates the text field's value if there is an uploaded file, but not if there
157 isn't. This may be handled by the regular method(s) or may require a separate
158 method.
625de1d *** empty log message ***
hierro authored
159
a08b622 *** empty log message ***
hierro authored
160
32567d8 Initial revision
tavis_rudd authored
161 Test Suite
162 ================================================================================
163 - test cases for the SkeletonPage framework
0cbb2a2 updated
tavis_rudd authored
164 - add cases that test the cheetah-compile script
0916737 *** empty log message ***
hierro authored
165 - add cases that test the integration with WebKit. Since these must be called
166 from a running WebKit server, make a servlet that runs the tests and outputs
167 diagnostics to the browser.
32567d8 Initial revision
tavis_rudd authored
168
169 Website
170 ================================================================================
8d09b72 *** empty log message ***
tavis_rudd authored
171 - automate the documentation update
32567d8 Initial revision
tavis_rudd authored
172 - See if we can get WebKit working on Sourceforge...
173
174 Examples
175 ================================================================================
176 - create some non-html code generation examples
0cbb2a2 updated
tavis_rudd authored
177 - SQL
178 - LaTeX
179 - form email
6d1d0e1 *** empty log message ***
hierro authored
180 - Template definitions in a database. .py template modules in a
181 database? Caching template classes and/or instances extracted from
182 a database.
183 - Pickled templates?
Something went wrong with that request. Please try again.