Changeset 3055 for pykota/trunk/cgi-bin

Show
Ignore:
Timestamp:
11/12/06 17:16:49 (18 years ago)
Author:
jerome
Message:

Simplified i18n and l10n stuff by removing code used with Python<2.3 => not supported anymore.
Fixed it for working in CGI scripts as expected (better with Python 2.4 and higher).

Location:
pykota/trunk/cgi-bin
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/cgi-bin/dumpykota.cgi

    r3032 r3055  
    3535from pykota.cgifuncs import getLanguagePreference, getCharsetPreference 
    3636 
    37 header = """Content-type: text/html 
    38  
    39 <?xml version="1.0" encoding="%s"?> 
     37header = """Content-type: text/html;charset=%s 
     38 
    4039<html> 
    4140  <head> 
     
    7069  </head> 
    7170  <body> 
     71    <!-- %s %s --> 
    7272    <p> 
    7373      <form action="dumpykota.cgi" method="GET" name="mainform" onsubmit="return checkvalues()"> 
     
    124124        """Displays the dumper interface.""" 
    125125        global header, footer 
    126         print header % (self.getCharset(), _("PyKota Data Dumper"), \ 
     126        print header % (self.charset, _("PyKota Data Dumper"), \ 
     127                        self.language, self.charset, \ 
    127128                        self.config.getLogoLink(), \ 
    128129                        self.config.getLogoURL(), version.__version__, \ 
     
    228229             
    229230if __name__ == "__main__" : 
    230     os.environ["LC_ALL"] = getLanguagePreference() 
    231     admin = PyKotaDumperGUI(lang=os.environ["LC_ALL"], charset=getCharsetPreference()) 
     231    admin = PyKotaDumperGUI(lang=getLanguagePreference(), charset=getCharsetPreference()) 
    232232    admin.deferredInit() 
    233233    admin.form = cgi.FieldStorage() 
  • pykota/trunk/cgi-bin/printquota.cgi

    r3050 r3055  
    3737from pykota.cgifuncs import getLanguagePreference, getCharsetPreference 
    3838 
    39 header = """Content-type: text/html 
    40  
    41 <?xml version="1.0" encoding="%s"?> 
     39header = """Content-type: text/html;charset=%s 
     40 
    4241<html> 
    4342  <head> 
     
    4645  </head> 
    4746  <body> 
     47    <!-- %s %s --> 
    4848    <p> 
    4949      <form action="printquota.cgi" method="POST"> 
     
    9797        """Displays the administrative interface.""" 
    9898        global header, footer 
    99         print header % (self.getCharset(), _("PyKota Reports"), \ 
     99        print header % (self.charset, _("PyKota Reports"), \ 
     100                        self.language, self.charset, \ 
    100101                        self.config.getLogoLink(), \ 
    101102                        self.config.getLogoURL(), version.__version__, \ 
     
    287288             
    288289if __name__ == "__main__" : 
    289     os.environ["LC_ALL"] = getLanguagePreference() 
    290     admin = PyKotaReportGUI(lang=os.environ["LC_ALL"], charset=getCharsetPreference()) 
     290    admin = PyKotaReportGUI(lang=getLanguagePreference(), charset=getCharsetPreference()) 
    291291    admin.deferredInit() 
    292292    admin.form = cgi.FieldStorage() 
  • pykota/trunk/cgi-bin/pykotme.cgi

    r2909 r3055  
    3737     
    3838 
    39 header = """Content-type: text/html 
    40  
    41 <?xml version="1.0" encoding="%s"?> 
     39header = """Content-type: text/html;charset=%s 
     40 
    4241<html> 
    4342  <head> 
     
    4645  </head> 
    4746  <body> 
     47    <!-- %s %s --> 
    4848    <p> 
    4949      <form action="pykotme.cgi" method="POST" enctype="multipart/form-data"> 
     
    9797        """Displays the administrative interface.""" 
    9898        global header, footer 
    99         print header % (self.getCharset(), _("PyKota Quotes"), \ 
     99        print header % (self.charset, _("PyKota Quotes"), \ 
     100                        self.language, self.charset, \ 
    100101                        self.config.getLogoLink(), \ 
    101102                        self.config.getLogoURL(), version.__version__, \ 
     
    187188             
    188189if __name__ == "__main__" : 
    189     os.environ["LC_ALL"] = getLanguagePreference() 
    190     admin = PyKotMeGUI(lang=os.environ["LC_ALL"], charset=getCharsetPreference()) 
     190    admin = PyKotMeGUI(lang=getLanguagePreference(), charset=getCharsetPreference()) 
    191191    admin.deferredInit() 
    192192    admin.form = cgi.FieldStorage()