pymensago/serverconn.py
def send_message(self, command : dict) -> RetVal:
		'''Sends a message to the server with command sent as JSON data'''
		cmdstr = json.dumps(command) + '\r\n'
		
		if not self.socket:
			return RetVal(ErrNetworkError, 'not connected')
		
		try:
			self.socket.send(cmdstr.encode())
		except Exception as e:
			self.socket.close()
			return RetVal().wrap_exception(e)
		
		return RetVal()
Sends a message to the server with command sent as JSON data
Sends a message to the server with command sent as JSON data
Sends a message to the server with command sent as JSON data
def send_message(self, command : dict) -> RetVal:
		cmdstr = json.dumps(command) + '\r\n'
		if not self.socket:
			return RetVal(ErrNetworkError, 'not connected')
		try:
			self.socket.send(cmdstr.encode())
		except Exception as e:
			self.socket.close()
			return RetVal().wrap_exception(e)
		return RetVal()
def send_message ( self , command : dict ) -> RetVal : cmdstr = json . dumps ( command ) + '\r\n' if not self . socket : return RetVal ( ErrNetworkError , 'not connected' ) try : self . socket . send ( cmdstr . encode ( ) ) except Exception as e : self . socket . close ( ) return RetVal ( ) . wrap_exception ( e ) return RetVal ( )
Sends a message to the server with command sent as JSON data
Sends a message to the server with command sent as JSON data
'''Sends a message to the server with command sent as JSON data'''
self
command
dict