예제 #1
0
 def cb_func(tag,name,desc,file):
     s = EnchantStr("")
     tag = s.decode(tag)
     name = s.decode(name)
     desc = s.decode(desc)
     file = s.decode(file)
     cb_result.append((tag,name,desc,file))
예제 #2
0
 def cb_func(tag,name,desc,file):
     s = EnchantStr("")
     tag = s.decode(tag)
     name = s.decode(name)
     desc = s.decode(desc)
     file = s.decode(file)
     cb_result.append((tag,name,desc,file))
예제 #3
0
 def __describe_callback(self,name,desc,file):
     """Collector callback for dictionary description.
     
     This method is used as a callback into the _enchant function
     'enchant_broker_describe'.  It collects the given arguments in
     a tuple and appends them to the list '__describe_result'.
     """
     s = EnchantStr("")
     name = s.decode(name)
     desc = s.decode(desc)
     file = s.decode(file)
     self.__describe_result.append((name,desc,file))
예제 #4
0
    def __describe_callback(self,name,desc,file):
        """Collector callback for dictionary description.

        This method is used as a callback into the _enchant function
        'enchant_broker_describe'.  It collects the given arguments in
        a tuple and appends them to the list '__describe_result'.
        """
        s = EnchantStr("")
        name = s.decode(name)
        desc = s.decode(desc)
        file = s.decode(file)
        self.__describe_result.append((name,desc,file))
예제 #5
0
 def __describe_callback(self,tag,name,desc,file):
     """Collector callback for dictionary description.
     
     This method is used as a callback into the _enchant function
     'enchant_dict_describe'.  It collects the given arguments in
     a tuple and stores them in the attribute '__describe_result'.
     """
     s = EnchantStr("")
     tag = s.decode(tag)
     name = s.decode(name)
     desc = s.decode(desc)
     file = s.decode(file)
     self.__describe_result = (tag,name,desc,file)
예제 #6
0
 def __list_dicts_callback(self,tag,name,desc,file):
     """Collector callback for listing dictionaries.
     
     This method is used as a callback into the _enchant function
     'enchant_broker_list_dicts'.  It collects the given arguments into
     an appropriate tuple and appends them to '__list_dicts_result'.
     """
     s = EnchantStr("")
     tag = s.decode(tag)
     name = s.decode(name)
     desc = s.decode(desc)
     file = s.decode(file)
     self.__list_dicts_result.append((tag,(name,desc,file)))
예제 #7
0
    def __describe_callback(self,tag,name,desc,file):
        """Collector callback for dictionary description.

        This method is used as a callback into the _enchant function
        'enchant_dict_describe'.  It collects the given arguments in
        a tuple and stores them in the attribute '__describe_result'.
        """
        s = EnchantStr("")
        tag = s.decode(tag)
        name = s.decode(name)
        desc = s.decode(desc)
        file = s.decode(file)
        self.__describe_result = (tag,name,desc,file)
예제 #8
0
    def __list_dicts_callback(self,tag,name,desc,file):
        """Collector callback for listing dictionaries.

        This method is used as a callback into the _enchant function
        'enchant_broker_list_dicts'.  It collects the given arguments into
        an appropriate tuple and appends them to '__list_dicts_result'.
        """
        s = EnchantStr("")
        tag = s.decode(tag)
        name = s.decode(name)
        desc = s.decode(desc)
        file = s.decode(file)
        self.__list_dicts_result.append((tag,(name,desc,file)))
예제 #9
0
    def get_param(self,name):
        """Get the value of a named parameter on this broker.

        Parameters are used to provide runtime information to individual
        provider backends.  See the method 'set_param' for more details.
        """
        name = EnchantStr(name)
        return name.decode(_e.broker_get_param(self._this,name.encode()))
예제 #10
0
    def get_param(self, name):
        """Get the value of a named parameter on this broker.

        Parameters are used to provide runtime information to individual
        provider backends.  See the method 'set_param' for more details.
        """
        name = EnchantStr(name)
        return name.decode(_e.broker_get_param(self._this, name.encode()))
예제 #11
0
 def suggest(self,word):
     """Suggest possible spellings for a word.
     
     This method tries to guess the correct spelling for a given
     word, returning the possibilities in a list.
     """
     self._check_this()
     word = EnchantStr(word)
     suggs = _e.dict_suggest(self._this,word.encode())
     return [word.decode(w) for w in suggs]
예제 #12
0
 def suggest(self, word):
     """Suggest possible spellings for a word.
     
     This method tries to guess the correct spelling for a given
     word, returning the possibilities in a list.
     """
     self._check_this()
     word = EnchantStr(word)
     suggs = _e.dict_suggest(self._this, word.encode())
     return [word.decode(w) for w in suggs]
예제 #13
0
 def suggest(self,word):
     """Suggest possible spellings for a word.
     
     This method tries to guess the correct spelling for a given
     word, returning the possibilities in a list.
     """
     self._check_this()
     word = EnchantStr(word)
     # Enchant asserts that the word is non-empty.
     # Check it up-front to avoid nasty warnings on stderr.
     if len(word) == 0:
         raise ValueError("can't suggest spellings for empty string")
     suggs = _e.dict_suggest(self._this,word.encode())
     return [word.decode(w) for w in suggs]
예제 #14
0
 def suggest(self,word):
     """Suggest possible spellings for a word.
     
     This method tries to guess the correct spelling for a given
     word, returning the possibilities in a list.
     """
     self._check_this()
     word = EnchantStr(word)
     # Enchant asserts that the word is non-empty.
     # Check it up-front to avoid nasty warnings on stderr.
     if len(word) == 0:
         raise ValueError("can't suggest spellings for empty string")
     suggs = _e.dict_suggest(self._this,word.encode())
     return [word.decode(w) for w in suggs]