comparison browser_side/card_game.py @ 55:d5266c41ca24

Roster list update, contact deletion + some refactoring
author Goffi <goffi@goffi.org>
date Sun, 29 May 2011 02:13:53 +0200
parents 71a9cc9b9d57
children 12e889a683ce
comparison
equal deleted inserted replaced
54:f25c4077f6b9 55:d5266c41ca24
37 from pyjamas import DOM 37 from pyjamas import DOM
38 38
39 from pyjamas.dnd import makeDraggable 39 from pyjamas.dnd import makeDraggable
40 from pyjamas.ui.DragWidget import DragWidget, DragContainer 40 from pyjamas.ui.DragWidget import DragWidget, DragContainer
41 from jid import JID 41 from jid import JID
42 from dialog import ConfirmDialog, SimpleDialog 42 from dialog import ConfirmDialog, InfoDialog
43 from tools import html_sanitize 43 from tools import html_sanitize
44 from datetime import datetime 44 from datetime import datetime
45 from time import time 45 from time import time
46 from games import TarotCard 46 from games import TarotCard
47 import re 47 import re
412 if self.player_nick in winners: 412 if self.player_nick in winners:
413 title = "You <b>win</b> !" 413 title = "You <b>win</b> !"
414 else: 414 else:
415 title = "You <b>loose</b> :(" 415 title = "You <b>loose</b> :("
416 body = re.sub(r'<.*?>',lambda x:'<br />' if '/elem' in x.group(0) else '', xml_data) #Q&D conversion to simple HTML text 416 body = re.sub(r'<.*?>',lambda x:'<br />' if '/elem' in x.group(0) else '', xml_data) #Q&D conversion to simple HTML text
417 SimpleDialog(title, body, _new_game).show() 417 InfoDialog(title, body, _new_game).show()