Beispiel #1
0
 def _cells(self, send, encoding):
     if isinstance(self.__text, unicode):
         text = self.__text.encode(encoding)
     else:
         text = self.__text
     # TODO: Autogenerate unique keys instead of requiring the label to be unique.
     yield self.__label, CommandCell(functools.partial(send, text),
                                     label=self.__label)
Beispiel #2
0
 def _install_cells(self, callback, send, encoding):
     if isinstance(self.__text, unicode):
         text = self.__text.encode(encoding)
     else:
         text = self.__text
     # TODO: Use cell metadata (once that idea exists) to specify the label, so it isn't required to be unique.
     callback(CommandCell(self, self.__label, functools.partial(send,
                                                                text)))