diff --git a/master/buildbot/status/words.py b/master/buildbot/status/words.py index 51e912eb49f..3e129b53785 100644 --- a/master/buildbot/status/words.py +++ b/master/buildbot/status/words.py @@ -1,3 +1,4 @@ +# coding: utf-8 # This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. @@ -39,6 +40,26 @@ from buildbot.status.results import SUCCESS from buildbot.status.results import WARNINGS +# Used in command_HELLO and it's test. 'Hi' in 100 languages. + +GREETINGS = [ + "ږغ كول ، هركلى كول ږغ، هركلى", "Goeie dag", "Tungjatjeta", + "Yatasay", "Ahlan bik", "Voghdzuyin", "hola", "kaixo", "Horas", + "Pryvitańnie", "Nomoskar", "Oki", "Selam", "Dez-mat", "Zdrávejte", + "Mingala ba", "Hola", "Hafa dai", "Oh-see-YOH", "Nín hao", "Bonjou", + "Zdravo", "Nazdar", "Hallo", "Hallo", "Iiti", "Kotáka", "Saluton", "Tere", + "Hallo", "Hallo", "Bula", "Helo", "Hei", "Goede morgen", "Bonjour", "Hoi", + "Ola", "Gamardžoba", "Guten Tag", "Mauri", "Geia!", "Inuugujoq", "Kem cho", + "Sannu", "Aloha", "Shalóm", "Namasté", "Szia", "Halló", "Hai", "Kiana", + "Dia is muire dhuit", "Buongiorno", "Kónnichi wa", "Salam", + "Annyeonghaseyo", "Na", "Sabai dii", "Ave", "Es mīlu tevi", "Labas.", + "Selamat petang", "Ni hao", "Kia ora", "Yokwe", "Kwe", "sain baina uu", + "niltze", "Yá'át'ééh", "Namaste", "Hallo.", "Salâm", "Witajcie", "Olá", + "Kâils", "Aroha", "Salut", "Privét", "Talofa", "Namo namah", "ćao", + "Nazdar", "Zdravo", "Hola", "Jambo", "Hej", "Sälü", "Halo", "Selam", + "Sàwàtdee kráp", "Dumela", "Merhaba", "Pryvít", "Adaab arz hai", "Chào", + "Glidis", "Helo", "Sawubona", "Hoi"] + # This should probably move to the irc class. def maybeColorize(text, color, useColors): @@ -159,6 +180,7 @@ def __init__(self, bot, user=None, channel=None): self.user = user self.channel = channel + self._next_HELLO = 'yes?' # silliness @@ -275,7 +297,8 @@ def splitArgs(self, args): raise UsageError(e) def command_HELLO(self, args): - self.send("yes?") + self.send(self._next_HELLO) + self._next_HELLO = random.choice(GREETINGS) def command_VERSION(self, args): self.send("buildbot-%s at your service" % version) diff --git a/master/buildbot/test/unit/test_status_words.py b/master/buildbot/test/unit/test_status_words.py index 52ffe9ddcaf..ef6cd665f70 100644 --- a/master/buildbot/test/unit/test_status_words.py +++ b/master/buildbot/test/unit/test_status_words.py @@ -300,6 +300,13 @@ def test_command_hustle(self): yield self.do_test_command('hustle', clock_ticks=[1.0] * 2, exp_usage=False) self.assertEqual(self.actions, ['does the hustle']) + @defer.inlineCallbacks + def test_command_hello(self): + yield self.do_test_command('hello', exp_usage=False) + self.assertEqual(self.sent, ['yes?']) + yield self.do_test_command('hello', exp_usage=False) + self.assertIn(self.sent[0], words.GREETINGS) + @defer.inlineCallbacks def test_command_list(self): yield self.do_test_command('list', exp_UsageError=True) diff --git a/master/docs/relnotes/index.rst b/master/docs/relnotes/index.rst index 2497cf15701..33362bb7f8a 100644 --- a/master/docs/relnotes/index.rst +++ b/master/docs/relnotes/index.rst @@ -14,7 +14,7 @@ Master Features ~~~~~~~~ - +* ``hello`` now returns 'Hello' in a random language if invoked more than once. * :bb:sched:`Triggerable` now accepts a ``reason`` parameter.