Changeset 3295 for pykota/trunk/cgi-bin
- Timestamp:
- 01/21/08 21:00:58 (17 years ago)
- Location:
- pykota/trunk/cgi-bin
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/cgi-bin/dumpykota.cgi
r3275 r3295 29 29 import urllib 30 30 31 from pykota import version 32 from pykota .tool import PyKotaToolError31 import pykota.appinit 32 from pykota import version, utils 33 33 from pykota.dumper import DumPyKota 34 from pykota.cgifuncs import getLanguagePreference, getCharsetPreference35 34 36 35 header = """Content-type: text/html;charset=%s … … 68 67 </head> 69 68 <body> 70 <!-- %s %s -->71 69 <p> 72 70 <form action="dumpykota.cgi" method="GET" name="mainform" onsubmit="return checkvalues()"> … … 123 121 """Displays the dumper interface.""" 124 122 global header, footer 125 print header % (self.charset, _("PyKota Data Dumper"), \ 126 self.language, self.charset, \ 123 content = [ header % (self.charset, _("PyKota Data Dumper"), \ 127 124 self.config.getLogoLink(), \ 128 125 self.config.getLogoURL(), version.__version__, \ 129 126 self.config.getLogoLink(), \ 130 127 version.__version__, _("PyKota Data Dumper"), \ 131 _("Dump"), _("Please click on the above button")) 132 print self.htmlListDataTypes(self.options.get("data", "")) 133 print "<br />" 134 print self.htmlListFormats(self.options.get("format", "")) 135 print "<br />" 136 print self.htmlFilterInput(" ".join(self.arguments)) 137 print "<br />" 138 print self.htmlOrderbyInput(self.options.get("orderby", "")) 139 print "<br />" 140 print self.htmlSumCheckbox(self.options.get("sum", "")) 141 print footer % (_("Dump"), version.__doc__, version.__years__, version.__author__, version.__gplblurb__) 128 _("Dump"), _("Please click on the above button")) ] 129 content.append(self.htmlListDataTypes(self.options.get("data", ""))) 130 content.append(u"<br />") 131 content.append(self.htmlListFormats(self.options.get("format", ""))) 132 content.append(u"<br />") 133 content.append(self.htmlFilterInput(" ".join(self.arguments))) 134 content.append(u"<br />") 135 content.append(self.htmlOrderbyInput(self.options.get("orderby", ""))) 136 content.append(u"<br />") 137 content.append(self.htmlSumCheckbox(self.options.get("sum", ""))) 138 content.append(footer % (_("Dump"), version.__doc__, version.__years__, version.__author__, version.__gplblurb__)) 139 for c in content : 140 sys.stdout.write(c.encode(self.charset, "replace")) 141 sys.stdout.flush() 142 142 143 143 def htmlListDataTypes(self, selected="") : … … 236 236 237 237 if __name__ == "__main__" : 238 admin = PyKotaDumperGUI(lang=getLanguagePreference(), charset=getCharsetPreference()) 238 utils.reinitcgilocale() 239 admin = PyKotaDumperGUI() 239 240 admin.deferredInit() 240 241 admin.form = cgi.FieldStorage() -
pykota/trunk/cgi-bin/printquota.cgi
r3275 r3295 31 31 from mx import DateTime 32 32 33 from pykota import version 34 from pykota.tool import PyKotaTool, PyKotaToolError 35 from pykota.reporter import PyKotaReporterError, openReporter 36 from pykota.cgifuncs import getLanguagePreference, getCharsetPreference 33 import pykota.appinit 34 35 from pykota import version, utils 36 from pykota.tool import PyKotaTool 37 from pykota.errors import PyKotaToolError, PyKotaReporterError 38 from pykota.reporter import openReporter 37 39 38 40 header = """Content-type: text/html;charset=%s … … 44 46 </head> 45 47 <body> 46 <!-- %s %s -->47 48 <p> 48 49 <form action="printquota.cgi" method="POST"> … … 96 97 """Displays the administrative interface.""" 97 98 global header, footer 98 print header % (self.charset, _("PyKota Reports"), \ 99 self.language, self.charset, \ 100 self.config.getLogoLink(), \ 101 self.config.getLogoURL(), version.__version__, \ 102 self.config.getLogoLink(), \ 103 version.__version__, _("PyKota Reports"), \ 104 _("Report")) 105 print self.body 106 print footer % (_("Report"), version.__doc__, version.__years__, version.__author__, version.__gplblurb__) 99 content = [ header % (self.charset, _("PyKota Reports"), \ 100 self.config.getLogoLink(), \ 101 self.config.getLogoURL(), version.__version__, \ 102 self.config.getLogoLink(), \ 103 version.__version__, _("PyKota Reports"), \ 104 _("Report")) ] 105 content.append(self.body) 106 content.append(footer % (_("Report"), version.__doc__, version.__years__, version.__author__, version.__gplblurb__)) 107 for c in content : 108 sys.stdout.write(c.encode(self.charset, "replace")) 109 sys.stdout.flush() 107 110 108 111 def error(self, message) : … … 287 290 288 291 if __name__ == "__main__" : 289 admin = PyKotaReportGUI(lang=getLanguagePreference(), charset=getCharsetPreference()) 292 utils.reinitcgilocale() 293 admin = PyKotaReportGUI() 290 294 admin.deferredInit() 291 295 admin.form = cgi.FieldStorage() -
pykota/trunk/cgi-bin/pykotme.cgi
r3275 r3295 30 30 import cStringIO 31 31 32 from pykota import version 33 from pykota.tool import PyKotaTool, PyKotaToolError 34 from pykota.cgifuncs import getLanguagePreference, getCharsetPreference 32 import pykota.appinit 33 34 from pykota import version, utils 35 from pykota.tool import PyKotaTool 36 from pykota.errors import PyKotaToolError 37 35 38 from pkpgpdls import analyzer, pdlparser 36 39 … … 44 47 </head> 45 48 <body> 46 <!-- %s %s -->47 49 <p> 48 50 <form action="pykotme.cgi" method="POST" enctype="multipart/form-data"> … … 96 98 """Displays the administrative interface.""" 97 99 global header, footer 98 print header % (self.charset, _("PyKota Quotes"), \ 99 self.language, self.charset, \ 100 content = [ header % (self.charset, _("PyKota Quotes"), \ 100 101 self.config.getLogoLink(), \ 101 102 self.config.getLogoURL(), version.__version__, \ 102 103 self.config.getLogoLink(), \ 103 104 version.__version__, _("PyKota Quotes"), \ 104 _("Quote")) 105 print self.body 106 print footer % (_("Quote"), version.__doc__, version.__years__, version.__author__, version.__gplblurb__) 105 _("Quote")) ] 106 content.append(self.body) 107 content.append(footer % (_("Quote"), version.__doc__, version.__years__, version.__author__, version.__gplblurb__)) 108 for c in content : 109 sys.stdout.write(c.encode(self.charset, "replace")) 110 sys.stdout.flush() 107 111 108 112 def error(self, message) : … … 187 191 188 192 if __name__ == "__main__" : 189 admin = PyKotMeGUI(lang=getLanguagePreference(), charset=getCharsetPreference()) 193 utils.reinitcgilocale() 194 admin = PyKotMeGUI() 190 195 admin.deferredInit() 191 196 admin.form = cgi.FieldStorage()