(dstype, objectname, attribute, value)
DirectoryServices attribute append.

  This uses dscl append, which appends one or more values to a property in a
  given record. The property is created if it does not exist.

  Args:
    dstype: The type of objects to query. user, group.
    objectname: the object to append under.
    attribute: the attribute to append a value to.
    value: the value to append, only handles strings and simple lists
  Raises:
    DSException: Cannot modify DirectoryServices.
DirectoryServices attribute append.
DirectoryServices attribute append .
def DSAppend(dstype, objectname, attribute, value):
  """DirectoryServices attribute append.

  This uses dscl append, which appends one or more values to a property in a
  given record. The property is created if it does not exist.

  Args:
    dstype: The type of objects to query. user, group.
    objectname: the object to append under.
    attribute: the attribute to append a value to.
    value: the value to append, only handles strings and simple lists
  Raises:
    DSException: Cannot modify DirectoryServices.
  """
  ds_path = '/%ss/%s' % (dstype.capitalize(), objectname)
  cmd = [_DSCL, '.', '-append', ds_path, attribute]
  if type(value) == type(list()):
    cmd.extend(value)
  else:
    cmd.append(value)
  (unused_stdout, stderr, returncode) = gmacpyutil.RunProcess(cmd)
  if returncode:
    raise DSException('Cannot append %s for %s: %s' % (attribute,
                                                       ds_path,
                                                       stderr))
def DSAppend ( dstype , objectname , attribute , value ) : ds_path = '/%ss/%s' % ( dstype . capitalize ( ) , objectname ) cmd = [ _DSCL , '.' , '-append' , ds_path , attribute ] if type ( value ) == type ( list ( ) ) : cmd . extend ( value ) else : cmd . append ( value ) ( unused_stdout , stderr , returncode ) = gmacpyutil . RunProcess ( cmd ) if returncode : raise DSException ( 'Cannot append %s for %s: %s' % ( attribute , ds_path , stderr ) )