Ejemplo n.º 1
0
    def complete(self, container):
        """
        Attempt to tab-complete user names.
        """

        needle = container.autocomplete
        usernames = self.factory.protocols.keys()

        results = complete(needle, usernames)

        self.write_packet("tab", autocomplete=results)
Ejemplo n.º 2
0
    def complete(self, container):
        """
        Attempt to tab-complete user names.
        """

        needle = container.autocomplete
        usernames = self.factory.protocols.keys()

        results = complete(needle, usernames)

        self.write_packet("tab", autocomplete=results)
Ejemplo n.º 3
0
 def test_complete_single(self):
     i = u"comp"
     o = [u"completion"]
     e = u"completion "
     self.assertEqual(complete(i, o), e)
Ejemplo n.º 4
0
 def test_complete_single_invalid(self):
     i = u"comp"
     o = [u"invalid"]
     e = u""
     self.assertEqual(complete(i, o), e)
Ejemplo n.º 5
0
 def test_complete_none(self):
     i = u"comp"
     o = []
     e = u""
     self.assertEqual(complete(i, o), e)
Ejemplo n.º 6
0
 def test_complete_multiple(self):
     i = u"comp"
     o = [u"completion", u"computer"]
     e = u"completion \u0000computer "
     self.assertEqual(complete(i, o), e)