- Timestamp:
- 10/25/03 00:06:43 (21 years ago)
- Location:
- pykota/trunk
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/cgi-bin/printquota.cgi
r1162 r1172 23 23 # 24 24 # $Log$ 25 # Revision 1.15 2003/10/24 22:06:42 jalet 26 # Initial support for browser's language preference added. 27 # 25 28 # Revision 1.14 2003/10/10 19:48:07 jalet 26 29 # Now displays version number … … 111 114 </html>""" 112 115 116 def getLanguagePreference() : 117 """Returns the preferred language.""" 118 languages = os.environ.get("HTTP_ACCEPT_LANGUAGE", "") 119 langs = [l.strip().split(';')[0] for l in languages.split(",")] 120 return "%s_%s" % (langs[0], langs[0].upper()) 113 121 114 122 class PyKotaReportGUI(PyKotaTool) : 115 123 """PyKota Administrative GUI""" 124 116 125 def guiDisplay(self) : 117 126 """Displays the administrative interface.""" … … 119 128 print header % version.__version__ 120 129 print self.body 130 print "<!-- %s -->" % str(getLanguagePreference()) 121 131 print footer 122 132 … … 193 203 self.reportingtool = openReporter(admin, "text", printers, ugmask.split(), isgroup) 194 204 self.body += "<pre>%s</pre>" % self.reportingtool.generateReport() 195 205 196 206 if __name__ == "__main__" : 197 admin = PyKotaReportGUI() 207 os.environ["LC_ALL"] = getLanguagePreference() 208 admin = PyKotaReportGUI(lang=os.environ["LC_ALL"]) 198 209 admin.form = cgi.FieldStorage() 199 210 admin.guiAction() 200 211 admin.guiDisplay() 201 202 212 try : 203 213 admin.storage.close() -
pykota/trunk/NEWS
r1170 r1172 22 22 PyKota NEWS : 23 23 24 - 1.16alpha2 : 25 26 - CGI script now partially supports browser's language preference 27 24 28 - 1.16alpha1 : 25 29 -
pykota/trunk/pykota/version.py
r1170 r1172 22 22 # 23 23 24 __version__ = "1.16alpha 1_unofficial"24 __version__ = "1.16alpha2_unofficial" 25 25 26 26 __doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""