| 26 | tableTag = tag ('table', border='1') |
| 27 | |
| 28 | class Hello(Twisted.Page): |
| 29 | isLeaf = 1 |
| 30 | document = tag('html')[ |
| 31 | tag('head') [ |
| 32 | tag('title')[ "Hi" ], |
| 33 | ], |
| 34 | tag('body') [ |
| 35 | tag('h3')[ "Hello World!" ], |
| 36 | tag('p') [ place("dataTable") ] |
| 37 | ], |
| 38 | ] |
| 39 | |
| 40 | def render_dataTable (self, context): |
| 41 | data = [] |
| 42 | |
| 43 | for id in BZFlag.Players.keys (): |
| 44 | player = BZFlag.Players[id] |
| 45 | data.append ([id, player.callsign, player.wins - player.losses, player.team]) |
| 46 | |
| 47 | return MyTable (data, [ |
| 48 | Nouvelle.IndexedColumn ('id', 0), |
| 49 | Nouvelle.IndexedColumn ('callsign', 1), |
| 50 | Nouvelle.IndexedColumn ('score', 2), |
| 51 | Nouvelle.IndexedColumn ('team', 3), |
| 52 | ], id='players') |
| 53 | |
| 54 | reactor = BZReactor () |
| 55 | |