示例#1
0
    def __init__(self, testing=False, loop=None):
        self._operating_mode = "system_init"
        self._run_phase = "system_init"
        self.unittest = testing
        self._moduleLibrary = None
        YomboLibrary.__init__(self)

        self.loadedComponents = FuzzySearch({self._FullName.lower(): self},
                                            .95)
        self.loadedLibraries = FuzzySearch({self._Name.lower(): self}, .95)
        self.libraryNames = {}
        self._moduleLibrary = None
        self._invoke_list_cache = {
        }  # Store a list of hooks that exist or not. A cache.
        self._operating_mode = None  # One of: first_run, config, run
        self.sigint = False  # will be set to true if SIGINT is received
        self.hook_counts = OrderedDict(
        )  # keep track of hook names, and how many times it's called.
        reactor.addSystemEventTrigger("before", "shutdown", self.shutdown)
示例#2
0
    def _init_(self, **kwargs):
        """
        Construct a new voice_cmds Instance

        items is an dictionary to copy items from (optional)
        limiter is the match ratio below which mathes should not be considered
        """
        self.voice_command_strings = FuzzySearch(None, .80)
        self.voice_command_data = {}

        self.commandsByVoice = self._Commands.get_commands_by_voice()
示例#3
0
 def _init_(self, **kwargs):
     """
     Setups up the basic framework.
     
     """
     self.load_deferred = None  # Prevents loader from moving on past _start_ until we are done.
     self.commands = {}
     self.__yombocommandsByVoice = FuzzySearch(None, .92)
     self.command_search_attributes = [
         'command_id', 'label', 'machine_label', 'description',
         'always_load', 'voice_cmd', 'cmd', 'status'
     ]