Changeset 3701 for TI05-delivery


Ignore:
Timestamp:
31/03/08 10:43:37 (11 years ago)
Author:
cbyrom
Message:

Add docs for python scripts.

Location:
TI05-delivery/ows_framework/trunk/ows_server/ows_server
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/selectedItems.py

    r3681 r3701  
    2323     
    2424    def index(self): 
     25        """ 
     26        Default controller method to handle the initial requests to the page 
     27        """ 
    2528        # Get the inputs passed via the URL 
    2629        self.inputs=dict(parse_querystring(request.environ)) 
     
    8689        return render('selectedItems') 
    8790     
    88     # check through the inputs to determine which checkboxes 
    89     # have been selected in the 'selections' tab; use these 
    90     # to build a new session list to use with the various visualisation methods 
    9191    def getSelectedItems(self): 
     92        """ 
     93        Check through the inputs to determine which checkboxes 
     94        have been selected in the 'selections' tab; use these 
     95        to build a new session list to use with the various visualisation methods 
     96        """ 
     97 
    9298        # clear out existing data 
    9399        if 'selectedItems' in session: 
     
    124130         
    125131     
    126     # add a selected item to the session 
    127     # - if this is the first item, then display the selections tab 
    128132    def addSelectedItem(self,entryid,kmlurl,wmcurl,title,divid): 
     133        """ 
     134        Add a selected item to the session 
     135        - if this is the first item, then display the selections tab 
     136        @param entryid: Entry ID of related DIF record 
     137        @param kmlurl: Endpoint of KML doc relating to selected item, if it exists 
     138        @param wmcurl: WMC Endpoint of selected item, if it exists 
     139        @param title: Title of selected item 
     140        @param divid: The div ID relating to the selected item in the results tab      
     141        """ 
    129142         
    130143        item = selectedItem.SelectedItem(entryid, title, kmlurl, wmcurl) 
     
    162175 
    163176     
    164     # remove selected item from session data 
    165177    def removeSelectedItem(self,entryid): 
     178        """ 
     179        Remove selected item from session data 
     180        @param entryid: Entry ID of record to remove from selected items list  
     181        """ 
    166182        self.deleteSelectedItem(entryid) 
    167183        # rerender selections to update with item removed 
     
    169185 
    170186     
    171     # Remove selected item from session data 
    172     # - NB, do this by rebuilding the session data 
    173     # without the input data included 
    174187    def deleteSelectedItem(self,entryid): 
     188        """ 
     189        Remove selected item from session data 
     190        - NB, do this by rebuilding the session data 
     191        without the input data included 
     192        @param entryid: Entry ID of record to remove from selected items list  
     193        """ 
    175194        selections = [] 
    176195        deletedItem = None 
     
    192211         
    193212 
    194     # remove selected item from session data and adjust the 'select' link 
    195     # to be 'unselect' 
    196213    def unSelectItem(self,entryid,divid): 
     214        """ 
     215        Remove selected item from session data and adjust the 'Unselect' link 
     216        to display 'Select' 
     217        @param entryid: Entry ID of record to remove from selected items list  
     218        @param divid: The div ID relating to the selected item in the results tab      
     219        """ 
    197220        deletedItem = self.deleteSelectedItem(entryid) 
    198221         
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/viewItems.py

    r3660 r3701  
    2020     
    2121    def index(self): 
     22        """ 
     23        Default controller method to handle the initial requests to the page 
     24        """ 
    2225        self.inputs=dict(parse_querystring(request.environ)) 
    2326        c.wmcURL = "" 
     
    5659 
    5760 
    58     # add a selected item to the session 
    59     # - if this is the first item, then display the selections tab 
    6061    def addViewItem(self,endpoint): 
     62        """ 
     63        Add a selected item to the session 
     64         - if this is the first item, then display the selections tab 
     65         @param endpoint: WMC endpoint  
     66        """ 
    6167         
    6268        item = selectedItem.SelectedItem(None, None, None, endpoint) 
     
    7379         
    7480     
    75     # Remove view item from session data 
    76     # - NB, do this by rebuilding the session data 
    77     # without the input data included 
    7881    def removeViewItem(self,endpoint): 
     82        """ 
     83        Remove view item from session data  
     84        - NB, do this by rebuilding the session data without the input data included 
     85        @param endpoint: The WMC endpoint of the view item to remove  
     86        """ 
    7987        selections = [] 
    8088        for selection in session['viewItems']: 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/models/selectedItem.py

    r3660 r3701  
    1616    ''' A simple object representing key info on selected items ''' 
    1717    def __init__(self,entryID,title,kmlURL,wmcURL): 
     18        """ 
     19        Constructor to initialise the selected item object 
     20        @param entryID: Entry ID of related DIF record 
     21        @param title: Title of selected item 
     22        @param kmlURL: Endpoint of KML doc relating to selected item, if it exists 
     23        @param wmcURL: WMC Endpoint of selected item, if it exists     
     24        """ 
    1825        self.entryID = entryID 
    1926        self.title = title 
Note: See TracChangeset for help on using the changeset viewer.