pymensago/iscmds.py
def iscurrent(conn: ServerConnection, index: int, wid: utils.UUID) -> RetVal:
	'''Finds out if an entry index is current. If wid is empty, the index is checked for the 
	organization.'''
	if not wid.is_empty() and not wid.is_valid():
		return RetVal(MsgBadRequest).set_value('status', 400)
	
	request = {
		'Action' : 'ISCURRENT',
		'Data' : {
			'Index' : str(index)
		}
	}
	if not wid.is_empty():
		request['Data']['Workspace-ID'] = wid.as_string()
	status = conn.send_message(request)
	if status.error():
		return status

	response = conn.read_response(server_response)
	if response.error():
		return response
	
	if response['Code'] != 200:
		return wrap_server_error(response)
	
	if 'Is-Current' not in response['Data']:
		return RetVal(ErrServerError, 'server did not return an answer')
	
	return RetVal().set_value('iscurrent', bool(response['Data']['Is-Current'] == 'YES'))
Finds out if an entry index is current. If wid is empty, the index is checked for the 
	organization.
Finds out if an entry index is current. If wid is empty, the index is checked for the
organization.
Finds out if an entry index is current . If wid is empty the index is checked for the organization .
def iscurrent(conn: ServerConnection, index: int, wid: utils.UUID) -> RetVal:
	if not wid.is_empty() and not wid.is_valid():
		return RetVal(MsgBadRequest).set_value('status', 400)
	request = {
		'Action' : 'ISCURRENT',
		'Data' : {
			'Index' : str(index)
		}
	}
	if not wid.is_empty():
		request['Data']['Workspace-ID'] = wid.as_string()
	status = conn.send_message(request)
	if status.error():
		return status
	response = conn.read_response(server_response)
	if response.error():
		return response
	if response['Code'] != 200:
		return wrap_server_error(response)
	if 'Is-Current' not in response['Data']:
		return RetVal(ErrServerError, 'server did not return an answer')
	return RetVal().set_value('iscurrent', bool(response['Data']['Is-Current'] == 'YES'))
def iscurrent ( conn : ServerConnection , index : int , wid : utils . UUID ) -> RetVal : if not wid . is_empty ( ) and not wid . is_valid ( ) : return RetVal ( MsgBadRequest ) . set_value ( 'status' , 400 ) request = { 'Action' : 'ISCURRENT' , 'Data' : { 'Index' : str ( index ) } } if not wid . is_empty ( ) : request [ 'Data' ] [ 'Workspace-ID' ] = wid . as_string ( ) status = conn . send_message ( request ) if status . error ( ) : return status response = conn . read_response ( server_response ) if response . error ( ) : return response if response [ 'Code' ] != 200 : return wrap_server_error ( response ) if 'Is-Current' not in response [ 'Data' ] : return RetVal ( ErrServerError , 'server did not return an answer' ) return RetVal ( ) . set_value ( 'iscurrent' , bool ( response [ 'Data' ] [ 'Is-Current' ] == 'YES' ) )
Finds out if an entry index is current.
Finds out if an entry index is current .
'''Finds out if an entry index is current. If wid is empty, the index is checked for the 
	organization.'''
conn
ServerConnection
index
int
wid
utils.UUID