Beispiel #1
0
    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)
Beispiel #2
0
    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))
Beispiel #3
0
    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)
Beispiel #4
0
    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)
Beispiel #5
0
    def __call__(self, jarvis, s):
        if executable_exists('ifconfig'):
            self._get_local_ip(jarvis)
            jarvis.say("")

        self._get_public_ip(jarvis)
Beispiel #6
0
    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
Beispiel #7
0
    def __call__(self, jarvis, s):
        if executable_exists('ifconfig'):
            self._get_local_ip(jarvis)
            jarvis.say("")

        self._get_public_ip(jarvis)