Mercurial > libervia-web
annotate libervia.py @ 4:7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 13 Feb 2011 16:20:22 +0100 |
parents | 669c531a857e |
children | a663b9955cf3 |
rev | line source |
---|---|
0 | 1 #!/usr/bin/python |
2 # -*- coding: utf-8 -*- | |
3 | |
4 """ | |
5 Libervia: a Salut à Toi frontend | |
6 Copyright (C) 2011 Jérôme Poisson (goffi@goffi.org) | |
7 | |
8 This program is free software: you can redistribute it and/or modify | |
9 it under the terms of the GNU Affero General Public License as published by | |
10 the Free Software Foundation, either version 3 of the License, or | |
11 (at your option) any later version. | |
12 | |
13 This program is distributed in the hope that it will be useful, | |
14 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 GNU Affero General Public License for more details. | |
17 | |
18 You should have received a copy of the GNU Affero General Public License | |
19 along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 """ | |
21 | |
22 import pyjd # this is dummy in pyjs | |
23 from pyjamas.ui.SimplePanel import SimplePanel | |
24 from pyjamas.ui.RootPanel import RootPanel | |
25 from pyjamas.ui.VerticalPanel import VerticalPanel | |
26 from pyjamas.ui.HorizontalPanel import HorizontalPanel | |
4
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
27 from pyjamas.ui.HTMLPanel import HTMLPanel |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
28 from pyjamas.ui.Grid import Grid |
0 | 29 from pyjamas.ui.Label import Label |
30 from pyjamas.ui import HasAlignment | |
31 from pyjamas.ui.MenuBar import MenuBar | |
32 from pyjamas.ui.MenuItem import MenuItem | |
33 from pyjamas import Window | |
34 from pyjamas.ui.AutoComplete import AutoCompleteTextBox | |
35 from pyjamas.JSONService import JSONProxy | |
36 from register import RegisterPanel, RegisterBox | |
1 | 37 from pyjamas import DOM |
2
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
38 from contact import ContactPanel |
4
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
39 from datetime import datetime |
0 | 40 |
41 | |
42 class LiberviaJsonProxy(JSONProxy): | |
43 def __init__(self, *args, **kwargs): | |
44 JSONProxy.__init__(self, *args, **kwargs) | |
45 self.handler=self | |
46 self.cb={} | |
47 | |
48 def call(self, method, cb, *args): | |
49 self.cb[method] = cb | |
50 self.callMethod(method,args) | |
51 | |
52 def onRemoteResponse(self, response, request_info): | |
53 if self.cb.has_key(request_info.method): | |
54 self.cb[request_info.method](response) | |
55 del self.cb[request_info.method] | |
56 | |
57 def onRemoteError(self, code, errobj, request_info): | |
58 if code != 0: | |
59 Window.alert("Internal server error") | |
60 else: | |
61 if isinstance(errobj['message'],dict): | |
62 Window.alert("Error %s: %s" % (errobj['message']['faultCode'], errobj['message']['faultString'])) | |
63 else: | |
64 Window.alert("Error: %s" % errobj['message']) | |
65 | |
66 class RegisterCall(LiberviaJsonProxy): | |
67 def __init__(self): | |
68 LiberviaJsonProxy.__init__(self, "/register_api", | |
69 ["isRegistered","isConnected","connect"]) | |
70 self.handler=self | |
71 self.cb={} | |
72 | |
2
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
73 class BridgeCall(LiberviaJsonProxy): |
0 | 74 def __init__(self): |
75 LiberviaJsonProxy.__init__(self, "/json_api", | |
76 ["getContacts"]) | |
77 | |
2
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
78 class BridgeSignals(LiberviaJsonProxy): |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
79 def __init__(self): |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
80 LiberviaJsonProxy.__init__(self, "/json_signal_api", |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
81 ["getSignals"]) |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
82 |
0 | 83 class MenuCmd: |
84 | |
85 def __init__(self, object, handler): | |
86 self._object = object | |
87 self._handler = handler | |
88 | |
89 def execute(self): | |
90 handler = getattr(self._object, self._handler) | |
91 handler() | |
92 | |
93 class Menu(SimplePanel): | |
94 | |
95 def __init__(self): | |
96 SimplePanel.__init__(self) | |
97 | |
98 menu_general = MenuBar(vertical=True) | |
99 menu_general.addItem("Properties", MenuCmd(self, "onProperties")) | |
100 | |
101 menu_games = MenuBar(vertical=True) | |
102 menu_games.addItem("Tarot", MenuCmd(self, "onTarotGame")) | |
103 menu_games.addItem("Xiangqi", MenuCmd(self, "onXiangqiGame")) | |
104 | |
105 menubar = MenuBar(vertical=False) | |
106 menubar.addItem(MenuItem("General", menu_general)) | |
107 menubar.addItem(MenuItem("Games", True, menu_games)) | |
108 self.add(menubar) | |
109 | |
110 def onProperties(self): | |
111 Window.alert("Properties selected") | |
112 | |
113 def onTarotGame(self): | |
114 Window.alert("Tarot selected") | |
115 | |
116 def onXiangqiGame(self): | |
117 Window.alert("Xiangqi selected") | |
118 | |
119 class MagicBox(AutoCompleteTextBox): | |
120 | |
121 def __init__(self): | |
122 AutoCompleteTextBox.__init__(self) | |
1 | 123 |
124 def addKey(self, key): | |
125 self.getCompletionItems().completions.append(key) | |
126 | |
127 def addContact(self, jid, attributes, groups): | |
128 """Add a contact to the panel | |
129 @param jid: jid | |
130 @attributes: cf SàT Bridge API's newContact | |
131 @param groups: list of groups""" | |
132 for group in groups: | |
133 if not self.groups.has_key(group): | |
134 self.groups[group] = set() | |
135 self._groupList.add(group) | |
136 self.host.magicBox.addKey("@%s: " % group) | |
137 self.groups[group].add(jid) | |
138 self._contactList.add(jid) | |
139 | |
140 def onMouseMove(self, sender, x, y): | |
141 pass | |
142 | |
143 def onMouseDown(self, sender, x, y): | |
144 pass | |
145 | |
146 def onMouseUp(self, sender, x, y): | |
147 pass | |
148 | |
149 def onMouseEnter(self, sender): | |
150 if isinstance(sender, GroupLabel): | |
151 for contact in self._contactList: | |
152 if contact.jid in self.groups[sender.group]: | |
153 contact.addStyleName("selected") | |
154 | |
155 def onMouseLeave(self, sender): | |
156 if isinstance(sender, GroupLabel): | |
157 for contact in self._contactList: | |
158 if contact.jid in self.groups[sender.group]: | |
159 contact.removeStyleName("selected") | |
0 | 160 |
2
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
161 class MicroblogEntry(SimplePanel): |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
162 |
4
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
163 def __init__(self, body, author, timestamp): |
2
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
164 SimplePanel.__init__(self) |
4
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
165 |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
166 _datetime = datetime.fromtimestamp(timestamp) |
2
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
167 |
4
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
168 panel = HTMLPanel("<div class='mb_entry_author'>%(author)s on <span class='mb_entry_timestamp'>%(timestamp)s</span></div><p class='mb_entry_body'>%(body)s</p>" % |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
169 {"author": author, |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
170 "timestamp": _datetime, |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
171 "body": body} |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
172 ) |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
173 panel.setStyleName('microblogEntry') |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
174 self.add(panel) |
2
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
175 |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
176 |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
177 class MicroblogPanel(VerticalPanel): |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
178 |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
179 def __init__(self): |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
180 VerticalPanel.__init__(self) |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
181 self.setStyleName('microblogPanel') |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
182 |
4
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
183 def addEntry(self, text, author=None, timestamp=None): |
2
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
184 """Add an entry to the panel |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
185 @param text: main text of the entry |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
186 @param author: who wrote the entry |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
187 @param date: when the entry was written""" |
4
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
188 _entry = MicroblogEntry(text, author, timestamp) |
2
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
189 self.add(_entry) |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
190 |
0 | 191 class MiddlePannel(HorizontalPanel): |
192 | |
4
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
193 def __init__(self, host): |
1 | 194 self.host=host |
0 | 195 HorizontalPanel.__init__(self) |
2
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
196 self._left = self.host.contactPanel |
4
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
197 self._right = Grid(1,3) |
2
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
198 self._right.setWidth('100%') |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
199 self._right.setHeight('100%') |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
200 self.add(self._left) |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
201 self.setCellWidth(self._left, "15%") |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
202 self.add(self._right) |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
203 self.setCellWidth(self._right, "85%") |
0 | 204 |
4
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
205 def changePanel(self, idx, panel): |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
206 print "panel:",panel |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
207 print "idx:",idx |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
208 self._right.setWidget(0,idx,panel) |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
209 |
0 | 210 class MainPanel(VerticalPanel): |
211 | |
1 | 212 def __init__(self, host): |
213 self.host=host | |
0 | 214 VerticalPanel.__init__(self) |
215 | |
216 self.setHorizontalAlignment(HasAlignment.ALIGN_LEFT) | |
217 self.setVerticalAlignment(HasAlignment.ALIGN_TOP) | |
218 | |
219 menu = Menu() | |
1 | 220 magic_box = host.magicBox |
4
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
221 self.middle_panel = MiddlePannel(self.host) |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
222 self.middle_panel.setWidth('100%') |
0 | 223 |
224 self.add(menu) | |
225 self.add(magic_box) | |
4
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
226 self.add(self.middle_panel) |
0 | 227 |
228 self.setCellHeight(menu, "5%") | |
229 self.setCellHeight(magic_box, "5%") | |
230 self.setCellVerticalAlignment(magic_box, HasAlignment.ALIGN_CENTER) | |
231 self.setCellHorizontalAlignment(magic_box, HasAlignment.ALIGN_CENTER) | |
4
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
232 self.setCellHeight(self.middle_panel, "90%") |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
233 self.setCellWidth(self.middle_panel, "100%") |
0 | 234 |
235 self.setWidth("100%") | |
236 self.setHeight("100%") | |
237 | |
238 class SatWebFrontend: | |
239 def onModuleLoad(self): | |
1 | 240 self.magicBox = MagicBox() |
241 self.contactPanel = ContactPanel(self) | |
242 self.panel = MainPanel(self) | |
4
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
243 self.middle_panel = self.panel.middle_panel |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
244 self.mpanels = [MicroblogPanel()] |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
245 self.middle_panel.changePanel(1,self.mpanels[0]) |
0 | 246 self._dialog = None |
247 RootPanel().add(self.panel) | |
248 self._register = RegisterCall() | |
1 | 249 self._register.call('isRegistered',self._isRegisteredCB) |
0 | 250 |
1 | 251 def _isRegisteredCB(self, registered): |
0 | 252 if not registered: |
253 self._dialog = RegisterBox(self.logged,centered=True) | |
254 self._dialog.show() | |
255 else: | |
1 | 256 self._register.call('isConnected', self._isConnectedCB) |
0 | 257 |
1 | 258 def _isConnectedCB(self, connected): |
0 | 259 if not connected: |
260 self._register.call('connect',self.logged) | |
261 else: | |
262 self.logged() | |
263 | |
264 def logged(self): | |
265 if self._dialog: | |
266 self._dialog.hide() | |
267 del self._dialog # don't work if self._dialog is None | |
1 | 268 |
269 #it's time to fill the page | |
2
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
270 bridge = BridgeCall() |
1 | 271 bridge.call('getContacts', self._getContactsCB) |
272 | |
2
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
273 bridge_signals = BridgeSignals() |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
274 bridge_signals.call('getSignals', self._getSignalsCB) |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
275 |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
276 |
1 | 277 def _getContactsCB(self, contacts_data): |
278 for contact in contacts_data: | |
279 jid, attributes, groups = contact | |
280 self.contactPanel.addContact(jid, attributes, groups) | |
0 | 281 |
2
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
282 def _getSignalsCB(self, signal_data): |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
283 bridge_signals = BridgeSignals() |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
284 bridge_signals.call('getSignals', self._getSignalsCB) |
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
285 print('Got signal ==> name: %s, params: %s' % (signal_data[0],signal_data[1])) |
4
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
286 name,args = signal_data |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
287 if name == 'personalEvent': |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
288 self._personalEventCb(*args) |
2
669c531a857e
signals handling and first draft of microblogging
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
289 |
4
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
290 ## Signals callbacks ## |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
291 |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
292 def _personalEventCb(self, sender, event_type, data, profile): |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
293 if event_type == "MICROBLOG": |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
294 if not data.has_key('content'): |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
295 print ("WARNING: No content found in microblog data") |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
296 return |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
297 for panel in self.mpanels: |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
298 if isinstance(panel,MicroblogPanel): |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
299 content = data['content'] |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
300 author = data.get('author') |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
301 print "timestamp: %s" % data.get('timestamp') |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
302 timestamp = float(data.get('timestamp'),0) #XXX: int doesn't work here |
7325e787c22b
personalEvent management signal first draft, microblogs are now put in a central grid
Goffi <goffi@goffi.org>
parents:
2
diff
changeset
|
303 panel.addEntry(content, author, timestamp) |
0 | 304 |
305 if __name__ == '__main__': | |
1 | 306 pyjd.setup("http://localhost:8080/libervia.html") |
0 | 307 app = SatWebFrontend() |
308 app.onModuleLoad() | |
309 pyjd.run() | |
310 |