Mercurial > libervia-backend
comparison sat.tac @ 106:138d82f64b6f
plugin CS: friends parsing
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 26 Jun 2010 15:33:16 +0800 |
parents | d2630fba8dfd |
children | 5ae370c71803 |
comparison
equal
deleted
inserted
replaced
105:d2630fba8dfd | 106:138d82f64b6f |
---|---|
23 'client_name' : u'SàT (Salut à toi)', | 23 'client_name' : u'SàT (Salut à toi)', |
24 'client_version' : u'0.0.2D', #Please add 'D' at the end for dev versions | 24 'client_version' : u'0.0.2D', #Please add 'D' at the end for dev versions |
25 'local_dir' : '~/.sat' | 25 'local_dir' : '~/.sat' |
26 } | 26 } |
27 | 27 |
28 import gettext | |
29 gettext.install('sat', "i18n", unicode=True) | |
28 | 30 |
29 from twisted.application import internet, service | 31 from twisted.application import internet, service |
30 from twisted.internet import glib2reactor, protocol, task | 32 from twisted.internet import glib2reactor, protocol, task |
31 glib2reactor.install() | 33 glib2reactor.install() |
32 | 34 |
47 import os.path | 49 import os.path |
48 | 50 |
49 from tools.memory import Memory | 51 from tools.memory import Memory |
50 from tools.xml_tools import tupleList2dataForm | 52 from tools.xml_tools import tupleList2dataForm |
51 from glob import glob | 53 from glob import glob |
52 | |
53 import gettext | |
54 gettext.install('sat', "i18n", unicode=True) | |
55 | 54 |
56 try: | 55 try: |
57 from twisted.words.protocols.xmlstream import XMPPHandler | 56 from twisted.words.protocols.xmlstream import XMPPHandler |
58 except ImportError: | 57 except ImportError: |
59 from wokkel.subprotocols import XMPPHandler | 58 from wokkel.subprotocols import XMPPHandler |
566 | 565 |
567 @return: action id for result, or empty string in case or error | 566 @return: action id for result, or empty string in case or error |
568 """ | 567 """ |
569 if type=="button": | 568 if type=="button": |
570 try: | 569 try: |
571 cb_name = self.memory.getParamA(data["name"], data["category"], "callback") | 570 cb_name = data['callback_id'] |
572 except KeyError: | 571 except KeyError: |
573 error (_("Incomplete data")) | 572 error (_("Incomplete data")) |
574 return "" | 573 return "" |
575 id = sat_next_id() | 574 id = sat_next_id() |
576 self.callGeneralCB(cb_name, id, data) | 575 self.callGeneralCB(cb_name, id, data) |