Changeset 6993 for ceda_http_fileserver


Ignore:
Timestamp:
11/06/10 14:59:47 (9 years ago)
Author:
pjkersha
Message:

Incomplete - task 9: Data Browser Replacement

  • Revised package headers
Location:
ceda_http_fileserver/trunk/ceda_http_fileserver
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • ceda_http_fileserver/trunk/ceda_http_fileserver

    • Property keywords set to "Id"
  • ceda_http_fileserver/trunk/ceda_http_fileserver/ceda/__init__.py

    r6991 r6993  
    1 """ 
     1"""CEDA (Centre for Environmental Data Archival) top-level namespace package 
     2 
     3CEDA HTTP File Server WSGI Application 
    24""" 
    35__author__ = "P J Kershaw" 
    4 __date__ = "15/12/08" 
    5 __copyright__ = "(C) 2009 Science and Technology Facilities Council" 
     6__date__ = "11/06/10" 
     7__copyright__ = "(C) 2010 Science and Technology Facilities Council" 
    68__license__ = """http://www.apache.org/licenses/LICENSE-2.0""" 
    79__contact__ = "Philip.Kershaw@stfc.ac.uk" 
  • ceda_http_fileserver/trunk/ceda_http_fileserver/ceda/server/__init__.py

    r6991 r6993  
    1 """ 
     1"""CEDA (Centre for Environmental Data Archival) server namespace package 
     2 
     3CEDA HTTP File Server WSGI Application 
    24""" 
    35__author__ = "P J Kershaw" 
    4 __date__ = "15/12/08" 
    5 __copyright__ = "(C) 2009 Science and Technology Facilities Council" 
     6__date__ = "11/06/10" 
     7__copyright__ = "(C) 2010 Science and Technology Facilities Council" 
    68__license__ = """http://www.apache.org/licenses/LICENSE-2.0""" 
    79__contact__ = "Philip.Kershaw@stfc.ac.uk" 
  • ceda_http_fileserver/trunk/ceda_http_fileserver/ceda/server/wsgi/__init__.py

    r6991 r6993  
    1 """ 
     1"""CEDA (Centre for Environmental Data Archival) WSGI namespace package 
     2 
     3CEDA HTTP File Server WSGI Application 
    24""" 
    35__author__ = "P J Kershaw" 
    4 __date__ = "15/12/08" 
    5 __copyright__ = "(C) 2009 Science and Technology Facilities Council" 
     6__date__ = "11/06/10" 
     7__copyright__ = "(C) 2010 Science and Technology Facilities Council" 
    68__license__ = """http://www.apache.org/licenses/LICENSE-2.0""" 
    79__contact__ = "Philip.Kershaw@stfc.ac.uk" 
  • ceda_http_fileserver/trunk/ceda_http_fileserver/ceda/server/wsgi/fileserver/__init__.py

    r6991 r6993  
    1 """ 
     1"""CEDA (Centre for Environmental Data Archival) fileserver package 
     2 
     3CEDA HTTP File Server WSGI Application 
    24""" 
    35__author__ = "P J Kershaw" 
    4 __date__ = "15/12/08" 
    5 __copyright__ = "(C) 2009 Science and Technology Facilities Council" 
     6__date__ = "11/06/10" 
     7__copyright__ = "(C) 2010 Science and Technology Facilities Council" 
    68__license__ = """http://www.apache.org/licenses/LICENSE-2.0""" 
    79__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    810__revision__ = '$Id$' 
    9 ''' 
    10 Created on 10 Jun 2010 
    11  
    12 @author: pjkersha 
    13 ''' 
    1411#   Copyright (c) 2006-2007 Open Source Applications Foundation 
    1512# 
     
    3330 
    3431# Content type sources taken from http://en.wikipedia.org/wiki/MIME_type 
    35 content_type_table = {'js': 'application/x-javascript', 'html': 'text/html; charset=utf-8', 
    36                       'fallback':'text/plain; charset=utf-8', 'ogg': 'application/ogg',  
    37                       'xhtml':'text/html; charset=utf-8', 'rm':'audio/vnd.rn-realaudio',  
    38                       'swf':'application/x-shockwave-flash', 'mp3': 'audio/mpeg', 'wma':'audio/x-ms-wma',  
    39                       'ra':'audio/vnd.rn-realaudio', 'wav':'audio/x-wav', 'gif':'image/gif', 'jpeg':'image/jpeg', 
    40                       'jpg':'image/jpeg', 'png':'image/png', 'tiff':'image/tiff', 'css':'text/css; charset=utf-8', 
    41                       'mpeg':'video/mpeg', 'mp4':'video/mp4', 'qt':'video/quicktime', 'mov':'video/quicktime', 
    42                       'wmv':'video/x-ms-wmv', 'atom':'application/atom+xml; charset=utf-8', 
    43                       'xslt':'application/xslt+xml', 'svg':'image/svg+xml', 'mathml':'application/mathml+xml',  
    44                       'rss':'application/rss+xml; charset=utf-8', 
    45                       'ics':'text/calendar; charset=utf-8 '} 
     32content_type_table = { 
     33    'js': 'application/x-javascript',  
     34    'html': 'text/html; charset=utf-8', 
     35    'fallback':'text/plain; charset=utf-8',  
     36    'ogg': 'application/ogg',  
     37    'xhtml':'text/html; charset=utf-8',  
     38    'rm':'audio/vnd.rn-realaudio',  
     39    'swf':'application/x-shockwave-flash',  
     40    'mp3': 'audio/mpeg',  
     41    'wma':'audio/x-ms-wma',  
     42    'ra':'audio/vnd.rn-realaudio',  
     43    'wav':'audio/x-wav',  
     44    'gif':'image/gif',  
     45    'jpeg':'image/jpeg', 
     46    'jpg':'image/jpeg',  
     47    'png':'image/png',  
     48    'tiff':'image/tiff',  
     49    'css':'text/css; charset=utf-8', 
     50    'mpeg':'video/mpeg',  
     51    'mp4':'video/mp4',  
     52    'qt':'video/quicktime',  
     53    'mov':'video/quicktime', 
     54    'wmv':'video/x-ms-wmv',  
     55    'atom':'application/atom+xml; charset=utf-8', 
     56    'xslt':'application/xslt+xml',  
     57    'svg':'image/svg+xml', 'mathml':'application/mathml+xml',  
     58    'rss':'application/rss+xml; charset=utf-8', 
     59    'ics':'text/calendar; charset=utf-8 ' 
     60} 
     61 
    4662 
    4763def reconstruct_url(environ): 
     
    6581    return url 
    6682     
     83     
    6784class FileResponse(object): 
    6885    readsize = 1024 
     86     
    6987    def __init__(self, f, filename): 
    7088        self.size = os.path.getsize(filename) 
    7189        self.f = f 
     90         
    7291    def __iter__(self): 
    7392        output = '\n' 
     
    7695            yield output 
    7796 
    78 class WSGIFileServerApplication(object): 
    79     """Application to serve out windmill provided""" 
     97 
     98class FileServerApp(object): 
     99    """Application to serve static content""" 
    80100     
    81101    def __init__(self, root_path, mount_point=None): 
  • ceda_http_fileserver/trunk/ceda_http_fileserver/ceda/server/wsgi/fileserver/test/__init__.py

    r6991 r6993  
    1 __import__('pkg_resources').declare_namespace(__name__) 
     1"""CEDA (Centre for Environmental Data Archival) unit test package 
     2 
     3CEDA HTTP File Server WSGI Application 
     4""" 
     5__author__ = "P J Kershaw" 
     6__date__ = "11/06/10" 
     7__copyright__ = "(C) 2010 Science and Technology Facilities Council" 
     8__license__ = """http://www.apache.org/licenses/LICENSE-2.0""" 
     9__contact__ = "Philip.Kershaw@stfc.ac.uk" 
     10__revision__ = '$Id$' 
Note: See TracChangeset for help on using the changeset viewer.