def _check_native(self, values, plugin): missing = "" for native in values: if native.startswith('!'): # native should not exist requirement_ok = not executable_exists(native[1:]) else: requirement_ok = executable_exists(native) if not requirement_ok: missing += native missing += " " if not missing: return True message = "Missing native executables {}" return message.format(missing)
def _check_native(self, values, plugin): missing = "" for native in values: if not executable_exists(native): missing += native missing += " " if len(missing) == 0: return True else: warning("Disabeling {} - missing native executables {}".format(plugin.get_name(), missing))
def _check_native(self, values, plugin): missing = "" for native in values: if not executable_exists(native): missing += native missing += " " if not missing: return True message = "Missing native executables {}" return message.format(missing)
def __call__(self, jarvis, s): if executable_exists('ifconfig'): self._get_local_ip(jarvis) jarvis.say("") self._get_public_ip(jarvis)
Thread(target=notify_implementation).start() CLI_FALLBACK_URGENCY_CONVERTER = {0: '', 1: '!', 2: '!!!'} def notify__CLI_FALLBACK(name, body, urgency=NOTIFY_NORMAL): urgency = CLI_FALLBACK_URGENCY_CONVERTER[urgency] print("NOTIFICATION {} ====> {} - {}".format(urgency, str(name), str(body))) if IS_MACOS: import pync notify = notify__MAC elif IS_WIN and WIN_VER == '10': import win10toast notify = notify__WIN10 else: if executable_exists("notify-send"): from os import system notify = notify__LINUX else: try: import tkinter as tk from tkinter import messagebox as tkMessageBox from threading import Thread notify = notify__GUI_FALLBACK except ImportError: notify = notify__CLI_FALLBACK