Show
Ignore:
Timestamp:
02/13/08 20:33:03 (4 years ago)
Author:
trivoallan
Message:

cleverbox :

  • documentation cleanup
  • started implementation of parameter checking method
Location:
cleverbox/trunk/cleverbox/model
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • cleverbox/trunk/cleverbox/model/__init__.py

    r211 r222  
    11# -*- coding: utf-8 -*- 
    22version = '0.5dev' 
     3 
     4def check_required_parameters(names, parameters): 
     5     
     6    for required_param in names: 
     7        # This will raise a KeyError if a parameter is missing 
     8        # TODO : it could be better to raise a more specific exception 
     9        parameters[required_param] 
  • cleverbox/trunk/cleverbox/model/client.py

    r211 r222  
    137137    Deletes client from supplied environment. 
    138138     
    139     TODO : tunr that into an "archive" command to avoid complete loss of data 
     139    TODO : turn that into an "archive" command to avoid complete loss of data 
    140140    """ 
    141141     
  • cleverbox/trunk/cleverbox/model/project.py

    r213 r222  
    55import logging, os, re, ConfigParser, traceback 
    66from cleverbox.utils import filesystem, styles 
     7from cleverbox import model 
    78 
    89def exists(environment, client_name, project_name, project_status = None): 
     
    8788    """ 
    8889     
    89     # Parameters required for project creation 
    90     required = ('client', 'short_name', 'full_name', 'profile', 'enable') 
    91  
    9290    # Merging for consistency 
    9391    parameters['client'] = client_name 
    9492    parameters['short_name'] = project_name 
    9593 
    96     # Sanity checks before project creation 
    97     for required_param in required: 
    98         # This will raise a KeyError if a parameter is missing 
    99         # TODO : it could be better to raise a more specific exception 
    100         parameters[required_param] 
    101      
     94    # Check that all required parameters are here 
     95    required = ('client', 'short_name', 'full_name', 'profile', 'enable') 
     96    model.check_required_parameters(required, parameters) 
     97 
    10298    # Make sure client exists 
    10399    from cleverbox.model import client