Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 180 lines (142 sloc) 7.249 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
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
80
a08b622 *** empty log message ***
hierro authored
81 Cheetah command revamp
82 ===============================================================================
83 - Usage: cheetah COMMAND ARGUMENTS
84 - Commands:
85 cheetah --help | -h
86 cheetah --version
87 cheetah compile | c # .tmpl -> .py
88 cheetah fill | f # .tmpl -> .html (Not implemented yet)
89 cheetah cgi # .tmpl -> CGI script (Not implemented yet)
90
91 - Delay implementation of 'cheetah cgi' until spec is more precise. (In
92 the meantime, you can use 'cheetah compile' and put
93 Content-type: text/html
94 and a blank line at the top of the template definition.)
95
96 - Options common to 'compile', 'fill' and 'cgi':
97 -i EXT # input file extension (-i '' for no ext)
98 -o EXT # output file extension (-o '' for no ext)
99 -R # recurse subdirectories
100 - # (as input filename) input from stdin
101 -p # output to stdout
102
103 - Options for 'fill' (and .py template modules):
104 --env # Push environment onto searchList.
105 --pickle=FILE # Unpickle FILE and push onto searchList.
106 # (--pickle=- => unpickle from stdin)
107
108 - Remove options:
109 cheetah-compile -w # Same as 'cheetah fill' but less powerful.
110 cheetah -c # 'cheetah c' is easier to type.
111 -p (pickle) # Conflicts with -p (to stdout)
112
113 - Input extension, unless overridden by -i, is ".tmpl". If an input file is
114 specified but does not exist, try adding this extension. When recursing,
115 consider only files with this extension.
116
117 - Output extension, unless overridden by -o, is ".py" for 'cheetah compile'
118 and 'cheetah cgi', and ".html" for 'cheetah fill'.
119
120 - Program will examine its own name ( os.path.basename(sys.argv[0]) ), and if
121 it looks like "cheetah-WORD", use WORD as the command instead of sys.argv[1] .
122 Then cheetah-compile can be a symlink or copy of this, and people can create
123 cheetah-fill etc if desired.
124
125
625de1d *** empty log message ***
hierro authored
126 #wrapper
127 ===============================================================================
128 Goal: make it more convenient to use templates in programs by providing a
129 wrapper function in the .py template module. The function specifies how
130 many arguments it needs and creates a searchList based on those arguments.
131 New directives: #wrapper, ##doc-wrapper:, #*doc-wrapper: ... *#
132 Usage: #wrapper $func($arg1, $arg2="default", ...)
133 This example creates the following function in the .py template module:
134 def func(arg1, arg2="default", ...):
135 """Function docstring."""
136 sl = {'arg1': arg1, 'arg2': arg2, ...}
137 t = TheTemplate(searchList=[sl])
138 return str(t)
139 The doc-wrapper directives append the text to the #wrapper's docstring.
140 Finally, make this function accessible directly from the shell.
141 If there are any non-option arguments on the command line, call the function
142 instead of filling the template the normal way.
143 There should be only one #wrapper per template. We could allow
144 multiple if there's a demand, but #wrapper is mainly intended for templates
145 that want to be called one particular way. If we do have multiple functions,
146 we'd need a rule that doc-wrapper's apply to the previous function, and the
147 shell command line would have to specify the function name, either as
148 template.py -w func "arg1" "arg2"
149 or template.py func "arg1" "arg2"
150 In the latter case, the function name would always have to be specified,
151 which I think is undesired.
152
153
154
a08b622 *** empty log message ***
hierro authored
155
32567d8 Initial revision
tavis_rudd authored
156 Test Suite
157 ================================================================================
158 - test cases for the SkeletonPage framework
0cbb2a2 updated
tavis_rudd authored
159 - add cases that test the cheetah-compile script
0916737 *** empty log message ***
hierro authored
160 - add cases that test the integration with WebKit. Since these must be called
161 from a running WebKit server, make a servlet that runs the tests and outputs
162 diagnostics to the browser.
32567d8 Initial revision
tavis_rudd authored
163
164 Website
165 ================================================================================
8d09b72 *** empty log message ***
tavis_rudd authored
166 - automate the documentation update
32567d8 Initial revision
tavis_rudd authored
167 - See if we can get WebKit working on Sourceforge...
168
169 Examples
170 ================================================================================
171 - create some non-html code generation examples
0cbb2a2 updated
tavis_rudd authored
172 - SQL
173 - LaTeX
174 - form email
6d1d0e1 *** empty log message ***
hierro authored
175 - Template definitions in a database. .py template modules in a
176 database? Caching template classes and/or instances extracted from
177 a database.
178 - Pickled templates?
c7d48b5 further merges of the DEVEL_BRANCH code
tavis_rudd authored
179
Something went wrong with that request. Please try again.