Changeset 6947 for cows_wps


Ignore:
Timestamp:
08/06/10 12:43:45 (9 years ago)
Author:
astephen
Message:

lots of minor fixes. including removing username from process configs.

Location:
cows_wps/trunk
Files:
1 added
11 edited

Legend:

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

    r6923 r6947  
    174174 
    175175        spant = '%s<span style="color: #%s;">%s</span><br>' 
     176        span2 = '%s<span style="color: #%s;">&lt;%s&gt;</span><span style="color: #%s;">%s</span><span style="color: #%s;">&lt;/%s&gt;</span><br>' 
     177 
    176178        x = "" 
    177179        pad = 0 
     
    193195                line = spant % (pc * pad, "0000ff", line2) 
    194196                pad += 1 
     197            elif open_and_close_m: 
     198                groups = open_and_close_m.groups() 
     199                (tag, content) = groups[:2] 
     200                line = span2 % (pc * pad, "%s" % col, tag, "000000", content, "%s" * col, tag) 
     201#                line = spant % (pc * pad, "%s" % col, line2) 
    195202            elif bad_m: 
    196203                (first, second) = bad_m.groups()[:2] 
     
    206213                pad -= 1 
    207214                line = spant % (pc * pad, "%s" % col, line2) 
    208             elif open_and_close_m: 
    209                 line = spant % (pc * pad, "%s" % col, line2) 
    210215            elif empty_m: 
    211216                line = spant % (pc * pad, "%s" % col, line2) 
  • cows_wps/trunk/cows_wps/controllers/login.py

    r5955 r6947  
    1414 
    1515    def index(self): 
     16        redirect_to("/home.html") 
     17 
     18    def indexOLD(self): 
    1619        """ 
    1720        Show login page. 
  • cows_wps/trunk/cows_wps/controllers/submitter.py

    r6923 r6947  
    7575        base_url = "http://" + request.url[7:].split("/")[0] 
    7676        full_url = base_url + wps_request_url 
    77  
    78         getter = urllib.urlopen(full_url) 
     77       # return full_url 
     78        """getter = urllib.urlopen(full_url) 
    7979        xml = getter.read() 
    8080        getter.close() 
     81        """ 
     82 
     83        clean_request_url = urllib.unquote(wps_request_url) 
     84        xml = request.environ['paste.recursive.include'](clean_request_url) 
     85        return str(xml) 
     86 
    8187 
    8288        m = re.search('statusLocation="(.+?)"', xml) 
     89 #       if m: return "Matched:  " + str(m.groups()) 
     90 #       return "BAD" 
    8391        status_url = m.groups()[0] 
    8492 
  • cows_wps/trunk/cows_wps/controllers/test.py

    r6898 r6947  
    11import logging 
     2 
     3from pylons import config 
    24 
    35from pylons import request, response, session, tmpl_context as c 
     
    911 
    1012from cows_wps.utils.user_roles_dict import user_roles_config_dict 
     13from cows_wps.lib.user_manager import * 
     14 
    1115 
    1216log = logging.getLogger(__name__) 
     
    2731        return resp 
    2832 
     33    def forward2(self): 
     34#        from paste.recursive import ForwardRequestException 
     35#        raise ForwardRequestException('/home.html') 
     36        result = request.environ['paste.recursive.include']('/test') 
     37        return str(result) 
     38 
    2939    def sess(self): 
    3040        resp = str(session) 
     
    3545 
    3646    def userid(self): 
    37         return str(request.environ) 
     47        um = UserManager() 
     48        return um.getUserName() 
     49 
     50    def email(self): 
     51        um = UserManager() 
     52        return um.getEmailAddress() 
    3853 
    3954    def abort(self): 
     
    5065    def secured(self): 
    5166        return "Did you get asked for security info?" 
     67 
     68    def email2(self): 
     69        securitySession = request.environ.get('beaker.session.ndg.security') 
     70        openIdAxParams = securitySession["openid.ax"]  
     71        resp = openIdAxParams["emailAddress"] 
     72        return resp 
  • cows_wps/trunk/cows_wps/controllers/wps.py

    r6873 r6947  
    1010from datetime import datetime 
    1111import random 
     12 
    1213from pylons import response 
     14from routes import url_for 
    1315 
    1416#import from cows 
     
    2224from cows_wps.controllers import * 
    2325from cows_wps.utils.create_process_config import createProcessConfig 
    24 from routes import url_for 
     26from cows_wps.lib.user_manager import UserManager 
    2527from cows_wps.process_handler import validate_arguments 
    2628from cows_wps.process_handler.context.process_context import ProcessContext 
     
    208210        requestId = common_utils.getUniqueId() 
    209211             
    210         # Username is a DCIP-specific parameter 
    211         if arg_dict.has_key('Username'): 
    212             username = arg_dict['Username'] 
    213         else: 
    214             log.warn('No Username given, BUT DO WE NEED IT?') 
     212#        # Username is a DCIP-specific parameter 
     213#        if arg_dict.has_key('Username'): 
     214#            username = arg_dict['Username'] 
     215#        else: 
     216#            log.warn('No Username given, BUT DO WE NEED IT?') 
    215217         
    216218        
    217         #!TODO: Reimplement user management 
    218         (loggedIn, email) = (True, "nobody@nowhere.com") 
    219          
    220         if loggedIn == False: 
    221             raise OwsError("User %s is not logged into the system." % (username)) 
     219#        (loggedIn, email) = (True, "nobody@nowhere.com") 
     220#        if loggedIn == False: 
     221#            raise OwsError("User %s is not logged into the system." % (username)) 
     222 
     223        # Get username and e-mail address 
     224        try: 
     225            um = UserManager() 
     226        except: 
     227            raise OwsError("Cannot find security information to access user details.") 
     228 
     229        email = um.getEmailAddress() 
     230        username = um.getUserName() 
    222231 
    223232        log.debug("identifier=%s, username=%s, requestId=%s costonly=%s lineage=%s inform=%s" % \ 
  • cows_wps/trunk/cows_wps/wsgiapp.py

    r6877 r6947  
    99from paste.urlparser import StaticURLParser 
    1010from paste.deploy.converters import asbool 
     11 
     12# Allows internal redirect 
     13from paste.recursive import RecursiveMiddleware 
     14 
    1115from pylons import config 
    1216from pylons.error import error_template 
     
    7478    # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares) 
    7579    app = RoutesMiddleware(app, config['routes.map']) 
     80    # To allow internal redirect 
     81    app = RecursiveMiddleware(app) 
    7682    app = SessionMiddleware(app, config) 
    7783    app = CacheMiddleware(app, config) 
  • cows_wps/trunk/process_configs/ConfigTemplate.ini

    r6106 r6947  
    2020 
    2121[DataInputs] 
    22 Username = string 
    2322MyInput = string 
    2423 
  • cows_wps/trunk/process_configs/DoubleIt.ini

    r5943 r6947  
    2020 
    2121[DataInputs] 
    22 Username = string 
    2322NumberToDouble = float 
    2423 
  • cows_wps/trunk/process_configs/ExtractUKStationData.ini

    r6903 r6947  
    2020 
    2121[DataInputs] 
    22 Username = string 
    23 Username.default = test_user 
    2422StartDateTime = datetime 
    2523StartDateTime.default = 2009-01-01T00:00:00 
  • cows_wps/trunk/process_configs/GetWeatherStations.ini

    r6877 r6947  
    2020 
    2121[DataInputs] 
    22 Username = string 
    23 Username.default = test_user 
    2422StartDateTime = datetime 
    2523StartDateTime.default = 2009-01-01T00:00:00 
  • cows_wps/trunk/process_configs/NCDumpIt.ini

    r6859 r6947  
    2020 
    2121[DataInputs] 
    22 Username = string 
    2322FilePath = filepath 
    2423FilePath.basedir = /usr/local/cwps/buildout 
Note: See TracChangeset for help on using the changeset viewer.