Ejemplo n.º 1
0
 def octoberfest():
     for bb in range(99, 2, -1):
         yield ("0" * 65535) + "\n"  # ENOUGH TO FILL THE INCOMING BUFFER
         Thread.sleep(1.0 / RATE)
         yield CNV.unicode2utf8(
             expand_template(
                 "{{num}} bottles of beer on the wall! {{num}} bottles of beer!  Take one down, pass it around! {{less}} bottles of beer on he wall!\n",
                 {"num": bb, "less": bb - 1},
             )
         )
     yield ("0" * 65535) + "\n"  # ENOUGH TO FILL THE INCOMING BUFFER
     yield CNV.unicode2utf8(
         u"2 bottles of beer on the wall! 2 bottles of beer!  Take one down, pass it around! 1 bottle of beer on he wall!\n"
     )
     yield ("0" * 65535) + "\n"  # ENOUGH TO FILL THE INCOMING BUFFER
     yield CNV.unicode2utf8(
         u"1 bottle of beer on the wall! 1 bottle of beer!  Take one down, pass it around! 0 bottles of beer on he wall.\n"
     )
Ejemplo n.º 2
0
 def octoberfest():
     for bb in range(99, 2, -1):
         yield ("0" * 65535) + "\n"  # ENOUGH TO FILL THE INCOMING BUFFER
         Thread.sleep(1.0 / RATE)
         yield CNV.unicode2utf8(
             expand_template(
                 "{{num}} bottles of beer on the wall! {{num}} bottles of beer!  Take one down, pass it around! {{less}} bottles of beer on he wall!\n",
                 {
                     "num": bb,
                     "less": bb - 1
                 }))
     yield ("0" * 65535) + "\n"  # ENOUGH TO FILL THE INCOMING BUFFER
     yield CNV.unicode2utf8(
         u"2 bottles of beer on the wall! 2 bottles of beer!  Take one down, pass it around! 1 bottle of beer on he wall!\n"
     )
     yield ("0" * 65535) + "\n"  # ENOUGH TO FILL THE INCOMING BUFFER
     yield CNV.unicode2utf8(
         u"1 bottle of beer on the wall! 1 bottle of beer!  Take one down, pass it around! 0 bottles of beer on he wall.\n"
     )