Added support for Cygwin on ClearScreen()

This commit is contained in:
clamsawd 2015-10-31 19:14:48 +01:00
parent ca86e799f1
commit 5184ed4d59
3 changed files with 12 additions and 6 deletions

View File

@ -5,7 +5,7 @@
# ip2e (IP to email) - Create the configuration file. | # ip2e (IP to email) - Create the configuration file. |
# Created by clamsawd (clamsawd@openmailbox.org) | # Created by clamsawd (clamsawd@openmailbox.org) |
# Licensed by GPL v.3 | # Licensed by GPL v.3 |
# Last update: 30-10-2015 | # Last update: 31-10-2015 |
# | # |
# Compatible with Python 3.x | # Compatible with Python 3.x |
# -------------------------------------------------------------- # --------------------------------------------------------------
@ -24,7 +24,9 @@ if sys.version_info<(3,0):
#Function to clear screen #Function to clear screen
def ClearScreen(): def ClearScreen():
if os.name == "posix": if sys.platform == "cygwin":
print (300 * "\n")
elif os.name == "posix":
os.system("clear") os.system("clear")
elif os.name == "nt": elif os.name == "nt":
os.system("cls") os.system("cls")

View File

@ -5,7 +5,7 @@
# ip2e (IP to email) - Run ip2e daemon. | # ip2e (IP to email) - Run ip2e daemon. |
# Created by clamsawd (clamsawd@openmailbox.org) | # Created by clamsawd (clamsawd@openmailbox.org) |
# Licensed by GPL v.3 | # Licensed by GPL v.3 |
# Last update: 30-10-2015 | # Last update: 31-10-2015 |
# | # |
# Compatible with Python 3.x | # Compatible with Python 3.x |
# -------------------------------------------------------------- # --------------------------------------------------------------
@ -28,7 +28,9 @@ if sys.version_info<(3,0):
#Function to clear screen #Function to clear screen
def ClearScreen(): def ClearScreen():
if os.name == "posix": if sys.platform == "cygwin":
print (300 * "\n")
elif os.name == "posix":
os.system("clear") os.system("clear")
elif os.name == "nt": elif os.name == "nt":
os.system("cls") os.system("cls")

View File

@ -5,7 +5,7 @@
# ip2e (IP to email) - See the log file. | # ip2e (IP to email) - See the log file. |
# Created by clamsawd (clamsawd@openmailbox.org) | # Created by clamsawd (clamsawd@openmailbox.org) |
# Licensed by GPL v.3 | # Licensed by GPL v.3 |
# Last update: 30-10-2015 | # Last update: 31-10-2015 |
# | # |
# Compatible with Python 3.x | # Compatible with Python 3.x |
# -------------------------------------------------------------- # --------------------------------------------------------------
@ -24,7 +24,9 @@ if sys.version_info<(3,0):
#Function to clear screen #Function to clear screen
def ClearScreen(): def ClearScreen():
if os.name == "posix": if sys.platform == "cygwin":
print (300 * "\n")
elif os.name == "posix":
os.system("clear") os.system("clear")
elif os.name == "nt": elif os.name == "nt":
os.system("cls") os.system("cls")