Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 203 lines (165 sloc) 8.862 kb
32567d8 Initial revision
tavis_rudd authored
1 Cheetah TODO list
5610e47 added some instructions
tavis_rudd authored
2 -----------------
32567d8 Initial revision
tavis_rudd authored
3
5610e47 added some instructions
tavis_rudd authored
4 * If you are working on a task please put your initials at the end of the
5 description
32567d8 Initial revision
tavis_rudd authored
6
9eb346f updated the list
tavis_rudd authored
7 * When a task is completed please remember to note it in the CHANGES file
5610e47 added some instructions
tavis_rudd authored
8
9 Languague Specification
32567d8 Initial revision
tavis_rudd authored
10 ================================================================================
d1a5287 added notes and change the version number
tavis_rudd authored
11
73ce5a8 *** empty log message ***
hierro authored
12 - revisit parsed #include directives. Are they necessary at all??
13 (This is a rhetorical question. They are necessary. However, the
14 Users' Guide needs better examples about when and when not to use
15 #include. Also, consider making '#include' do a raw include, and
16 something else do a parsed include ('#include parsed', '#include cheetah'?),
17 so that users get parsing only if they explicitly request it.
578d388 updated
tavis_rudd authored
18
0cbb2a2 updated
tavis_rudd authored
19 - write a formalized grammar for Cheetah in BNF
d1a5287 added notes and change the version number
tavis_rudd authored
20
32567d8 Initial revision
tavis_rudd authored
21 Implementation
22 ================================================================================
d1a5287 added notes and change the version number
tavis_rudd authored
23
47eece1 *** empty log message ***
tavis_rudd authored
24 - implement some better error handling for misformed #for, #if, #try directives,
25 etc. At the moment these errors are not caught until Python executes the
26 code.
6f5a89f *** empty log message ***
tavis_rudd authored
27
28 - create better error message for bad code such as:
29 ##cache
30 This is a cached region. $voom
31 #end cache
32
33 - fix bug in Parser.getDefArgList() that is mucking up lists where the comma has
34 been forgotten:
35
36 > #cache timer='.5m' id='cache1'
37 > This is a cached region. $voom
38 > #end cache
39 >
40 > the error is:
41 >
42 > "/local/opt/Python/lib/python2.2/site-packages/Webware/Cheetah/Compiler.py",
43 > line 102, in genCacheInfoFromArgList
44 > val = self.genTimeInterval(val)
45 > File
46 > "/local/opt/Python/lib/python2.2/site-packages/Webware/Cheetah/Compiler.py",
47 > line 75, in genTimeInterval
48 > interval = float(timeString)*60
49 > ValueError: invalid literal for float(): .5m' id'cache1
50 >
51 >
52 > Running under pdb shows that Parser.getDefArgList() returned:
53 > "30m' id'cache1" .
54
47eece1 *** empty log message ***
tavis_rudd authored
55
f4b3b51 *** empty log message ***
hierro authored
56 - Delete whitespace before comments. If the rest of the line consists
57 of only non-outputting directives and whitespace, delete the line from the
58 output. The only outputting directives I see are #echo, #block and
0beed83 *** empty log message ***
tavis_rudd authored
59 #include. -- MO
60
61 - 'python setup.py uninstall'. This may require hacking an uninstall feature
62 into distutils.
63
cbdb049 *** empty log message ***
hierro authored
64 - 'errorCatcher None' to stop catching errors in the middle of a template.
f4b3b51 *** empty log message ***
hierro authored
65
0c131e3 *** empty log message ***
hierro authored
66 - #del is the only statement that's missing, and there seems to be no other way
67 to do it. #silent wants an expression, not a statement. I'm mainly thinking
68 about deleting keys from local dictionaries -- delattr() doesn't do this --
69 but there's no reason it shouldn't work on local subscripts, attributes and
70 variables too. Leave open the possibility for '#del global' (opposite of
71 '#set global') in the future if it's needed, and
72 '#del searchList $var["key"]' too. I don't know about '#del searchList $var':
73 that could be hard to implement, but maybe somebody will want it someday.
74
d1e5768 *** empty log message ***
hierro authored
75
76 Rewrite the caching framework
77 =============================
78 - add #cache varyBy= (tied to Tavis' proposed caching framework for Webware)
79
80 - #cache test= with a one-variable test produces invalid Python (an empty
81 if-block). Example in Cheetah Developers' Guide, section
82 "#cache with test: expression and method conditions".
83
84 - #cache id= seems to be ignoring the ID and generating a random numeric
85 ID instead. Is it working? Do cache IDs have to be numeric?
86
87 - Other ideas in Tavis' head.
88
89
a08b622 *** empty log message ***
hierro authored
90 Cheetah command revamp
91 ===============================================================================
92 - Usage: cheetah COMMAND ARGUMENTS
93 - Commands:
94 cheetah --help | -h
95 cheetah --version
96 cheetah compile | c # .tmpl -> .py
97 cheetah fill | f # .tmpl -> .html (Not implemented yet)
98
99 - Options common to 'compile', 'fill' and 'cgi':
100 -i EXT # input file extension (-i '' for no ext)
101 -o EXT # output file extension (-o '' for no ext)
102 -R # recurse subdirectories
103 - # (as input filename) input from stdin
104 -p # output to stdout
105
106 - Options for 'fill' (and .py template modules):
107 --env # Push environment onto searchList.
108 --pickle=FILE # Unpickle FILE and push onto searchList.
109 # (--pickle=- => unpickle from stdin)
110
111 - Remove options:
112 cheetah-compile -w # Same as 'cheetah fill' but less powerful.
113 cheetah -c # 'cheetah c' is easier to type.
114 -p (pickle) # Conflicts with -p (to stdout)
115
116 - Input extension, unless overridden by -i, is ".tmpl". If an input file is
117 specified but does not exist, try adding this extension. When recursing,
118 consider only files with this extension.
119
120 - Output extension, unless overridden by -o, is ".py" for 'cheetah compile'
121 and 'cheetah cgi', and ".html" for 'cheetah fill'.
122
123 - Program will examine its own name ( os.path.basename(sys.argv[0]) ), and if
124 it looks like "cheetah-WORD", use WORD as the command instead of sys.argv[1] .
125 Then cheetah-compile can be a symlink or copy of this, and people can create
126 cheetah-fill etc if desired.
127
128
625de1d *** empty log message ***
hierro authored
129 #wrapper
130 ===============================================================================
131 Goal: make it more convenient to use templates in programs by providing a
132 wrapper function in the .py template module. The function specifies how
133 many arguments it needs and creates a searchList based on those arguments.
134 New directives: #wrapper, ##doc-wrapper:, #*doc-wrapper: ... *#
135 Usage: #wrapper $func($arg1, $arg2="default", ...)
136 This example creates the following function in the .py template module:
137 def func(arg1, arg2="default", ...):
138 """Function docstring."""
139 sl = {'arg1': arg1, 'arg2': arg2, ...}
140 t = TheTemplate(searchList=[sl])
141 return str(t)
142 The doc-wrapper directives append the text to the #wrapper's docstring.
143 Finally, make this function accessible directly from the shell.
144 If there are any non-option arguments on the command line, call the function
145 instead of filling the template the normal way.
146 There should be only one #wrapper per template. We could allow
147 multiple if there's a demand, but #wrapper is mainly intended for templates
148 that want to be called one particular way. If we do have multiple functions,
149 we'd need a rule that doc-wrapper's apply to the previous function, and the
150 shell command line would have to specify the function name, either as
151 template.py -w func "arg1" "arg2"
152 or template.py func "arg1" "arg2"
153 In the latter case, the function name would always have to be specified,
154 which I think is undesired.
fc953bf *** empty log message ***
hierro authored
155 Should it be called #wrapper, #access, #entry, etc?
625de1d *** empty log message ***
hierro authored
156
157
63640d7 *** empty log message ***
hierro authored
158 Upload File
159 ========================================================================
160 A mixin method in Cheetah.Utils (for Template) that handles file uploads --
161 these are too complicated for .webInput(). The method should do a "safe"
162 file upload; e.g., http://us3.php.net/manual/en/features.file-upload.php ,
163 within the limitations of Python's cgi module. The user has the choice of
164 three destinations for the file contents: (A) copied to a local
165 path you specify, (B) placed in a namespace variable like .cgiImport()
166 does, or (C) returned. (B) parallels .webInput, but (A) will certainly be
167 desirable situations where we just want to save the file, not read it into
168 memory. Reject files larger than a user-specified size or not in a list of
169 user-approved MIME types. Define appropriate exceptions for typical
170 file-upload errors. Method name .webUploadFileAsString?
171 One situation to support is when form has a text(area) field
172 related to a file-upload control on the same form, and the user has the choice
173 of typing into the field or uploading a text file. We need a method that
174 updates the text field's value if there is an uploaded file, but not if there
175 isn't. This may be handled by the regular method(s) or may require a separate
176 method.
625de1d *** empty log message ***
hierro authored
177
a08b622 *** empty log message ***
hierro authored
178
32567d8 Initial revision
tavis_rudd authored
179 Test Suite
180 ================================================================================
181 - test cases for the SkeletonPage framework
0cbb2a2 updated
tavis_rudd authored
182 - add cases that test the cheetah-compile script
0916737 *** empty log message ***
hierro authored
183 - add cases that test the integration with WebKit. Since these must be called
184 from a running WebKit server, make a servlet that runs the tests and outputs
185 diagnostics to the browser.
32567d8 Initial revision
tavis_rudd authored
186
187 Website
188 ================================================================================
8d09b72 *** empty log message ***
tavis_rudd authored
189 - automate the documentation update
32567d8 Initial revision
tavis_rudd authored
190 - See if we can get WebKit working on Sourceforge...
191
192 Examples
193 ================================================================================
194 - create some non-html code generation examples
0cbb2a2 updated
tavis_rudd authored
195 - SQL
196 - LaTeX
197 - form email
6d1d0e1 *** empty log message ***
hierro authored
198 - Template definitions in a database. .py template modules in a
199 database? Caching template classes and/or instances extracted from
200 a database.
201 - Pickled templates?
c7d48b5 further merges of the DEVEL_BRANCH code
tavis_rudd authored
202
Something went wrong with that request. Please try again.