pymensago/serverconn.py
def copy(conn: ServerConnection, srcfile: str, destdir: str) -> RetVal:
	'''Copies a file to the requested directory and returns the name of the new file'''
	if not srcfile or not destdir:
		return RetVal(MsgBadRequest).set_value('Status', 400)
	
	request = {
		'Action' : 'COPY',
		'Data' : {
			'SourceFile' : srcfile,
			'DestDir' : destdir
		}
	}
	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)
	
	return RetVal().set_value('name', response['Data']['NewName'])
Copies a file to the requested directory and returns the name of the new file
Copies a file to the requested directory and returns the name of the new file
Copies a file to the requested directory and returns the name of the new file
def copy(conn: ServerConnection, srcfile: str, destdir: str) -> RetVal:
	if not srcfile or not destdir:
		return RetVal(MsgBadRequest).set_value('Status', 400)
	request = {
		'Action' : 'COPY',
		'Data' : {
			'SourceFile' : srcfile,
			'DestDir' : destdir
		}
	}
	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)
	return RetVal().set_value('name', response['Data']['NewName'])
def copy ( conn : ServerConnection , srcfile : str , destdir : str ) -> RetVal : if not srcfile or not destdir : return RetVal ( MsgBadRequest ) . set_value ( 'Status' , 400 ) request = { 'Action' : 'COPY' , 'Data' : { 'SourceFile' : srcfile , 'DestDir' : destdir } } 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 ) return RetVal ( ) . set_value ( 'name' , response [ 'Data' ] [ 'NewName' ] )
Copies a file to the requested directory and returns the name of the new file
Copies a file to the requested directory and returns the name of the new file
'''Copies a file to the requested directory and returns the name of the new file'''
conn
ServerConnection
srcfile
str
destdir
str