Exemplo n.º 1
0
 def display_search(self, text, viewer):
     rooms = self.list_destinations(viewer)
     formatted = [room.format_roomlist() for room in rooms if room.key.lower().startswith(text.lower())]
     message = list()
     message.append(viewer.render.separator(self.key))
     message.append(tabular_table(formatted, field_width=36, line_length=78, truncate_elements=True))
     return "\n".join([unicode(line) for line in message])
Exemplo n.º 2
0
 def switch_list(self, lhs, rhs):
     themes = FCList.objects.all().order_by('key')
     if not themes:
         self.error("No themes to display!")
         return
     message = list()
     message.append(self.player.render.header('Theme Listing'))
     theme_table = tabular_table(themes, field_width=37)
     message.append(theme_table)
     message.append(self.player.render.footer())
     self.msg_lines(message)
Exemplo n.º 3
0
 def format_exit_list(self, exits, caller):
     exit_table = []
     for exit in exits:
         exit_table.append(exit.format_output(caller))
     return tabular_table(exit_table, field_width=36, line_length=78, truncate_elements=False)