Changeset 6910


Ignore:
Timestamp:
29/05/10 23:30:17 (9 years ago)
Author:
astephen
Message:

fixes

Location:
cows_wps/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cows_wps/trunk/cows_wps/controllers/jobviewer.py

    r6909 r6910  
    4747                <a href="javascript:switchViewTo('table_view');">Normal View</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;""" 
    4848 
     49        poll_info_div = "" 
    4950        if self.status == "complete": 
    5051            resp += """<a href="javascript:switchViewTo('xml_view');">View as XML</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    5152                <a href="javascript:switchViewTo('plots_view');">View Plots (if available)</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;""" 
     53        elif self.status == "running": 
     54            poll_info_div = '<div id="poll_info" class="poller"></div>' 
    5255 
    5356        resp  += """ 
     
    5558<div id="view_container" style="background: white; border: 2px outset blue; padding: 5px;"> 
    5659        <div id="view_contents"> 
    57                 <div id="table_view" style="visibility: visible; height: auto;"><div id="poll_info" class="poller"></div>%s</div>""" % (job_as_table) 
     60                <div id="table_view" style="visibility: visible; height: auto;">%s%s</div>""" % (poll_info_div, job_as_table) 
    5861 
    5962        if self.status == "complete": 
     
    7073            resp += """<input type="hidden" id="poll_url" value="%s" />""" % status_url  
    7174            resp += """<input type="hidden" id="jobviewer_url" value="%s" />""" % jobviewer_url 
    72 #            resp += """<div id="poll_info">Polling here...</div>""" 
    7375            resp += """<script type="text/javascript"> 
    7476        function init() { 
     
    7779 
    7880</script>""" 
    79 # </form>""" % (submitter_url, urllib.unquote(wps_request_url)) 
    8081 
    8182        renderer = UIPageRenderer() 
     
    8889        mdict = {"Succeeded": "complete", 
    8990                 "Failed": "failed", 
    90                  "Accepted": "running"} 
     91                 "Accepted": "running", 
     92                 "Started": "running"} 
    9193 
    9294        for k,v in mdict.items(): 
     
    108110        file_set_list = job_details.find("{" + self.namespace +  "}FileSet").getchildren() 
    109111 
    110         items = ["JobID", "JobCompletionTimeDate", "JobDuration", "JobVolume", "RequestDescription", 
    111                  "RequestType"] 
    112         mapped_names = ["Job ID", "Completion Time", "Job Duration", "Output Size (Bytes)",  
     112        items = ["JobID", "JobCompletionTimeDate", "RequestDescription", 
     113                 "RequestType", "JobDuration", "JobVolume"] 
     114        mapped_names = ["Job ID", "Completion Time",  
    113115                        "Request Description", "Request Type"] 
     116 
     117        if self.status == "complete": 
     118            mapped_names.extend(["Job Duration (seconds)", "Output Size (bytes)"]) 
     119        else: 
     120            mapped_names.extend(["Estimated Job Duration (seconds)", "Estimated Output Size (bytes)"]) 
    114121 
    115122        resp = "<h2>DETAILS</h2>" 
     
    126133        mapped_file_items = ["File Size (Bytes)"] 
    127134 
    128         resp += "<h2>OUTPUTS</h2>The following file outputs are available from your job.<br>" 
    129         for fnode in file_set_list: 
    130  
    131             furl = fnode.find("{" + self.namespace +  "}FileURL").text 
    132             fname = furl.split("/")[-1] 
    133             len_fname = len(fname) 
    134  
    135             p = 70 
    136             padding = p - len_fname 
    137             if padding < 0: padding = 0 
    138  
    139             resp += ('<br><kbd>%s [<a href="%s">Download</a>]</kbd>' + (padding * "&nbsp;")) % (fname, furl) 
    140  
    141             for (i, file_item) in enumerate(file_items): 
    142                 x = fnode.find("{" + self.namespace +  "}" + file_item).text 
    143                 resp += '%s Bytes' % x 
     135        if self.status == "complete": 
     136 
     137            resp += "<h2>OUTPUTS</h2>The following file outputs are available from your job.<br>" 
     138            for fnode in file_set_list: 
     139 
     140                furl = fnode.find("{" + self.namespace +  "}FileURL").text 
     141                fname = furl.split("/")[-1] 
     142                len_fname = len(fname) 
     143 
     144                p = 70 
     145                padding = p - len_fname 
     146                if padding < 0: padding = 0 
     147 
     148                resp += ('<br><kbd>%s [<a href="%s">Download</a>]</kbd>' + (padding * "&nbsp;")) % (fname, furl) 
     149 
     150                for (i, file_item) in enumerate(file_items): 
     151                    x = fnode.find("{" + self.namespace +  "}" + file_item).text 
     152                    resp += '%s Bytes' % x 
    144153 
    145154        return resp 
  • cows_wps/trunk/cows_wps/public/style/wps_ui.css

    r6909 r6910  
    143143        background-color: orange; 
    144144        color: blue; 
     145        padding: 3px; 
    145146} 
  • cows_wps/trunk/process_modules/extract_uk_station_data.py

    r6873 r6910  
    7979            fout.close() 
    8080 
     81        # Now check limit on number of station IDs 
     82        n_src_ids = len(StationsIDs) 
     83        if n_src_ids > 100 and chunk_size == "decadal": 
     84            raise Exception("The number of selected station IDs has been calculated to be greater than 100. Please select a chunk size other than 'decadal' for such as large volume of data.") 
     85 
     86        N_YEARS = ? 
     87        if n_years > 1 and n_src_ids > 100: 
     88            raise Exception("The number of selected station IDs has been calculated to be greater than 100. Please select a time window no longer than 1 year.") 
     89 
    8190        self._addFileToFileSet(sf_path, "Station IDs file used for extraction of station data.", FLAG.DATA) 
    8291 
Note: See TracChangeset for help on using the changeset viewer.