Ignore:
Timestamp:
14/06/10 10:57:37 (10 years ago)
Author:
astephen
Message:

fixing type ahead dirlist controller

File:
1 edited

Legend:

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

    r7004 r7008  
    2222        path = request.params.get("path", None) 
    2323        if path == None: 
    24             return "Please provide an argument path=<Something>" 
     24            return "ERROR: Please provide an argument path=<Something>" 
    2525 
    2626        proc_id = request.params.get("proc_id", None) 
    2727        if proc_id == None: 
    28             return "Please provide a valid proc_id." 
     28            return "ERROR: Please provide a valid proc_id." 
    2929 
    3030        try: 
     
    3636 
    3737        dr = os.path.split(path)[0] 
    38         if not os.path.isdir(dr): 
    39             return "Please provide a valid directory." 
     38        top_dir = os.path.split(dr)[-1] 
     39 
     40        if not os.path.isdir(dr) or top_dir[0] == ".": 
     41            return "ERROR: Please provide a valid directory." 
    4042        elif dr.find(basedir) < 0 and dr != basedir: 
    41             return "Invalid directory or not allowed." 
     43            return "ERROR: Invalid directory or not allowed." 
    4244 
    4345        items = [os.path.join(dr, x) for x in os.listdir(dr) if x[0] != "."] 
Note: See TracChangeset for help on using the changeset viewer.