def parse_xreply(xreply):
 try:
  xreply = json.loads(xreply)
 except ValueError as err:
  log.error(err)
  return (1, 'unexpected reply from server')
 return_code = xreply['return_code']
 content = xreply['content']
 return (return_code, content)

def parse_xreply ( xreply ) : try : xreply = json . loads ( xreply ) except ValueError as err : log . error ( err ) return ( 1 , 'unexpected reply from server' ) return_code = xreply [ 'return_code' ] content = xreply [ 'content' ] return ( return_code , content )
parse the reply from xqueue .