def update_employee(emp_id, key=None, value=None, items=None):
 if (items is None):
  if ((key is None) or (value is None)):
   return {'Error': 'At least one key/value pair is required'}
  items = {key: value}
 elif isinstance(items, six.string_types):
  items = yaml.safe_load(items)
 xml_items = ''
 for pair in items.keys():
  xml_items += '<field id="{0}">{1}</field>'.format(pair, items[pair])
 xml_items = '<employee>{0}</employee>'.format(xml_items)
 (status, result) = _query(action='employees', command=emp_id, data=xml_items, method='POST')
 return show_employee(emp_id, ','.join(items.keys()))

def update_employee ( emp_id , key = None , value = None , items = None ) : if ( items is None ) : if ( ( key is None ) or ( value is None ) ) : return { 'Error' : 'At least one key/value pair is required' } items = { key : value } elif isinstance ( items , six . string_types ) : items = yaml . safe_load ( items ) xml_items = '' for pair in items . keys ( ) : xml_items += '<field id="{0}">{1}</field>' . format ( pair , items [ pair ] ) xml_items = '<employee>{0}</employee>' . format ( xml_items ) ( status , result ) = _query ( action = 'employees' , command = emp_id , data = xml_items , method = 'POST' ) return show_employee ( emp_id , ',' . join ( items . keys ( ) ) )
update one or more items for this employee .