def main(): if version_info.major != 3: print("Must be using python3!") exit(1) if sys() != "Linux" and sys() != "Darwin": print("Unsupported platform!") exit(1) next_to_create, to_compile, to_create = False, [], [] for argument in arguments: if next_to_create: to_create.append(argument) next_to_create = False else: if argument == "--create": next_to_create = True else: to_compile.append(argument) if not arguments: print(f"Jacmake {version} - help") with open("/usr/local/Jac/Data/jacmake-help.txt") as help_file: print(help_file.read(), end='') else: createDirs(to_create) compileDirs(to_compile)
def chomp(carr, x, y): global hand, P1 if hand: if x == 0 and y == 0: c.delete('cookie') c.config(background=colors['WIN']) call(' '.join([{'Linux': 'aplay', 'OSX': 'afplay'}.get(sys(), 'true'), dirpath + '/assets/death.wav', '2>/dev/null', '&']), shell=True) win() if x == wid - 1 and y == hei - 1 and not won: P1 = not P1 call(' '.join([{'Linux': 'aplay', 'OSX': 'afplay'}.get(sys(), 'true'), dirpath + '/assets/chomp.wav', '2>/dev/null', '&']), shell=True) c.itemconfig(carr[x][y].id, fill=colors['ECK'], outline='') carr[x][y].chomped = True carr[x][y].chompable = False c.update()
def Os__LINUX(jarvis, s): """Displays information about your operating system""" jarvis.say('[!] Operating System Information', Fore.BLUE) jarvis.say('[*] ' + sys(), Fore.GREEN) jarvis.say('[*] ' + release(), Fore.GREEN) jarvis.say('[*] ' + distro.name(), Fore.GREEN) for _ in architecture(): jarvis.say('[*] ' + _, Fore.GREEN)
def do_os(self, s): """Displays information about your operating system.""" print_say('[!] Operating System Information', self, Fore.BLUE) print_say('[*] ' + sys(), self, Fore.GREEN) print_say('[*] ' + release(), self, Fore.GREEN) print_say('[*] ' + dist()[0], self, Fore.GREEN) for _ in architecture(): print_say('[*] ' + _, self, Fore.GREEN)
def Os__LINUX(jarvis, s): """Displays information about your operating system""" jarvis.say('[!] Operating System Information', Fore.BLUE) jarvis.say('[*] ' + sys(), Fore.GREEN) jarvis.say('[*] ' + release(), Fore.GREEN) jarvis.say('[*] ' + dist()[0], Fore.GREEN) for _ in architecture(): jarvis.say('[*] ' + _, Fore.GREEN)
def do_os(self, s): """Displays information about your operating system.""" print(Fore.BLUE + '[!] Operating System Information' + Fore.RESET) print(Fore.GREEN + '[*] ' + sys() + Fore.RESET) print(Fore.GREEN + '[*] ' + release() + Fore.RESET) print(Fore.GREEN + '[*] ' + dist()[0] + Fore.RESET) for _ in architecture(): print(Fore.GREEN + '[*] ' + _ + Fore.RESET)
def clear(t=0): sleep(t) try: if sys() in ['Linux', 'Darwin']: system('clear') else: system('cls') except: print('\n'*50)
def os_detection(): """ Displays information about your operating system. """ print Fore.BLUE + '[!] Operating System Information' + Fore.RESET print Fore.GREEN + '[*] ' + sys() + Fore.RESET print Fore.GREEN + '[*] ' + release() + Fore.RESET print Fore.GREEN + '[*] ' + dist()[0] + Fore.RESET for _ in architecture(): print Fore.GREEN + '[*] ' + _ + Fore.RESET
def Os__MAC(jarvis, s): """Displays information about your operating system""" jarvis.say( Style.BRIGHT + '[!] Operating System Information' + Style.RESET_ALL, Fore.BLUE) jarvis.say('[*] Kernel: ' + sys(), Fore.GREEN) jarvis.say('[*] Kernel Release Version: ' + release(), Fore.GREEN) jarvis.say('[*] macOS System version: ' + mac_ver()[0], Fore.GREEN) for _ in architecture(): if _ != '': jarvis.say('[*] ' + _, Fore.GREEN)
def generateEntry(files_to_be_executed: list): bare_file = open( f"/usr/local/Jac/Data/entry-{'gnu' if sys() == 'Linux' else 'macho'}.s" ) entry_code = bare_file.read().split("\n") main_index = entry_code.index('main:' if sys() == 'Linux' else '_main:') + 1 regex = re_compile('[^a-zA-Z/]') for file in reversed(files_to_be_executed): file = regex.sub('', file) file = file.replace("/", ".") entry_code.insert(main_index, f" call s{file}") return "\n".join(entry_code)
def Os__MAC(jarvis, s): """Displays information about your operating system""" jarvis.say( Style.BRIGHT + '[!] Operating System Information' + Style.RESET_ALL, Fore.BLUE) jarvis.say('[*] Kernel: ' + sys(), Fore.GREEN) jarvis.say('[*] Kernel Release Version: ' + release(), Fore.GREEN) jarvis.say('[*] macOS System version: ' + mac_ver()[0], Fore.GREEN) for _ in architecture(): if _ is not '': jarvis.say('[*] ' + _, Fore.GREEN)
def cls(): if sys() == 'Linux': os.system('clear') if sys() == 'Windows': os.system('cls')
def clean_screen(): if sys() == 'Linux': system("clear") else: system("cls")
def isLinuxPlatform(self): name = sys() return name == 'Linux'
def clear(): if "windows" in sys().lower(): system("cls") else: system("clear")