Ejemplo n.º 1
0
def messageProcessed(message, check):
	logging.debug("processing message")
	# This is in a function as it would have to repeat this process twice
	# depending on whether user wants to paste from clipboard or not

	# If the user entered message is already english
	# ask them if they want to continue
	if check == "STRING":
		# gets users message as a string, turns it into uppercase, removes
		# all puncuation, spaces and new lines so it's easier to work wit
		# gets user input
		message = Strip.strip(message).upper()
		# strips the message of spaces and any puncuations
		# also makes the entire string uppercase, as some ciphers don't work
		# with lower case messages
		message.replace('\n', '')
		# this is supposed to replace new lines with nothing, so everything is on one line
		# TODO may not actually work
		logging.debug("Message processed is ")
		logging.debug(message)

	elif check == "MORSE":
		message.replace('\n', '')
		# this is supposed to replace new lines with nothing, so everything is on one line
		# TODO may not actually work
		logging.debug("Message processed is ")
		logging.debug(message)
		return message

	if detectEnglish.isEnglish(message) == True:
		print("\nThis message contains English. Do you want to continue?")
		print("Your message is {}".format(message))
		YesorNo = input("Type Yes or No:  ")
		if YesorNo.upper().startswith("N"):
			close()

		# returns the processed message
	return message