
#############################################
# Project: PyAN
# File: command.py
# By: ProgrammingIncluded
# Website: ProgrammingIncluded.com
# Desc: File to work with platform dependent
#       commands.
#############################################

import os
import subprocess
import threading as thr

clear = None

if os.name in ('linux', 'osx', 'posix'):
    def clear():
        subprocess.call("clear")
elif os.name in ('nt','dos'):
    def clear():
        os.system("cls")
else:
    def clear():
        printfunc()


if os.name in ('linux', 'osx', 'posix'):
    import curses
    def flush_input():
        curses.flushinp()
else:
    import msvcrt
    def flush_input():
        while msvcrt.kbhit():
            msvcrt.getch()

def printfunc():
    print("\n" * 120)

# String Buffer.
BUF = ""
CALLED = False

# Custom overriden print for buffer optimization.
def print_buf(val):
    global BUF
    global CALLED
    CALLED = True
    BUF += val
    

def display_buffer():
    global CALLED
    if CALLED:
        global BUF
        CALLED = False
        clear()
        print(BUF)
        BUF = ""

    
e61a9270813640fa04a0f5944a09db75b6e8d574
<mask token>


def printfunc():
    print('\n' * 120)


<mask token>


def print_buf(val):
    global BUF
    global CALLED
    CALLED = True
    BUF += val


def display_buffer():
    global CALLED
    if CALLED:
        global BUF
        CALLED = False
        clear()
        print(BUF)
        BUF = ''

<mask token>
if os.name in ('linux', 'osx', 'posix'):

    def clear():
        subprocess.call('clear')
elif os.name in ('nt', 'dos'):

    def clear():
        os.system('cls')
else:

    def clear():
        printfunc()
if os.name in ('linux', 'osx', 'posix'):
    import curses

    def flush_input():
        curses.flushinp()
else:
    import msvcrt

    def flush_input():
        while msvcrt.kbhit():
            msvcrt.getch()


def printfunc():
    print('\n' * 120)


<mask token>


def print_buf(val):
    global BUF
    global CALLED
    CALLED = True
    BUF += val


def display_buffer():
    global CALLED
    if CALLED:
        global BUF
        CALLED = False
        clear()
        print(BUF)
        BUF = ''

<mask token>
clear = None
if os.name in ('linux', 'osx', 'posix'):

    def clear():
        subprocess.call('clear')
elif os.name in ('nt', 'dos'):

    def clear():
        os.system('cls')
else:

    def clear():
        printfunc()
if os.name in ('linux', 'osx', 'posix'):
    import curses

    def flush_input():
        curses.flushinp()
else:
    import msvcrt

    def flush_input():
        while msvcrt.kbhit():
            msvcrt.getch()


def printfunc():
    print('\n' * 120)


BUF = ''
CALLED = False


def print_buf(val):
    global BUF
    global CALLED
    CALLED = True
    BUF += val


def display_buffer():
    global CALLED
    if CALLED:
        global BUF
        CALLED = False
        clear()
        print(BUF)
        BUF = ''

import os
import subprocess
import threading as thr
clear = None
if os.name in ('linux', 'osx', 'posix'):

    def clear():
        subprocess.call('clear')
elif os.name in ('nt', 'dos'):

    def clear():
        os.system('cls')
else:

    def clear():
        printfunc()
if os.name in ('linux', 'osx', 'posix'):
    import curses

    def flush_input():
        curses.flushinp()
else:
    import msvcrt

    def flush_input():
        while msvcrt.kbhit():
            msvcrt.getch()


def printfunc():
    print('\n' * 120)


BUF = ''
CALLED = False


def print_buf(val):
    global BUF
    global CALLED
    CALLED = True
    BUF += val


def display_buffer():
    global CALLED
    if CALLED:
        global BUF
        CALLED = False
        clear()
        print(BUF)
        BUF = ''


#############################################
# Project: PyAN
# File: command.py
# By: ProgrammingIncluded
# Website: ProgrammingIncluded.com
# Desc: File to work with platform dependent
#       commands.
#############################################

import os
import subprocess
import threading as thr

clear = None

if os.name in ('linux', 'osx', 'posix'):
    def clear():
        subprocess.call("clear")
elif os.name in ('nt','dos'):
    def clear():
        os.system("cls")
else:
    def clear():
        printfunc()


if os.name in ('linux', 'osx', 'posix'):
    import curses
    def flush_input():
        curses.flushinp()
else:
    import msvcrt
    def flush_input():
        while msvcrt.kbhit():
            msvcrt.getch()

def printfunc():
    print("\n" * 120)

# String Buffer.
BUF = ""
CALLED = False

# Custom overriden print for buffer optimization.
def print_buf(val):
    global BUF
    global CALLED
    CALLED = True
    BUF += val
    

def display_buffer():
    global CALLED
    if CALLED:
        global BUF
        CALLED = False
        clear()
        print(BUF)
        BUF = ""

    