Ignore:
Timestamp:
13/03/07 22:00:27 (13 years ago)
Author:
lawrence
Message:

Modifications to support unicode properly, and handle MDIP a bit better

Location:
TI07-MOLES/trunk/PythonCode/wsgi
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • TI07-MOLES/trunk/PythonCode/wsgi/DocumentRetrieve.py

    r2260 r2274  
    3333            raise TypeError('DocumentRetrieve code does not yet know how to find specific CSML Documents') 
    3434         
    35         elif (schema[0:5] == 'NDG-B' or schema[0:3]=='DIF'): 
     35        elif (schema[0:5] == 'NDG-B' or schema[0:3]=='DIF' or schema[0:4] == 'MDIP'): 
    3636             
    3737            # find out what type of object actually exists of this sort 
  • TI07-MOLES/trunk/PythonCode/wsgi/ETxmlView.py

    r2229 r2274  
    212212    """ 
    213213    """ 
    214      
    215214    def setUp(self): 
    216215        ''' Load example files for testing, and get pointers to their dataset identifiers ''' 
  • TI07-MOLES/trunk/PythonCode/wsgi/ndgDiscovery.py

    r2097 r2274  
    3838        d=DiscoveryGUI(environ,self.config,self.logger) 
    3939 
    40         start_response('200 OK', [('Content-Type', 'text/html')]) 
     40        start_response('200 OK', [('Content-Type', 'text/html'),('charset','utf-8')]) 
    4141        #h='<p>%s:%s</p>'%(str(inputs),self.config.get('SEARCH','advancedURL')) 
    42         return [d.html] 
     42        return [d.html.encode('utf-8')] 
  • TI07-MOLES/trunk/PythonCode/wsgi/ndgRetrieve.py

    r2260 r2274  
    9494        ctype,r=self._present(inputs,ctype) 
    9595         
    96         start_response('200 OK', [('Content-Type', ctype)]) 
    97         return [r] 
     96        start_response('200 OK', [('Content-Type', ctype),('charset','utf-8')]) 
     97        return [r.encode('utf-8')] 
    9898                 
    9999    def _present(self,inputs,ctype): 
  • TI07-MOLES/trunk/PythonCode/wsgi/renderEntity.py

    r2260 r2274  
    163163    html='' 
    164164    if len(keywords)==0: 
    165             if tell: html+='''<tr><td> This record is morally invalid: what are the %ss? '''%title 
     165            if tell: html+='''<tr><td class="line" width="20%%">%s</td> 
     166            <td> Unfortunately it appears that this record is not faithfully  
     167            translated in our system (either that, or it's morally invalid since all records should have 
     168            %s(s)). You can see the original record in xml by choosing the appropriate icon below.</td></tr> '''%(title,title) 
    166169    else: 
    167170        if len(keywords)==1:  
Note: See TracChangeset for help on using the changeset viewer.