Crossfire Server, Trunk
guildboard.py
Go to the documentation of this file.
1 import Crossfire
2 import CFGuilds
3 
4 def mycmp(a, b):
5  return cmp(a[1], b[1])
6 
7 activator=Crossfire.WhoIsActivator()
9 
10 activator.Write('Guild Standings:')
11 activator.Write('Guild - Points - Status')
12 
13 guildlist = guilds.list_guilds()
14 standings = []
15 for guild in guildlist:
16  record = guilds.info(guild)
17  if record['Status'] != 'inactive':
18  standings.append([record['Points'], guild, record['Status']])
19 standings.sort(mycmp)
20 for item in standings:
21  activator.Write('%s - %s - %s' %(item[1],item[0],item[2]))
22 
23 Crossfire.SetReturnValue(1)
guildboard.mycmp
def mycmp(a, b)
Definition: guildboard.py:4
CFGuilds.CFGuildHouses
Definition: CFGuilds.py:47