From 5184ed4d59a57d43d02a6f8187a6ff43acf2b438 Mon Sep 17 00:00:00 2001 From: clamsawd Date: Sat, 31 Oct 2015 19:14:48 +0100 Subject: [PATCH] Added support for Cygwin on ClearScreen() --- ip2e-config.py | 6 ++++-- ip2e-daemon.py | 6 ++++-- ip2e-log.py | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ip2e-config.py b/ip2e-config.py index 2a5bf43..e5afa47 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: 30-10-2015 | +# Last update: 31-10-2015 | # | # Compatible with Python 3.x | # -------------------------------------------------------------- @@ -24,7 +24,9 @@ if sys.version_info<(3,0): #Function to clear screen def ClearScreen(): - if os.name == "posix": + if sys.platform == "cygwin": + print (300 * "\n") + elif os.name == "posix": os.system("clear") elif os.name == "nt": os.system("cls") diff --git a/ip2e-daemon.py b/ip2e-daemon.py index 672bf72..c27b9ce 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: 30-10-2015 | +# Last update: 31-10-2015 | # | # Compatible with Python 3.x | # -------------------------------------------------------------- @@ -28,7 +28,9 @@ if sys.version_info<(3,0): #Function to clear screen def ClearScreen(): - if os.name == "posix": + if sys.platform == "cygwin": + print (300 * "\n") + elif os.name == "posix": os.system("clear") elif os.name == "nt": os.system("cls") diff --git a/ip2e-log.py b/ip2e-log.py index 96db619..b4e459a 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: 30-10-2015 | +# Last update: 31-10-2015 | # | # Compatible with Python 3.x | # -------------------------------------------------------------- @@ -24,7 +24,9 @@ if sys.version_info<(3,0): #Function to clear screen def ClearScreen(): - if os.name == "posix": + if sys.platform == "cygwin": + print (300 * "\n") + elif os.name == "posix": os.system("clear") elif os.name == "nt": os.system("cls")