def _build_list(option_value, item_kind):
 if (option_value is not None):
  items = []
  if (option_value == 'none'):
   return items
  if (not isinstance(option_value, list)):
   values = option_value.split(',')
  else:
   values = option_value
  for value in values:
   if (item_kind is None):
    items.append(value)
   else:
    items.append({'kind': item_kind, 'name': value})
  return items
 return None

def _build_list ( option_value , item_kind ) : if ( option_value is not None ) : items = [ ] if ( option_value == 'none' ) : return items if ( not isinstance ( option_value , list ) ) : values = option_value . split ( ',' ) else : values = option_value for value in values : if ( item_kind is None ) : items . append ( value ) else : items . append ( { 'kind' : item_kind , 'name' : value } ) return items return None
pass in an option to check for a list of items .