ó [Z-Lc@sOdZdZddd!ZddlZddlmZdefd „ƒYZdS( s‹A subclass of Cheetah.Template for use in CGI scripts. Usage in a template: #extends Cheetah.Tools.CGITemplate #implements respond $cgiHeaders#slurp Usage in a template inheriting a Python class: 1. The template #extends MyPythonClass #implements respond $cgiHeaders#slurp 2. The Python class from Cheetah.Tools import CGITemplate class MyPythonClass(CGITemplate): def cgiHeadersHook(self): return "Content-Type: text/html; charset=koi8-r " To read GET/POST variables, use the .webInput method defined in Cheetah.Utils.WebInputMixin (available in all templates without importing anything), use Python's 'cgi' module, or make your own arrangements. This class inherits from Cheetah.Template to make it usable in Cheetah's single-inheritance model. Meta-Data ================================================================================ Author: Mike Orr License: This software is released for unlimited distribution under the terms of the MIT license. See the LICENSE file. Version: $Revision: 1.6 $ Start Date: 2001/10/03 Last Revision Date: $Date: 2006/01/29 02:09:59 $ sMike Orr s$Revision: 1.6 $i iž’’’i’’’’N(tTemplatet CGITemplatecBs)eZdZd„Zd„Zd„ZRS(sqMethods useful in CGI scripts. Any class that inherits this mixin must also inherit Cheetah.Servlet. cCs|jƒr|jƒSdS(s«Outputs the CGI headers if this is a CGI script. Usage: $cgiHeaders#slurp Override .cgiHeadersHook() if you want to customize the headers. N(tisCgitcgiHeadersHook(tself((sF/opt/freeware/lib/python2.7/site-packages/Cheetah/Tools/CGITemplate.pyt cgiHeaders3s cCsdS(s;Override if you want to customize the CGI headers. sContent-type: text/html ((R((sF/opt/freeware/lib/python2.7/site-packages/Cheetah/Tools/CGITemplate.pyR>scCs#dtjk}|j}|o"| S(sIs this a CGI script? tREQUEST_METHOD(tostenviront_CHEETAH__isControlledByWebKit(Rtenvtwk((sF/opt/freeware/lib/python2.7/site-packages/Cheetah/Tools/CGITemplate.pyRDs (t__name__t __module__t__doc__RRR(((sF/opt/freeware/lib/python2.7/site-packages/Cheetah/Tools/CGITemplate.pyR,s (Rt __author__t __revision__RtCheetah.TemplateRR(((sF/opt/freeware/lib/python2.7/site-packages/Cheetah/Tools/CGITemplate.pyt%s