From c490ce0888d406fa3e4e2bd8b89da35817a15bbd Mon Sep 17 00:00:00 2001 From: clamsawd Date: Tue, 1 Dec 2015 19:06:02 +0100 Subject: [PATCH] Small changes in the command-line interface --- ip2e-config.py | 46 +++++++++++++++++++++++----------------------- ip2e-daemon.py | 17 ++++++++++------- ip2e-log.py | 4 ++-- 3 files changed, 35 insertions(+), 32 deletions(-) diff --git a/ip2e-config.py b/ip2e-config.py index ee5e397..3a32f8a 100755 --- a/ip2e-config.py +++ b/ip2e-config.py @@ -5,7 +5,7 @@ # ip2e (IP to email) - Create the configuration file. | # Created by clamsawd (clamsawd@openmailbox.org) | # Licensed by GPL v.3 | -# Last update: 22-11-2015 | +# Last update: 01-12-2015 | # | # Compatible with Python 3.x | # -------------------------------------------------------------- @@ -50,15 +50,15 @@ if os.path.exists(".ip2e"): if os.path.isfile("ip2e.conf"): ClearScreen() print ("") - print ("ip2e-config v"+version) + print ("** ip2e-config v"+version+" **") print ("") - print ("Detected a previous configuration file") - print ("Do you want to overwrite or check the current configuration?") + print (" - Detected a previous configuration file.") + print (" - Do you want to overwrite or check the current configuration?") print ("") - print ("(o) - overwrite (create new configuration)") - print ("(c) - check and test the current configuration") + print (" * (o) - overwrite (create new configuration)") + print (" * (c) - check and test the current configuration") print ("") - OverWriteOrCheck=input("[Default: check and test] Choose an option; ") + OverWriteOrCheck=input("- [Default: check and test] Choose an option; ") if OverWriteOrCheck == "o" or OverWriteOrCheck == "O": print ("Create new configuration") else: @@ -73,26 +73,26 @@ if os.path.isfile("ip2e.conf"): server.login(FromEmailUser,FromEmailPass) server.quit() print ("") - print ("Test OK") + print ("* Test OK") print ("") - PauseExit=input("Press ENTER to exit ") + PauseExit=input("+ Press ENTER to exit ") except: print ("") - print ("Failed to connect ("+SmtpFromEmail+")") + print ("* Failed to connect ("+SmtpFromEmail+")") print ("") - PauseExit=input("Press ENTER to exit ") + PauseExit=input("+ Press ENTER to exit ") exit() #Set variables of 'ip2e.conf' ClearScreen() print ("") -print ("ip2e-config v"+version+" - Create config.file") +print ("** ip2e-config v"+version+" - Create config.file **") print ("") -FromEmail=input("Type the email sender: ") -FromEmailUser=input("Type the user of email sender: ") -FromEmailPass=input("Type the pass of email sender: ") -SmtpFromEmail=input("Type the server STMP of email sender: ") -ToEmail=input("Type the email receiver: ") +FromEmail=input("- Type the email sender: ") +FromEmailUser=input("- Type the user of email sender: ") +FromEmailPass=input("- Type the pass of email sender: ") +SmtpFromEmail=input("- Type the server STMP of email sender: ") +ToEmail=input("- Type the email receiver: ") #Create 'ip2e.conf' if os.path.isfile("ip2e.conf"): @@ -112,7 +112,7 @@ ip2ecf.close() #Show the configuration ClearScreen() print ("") -print ("ip2e-config v"+version+" - Current config.file") +print ("** ip2e-config v"+version+" - Current config.file **") print ("") readfile=open('ip2e.conf', 'r') print(readfile.read()) @@ -120,7 +120,7 @@ readfile.close() #Test connection with your configuration print ("") -TestConnection=input("[Default: y] Test connection with your configuration (y/n): ") +TestConnection=input("- [Default: y] Test connection with your configuration (y/n): ") if TestConnection == "n": print ("Exiting...") exit() @@ -136,11 +136,11 @@ else: server.login(FromEmailUser,FromEmailPass) server.quit() print ("") - print ("Test OK") + print ("* Test OK") print ("") - PauseExit=input("Press ENTER to exit ") + PauseExit=input("+ Press ENTER to exit ") except: print ("") - print ("Failed to connect ("+SmtpFromEmail+")") + print ("* Failed to connect ("+SmtpFromEmail+")") print ("") - PauseExit=input("Press ENTER to exit ") + PauseExit=input("+ Press ENTER to exit ") diff --git a/ip2e-daemon.py b/ip2e-daemon.py index 4aff4b7..5e54381 100755 --- a/ip2e-daemon.py +++ b/ip2e-daemon.py @@ -5,7 +5,7 @@ # ip2e (IP to email) - Run ip2e daemon. | # Created by clamsawd (clamsawd@openmailbox.org) | # Licensed by GPL v.3 | -# Last update: 22-11-2015 | +# Last update: 01-12-2015 | # | # Compatible with Python 3.x | # -------------------------------------------------------------- @@ -62,11 +62,11 @@ if os.path.isfile("ip2e.conf"): else: ClearScreen() print ("") - print ("The configuration file doesn't exist") + print ("* The configuration file doesn't exist") print ("") - print ("You can create it if you run 'ip2e-config.py'") + print ("* You can create it if you run 'ip2e-config.py'") print ("") - PauseExit=input("Press ENTER to exit ") + PauseExit=input("+ Press ENTER to exit ") exit() #Check if exists 'IP.log' @@ -104,7 +104,10 @@ try: elif os.name == "nt": os.system("color 6") except: - print ("Error importing native color scheme") + print ("") + print ("* Error importing native color scheme") + print ("") + PauseExit=input("+ Press ENTER to exit ") exit() #Check if ip2e-daemon is running. @@ -121,9 +124,9 @@ if os.path.isfile("ip2e.lock"): if LockN != LockN2: ClearScreen() print ("") - print ("ip2e-daemon is already running.") + print ("* ip2e-daemon is already running.") print ("") - PauseExit=input("Press ENTER to exit ") + PauseExit=input("+ Press ENTER to exit ") exit() if not os.path.isfile("ip2e.lock"): createLock=open('ip2e.lock','w') diff --git a/ip2e-log.py b/ip2e-log.py index f42b8ce..d4d4f8f 100755 --- a/ip2e-log.py +++ b/ip2e-log.py @@ -5,7 +5,7 @@ # ip2e (IP to email) - See the log file. | # Created by clamsawd (clamsawd@openmailbox.org) | # Licensed by GPL v.3 | -# Last update: 22-11-2015 | +# Last update: 01-12-2015 | # | # Compatible with Python 3.x | # -------------------------------------------------------------- @@ -57,5 +57,5 @@ if os.path.isfile("ip2e.log"): else: ClearScreen() print ("") - print ("ip2e.log doesn't exist.") + print ("* ip2e.log doesn't exist.") print ("")