コード例 #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)
コード例 #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))
コード例 #3
0
ファイル: PluginManager.py プロジェクト: jarvisaibot/Jarvis-1
    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)
コード例 #4
0
ファイル: PluginManager.py プロジェクト: vieiraroger/Jarvis
    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)
コード例 #5
0
ファイル: ip.py プロジェクト: Laburda/Jarvis-3
    def __call__(self, jarvis, s):
        if executable_exists('ifconfig'):
            self._get_local_ip(jarvis)
            jarvis.say("")

        self._get_public_ip(jarvis)
コード例 #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
コード例 #7
0
ファイル: ip.py プロジェクト: jarvisaibot/Jarvis-1
    def __call__(self, jarvis, s):
        if executable_exists('ifconfig'):
            self._get_local_ip(jarvis)
            jarvis.say("")

        self._get_public_ip(jarvis)