pymensago/iscmds.py
def unregister(conn: ServerConnection, pwhash: str, wid: utils.UUID) -> RetVal:
	'''Deletes the online account at the specified server.'''

	if not wid.is_empty() and not wid.is_valid():
		return RetVal(ErrBadValue, 'bad workspace id')
	
	request = {
		'Action' : 'UNREGISTER',
		'Data' : {
			'Password-Hash' : pwhash
		}
	}
	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['Code'] == 202:
		return RetVal()

	# This particular command is very simple: make a request, because the server will return
	# one of three possible types of responses: success, pending (for private/moderated 
	# registration modes), or an error. In all of those cases there isn't anything else to do.
	return wrap_server_error(response)
Deletes the online account at the specified server.
Deletes the online account at the specified server.
Deletes the online account at the specified server .
def unregister(conn: ServerConnection, pwhash: str, wid: utils.UUID) -> RetVal:
	if not wid.is_empty() and not wid.is_valid():
		return RetVal(ErrBadValue, 'bad workspace id')
	request = {
		'Action' : 'UNREGISTER',
		'Data' : {
			'Password-Hash' : pwhash
		}
	}
	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['Code'] == 202:
		return RetVal()
	return wrap_server_error(response)
def unregister ( conn : ServerConnection , pwhash : str , wid : utils . UUID ) -> RetVal : if not wid . is_empty ( ) and not wid . is_valid ( ) : return RetVal ( ErrBadValue , 'bad workspace id' ) request = { 'Action' : 'UNREGISTER' , 'Data' : { 'Password-Hash' : pwhash } } 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 [ 'Code' ] == 202 : return RetVal ( ) return wrap_server_error ( response )
Deletes the online account at the specified server.
Deletes the online account at the specified server .
'''Deletes the online account at the specified server.''' # This particular command is very simple: make a request, because the server will return # one of three possible types of responses: success, pending (for private/moderated  # registration modes), or an error. In all of those cases there isn't anything else to do.
conn
ServerConnection
pwhash
str
wid
utils.UUID