def bind_parameters(obj, substitutions, fields=None):
 if (fields is None):
  fields = [k for k in obj.__dict__.keys() if (not k.startswith('_'))]
 for field in fields:
  data = getattr(obj, field)
  if isinstance(data, basestring):
   new_data = Template(data).safe_substitute(substitutions)
   if (new_data != data):
    LOG.debug(('Parameterized %s -> %s' % (repr(data), repr(new_data))))
    setattr(obj, field, new_data)

def bind_parameters ( obj , substitutions , fields = None ) : if ( fields is None ) : fields = [ k for k in obj . __dict__ . keys ( ) if ( not k . startswith ( '_' ) ) ] for field in fields : data = getattr ( obj , field ) if isinstance ( data , basestring ) : new_data = Template ( data ) . safe_substitute ( substitutions ) if ( new_data != data ) : LOG . debug ( ( 'Parameterized %s -> %s' % ( repr ( data ) , repr ( new_data ) ) ) ) setattr ( obj , field , new_data )
bind the parameters to the given fields .