Merge lp:~terrycojones/tickery/work-with-pyjamas-0.7 into lp:tickery

Proposed by Terry Jones
Status: Merged
Approved by: Terry Jones
Approved revision: 13
Merge reported by: Terry Jones
Merged at revision: not available
Proposed branch: lp:~terrycojones/tickery/work-with-pyjamas-0.7
Merge into: lp:tickery
Diff against target: 354 lines (+70/-110)
11 files modified
.bzrignore (+4/-0)
Makefile (+9/-7)
README (+13/-12)
doc/running.rst (+19/-38)
fabfile.py (+22/-7)
requirements.txt (+0/-1)
tickery/Makefile (+0/-13)
tickery/admin/Makefile (+0/-14)
tickery/www/Makefile (+0/-12)
tickery/www/login.py (+1/-2)
tickery/www/tickerytab.py (+2/-4)
To merge this branch: bzr merge lp:~terrycojones/tickery/work-with-pyjamas-0.7
Reviewer Review Type Date Requested Status
Terry Jones Approve
Review via email: mp+64924@code.launchpad.net

Description of the change

Lots of small changes to make the code work with
Pyjamas 0.7 which it now (maybe) does. Things seem
to run ok, with very limited testing. There was one
show-stopper bug which I tracked down the hard way.

To post a comment you must log in.
Revision history for this message
Terry Jones (terrycojones) wrote :

I claim this review and I fully approve.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2011-06-16 17:14:49 +0000
3+++ .bzrignore 2011-06-17 00:27:27 +0000
4@@ -2,5 +2,9 @@
5 tickery/twistd.log
6 tickery/twistd.pid
7 tickery/admin/output/
8+tickery/admin/*.js
9 tickery/www/output/
10+tickery/www/*.js
11 twisted/plugins/dropin.cache
12+pyjamas
13+distribute-*.tar.gz
14
15=== modified file 'Makefile'
16--- Makefile 2011-06-14 20:36:36 +0000
17+++ Makefile 2011-06-17 00:27:27 +0000
18@@ -1,24 +1,26 @@
19 .PHONY: all clobber wc dist pep8 pyflakes lint
20
21 all:
22- $(MAKE) -C tickery/www $@
23- $(MAKE) -C tickery/admin $@
24+ fab build_pyjs
25+
26+debub:
27+ fab build_pyjs_debug
28
29 clean:
30 rm -fr tickery/test/_trial_temp MANIFEST dist
31 find . -name '*~' -o -name '*.pyc' -print0 | xargs -0 -r rm
32- $(MAKE) -C tickery/www $@
33- $(MAKE) -C tickery/admin $@
34+ rm -fr tickery/www/output tickery/www/*.js
35+ rm -fr tickery/admin/output tickery/admin/*.js
36 $(MAKE) -C doc $@
37
38 wc:
39- find . -name '*.py' -print0 | xargs -0 wc -l
40+ find tickery -name '*.py' -print0 | xargs -0 wc -l
41
42 pep8:
43- find . -name '*.py' -print0 | xargs -0 -n 1 pep8 --repeat
44+ find tickery -name '*.py' -print0 | xargs -0 -n 1 pep8 --repeat
45
46 pyflakes:
47- find . -name '*.py' -print0 | xargs -0 pyflakes
48+ find tickery -name '*.py' -print0 | xargs -0 pyflakes
49
50 lint: pep8 pyflakes
51
52
53=== modified file 'README'
54--- README 2011-06-16 17:37:48 +0000
55+++ README 2011-06-17 00:27:27 +0000
56@@ -6,8 +6,9 @@
57 http://tickery.net
58
59 Tickery provides a fun way to explore sets of Twitter friends. There's much
60-more to the story however, as its underlying data is stored in Fluidinfo. This
61-means it can be added to by anyone (i.e., you!), and searched on in any way.
62+more to the story however, as its underlying data is stored in Fluidinfo.
63+This means it can be added to by anyone (i.e., you!), and searched on in
64+any way.
65
66 We've open-sourced Tickery to help programmers see the insides of a
67 substantial application written to use Fluidinfo. Although the Tickery
68@@ -29,20 +30,20 @@
69 Running Tickery
70 ---------------
71
72-You'll find instructions on how to run your own version of Tickery in the doc
73-directory. If you have Sphinx (http://sphinx.pocoo.org) installed, you can
74-build the documentation by running 'make' in the doc dir and then looking at
75-doc/_build/html/index.html in your browser. If you don't have Sphinx
76-installed and don't want to install it, just look directly at the doc/*.rst
77-files.
78+You'll find instructions on how to run your own version of Tickery in the
79+doc directory. If you have Sphinx (http://sphinx.pocoo.org) installed, you
80+can build the documentation by running 'make' in the doc dir and then
81+looking at doc/_build/html/index.html in your browser. If you don't have
82+Sphinx installed and don't want to install it, just look directly at the
83+doc/*.rst files.
84
85 Questions?
86 ----------
87
88-For discussion of Tickery, we suggest you join the Fluidinfo users mailing list
89-at http://groups.google.com/group/fluiddb-users or join us in #fluidinfo on
90-irc.freenode.net Please say hi, we're very interested in helping people to
91-understand both Tickery and Fluidinfo.
92+For discussion of Tickery, we suggest you join the Fluidinfo users mailing
93+list at http://groups.google.com/group/fluiddb-users or join us in
94+#fluidinfo on irc.freenode.net Please say hi, we're very interested in
95+helping people to understand both Tickery and Fluidinfo.
96
97
98 Happy hacking!
99
100=== modified file 'doc/running.rst'
101--- doc/running.rst 2011-06-16 17:37:48 +0000
102+++ doc/running.rst 2011-06-17 00:27:27 +0000
103@@ -19,8 +19,8 @@
104 which is described below. These steps are required because we want to
105 continue running our own version of Tickery while wanting you to be able to
106 play with the source code and to deploy your own version of Tickery,
107-without the possibility that you accidentally disrupt the version
108-we have at http://tickery.net
109+without the possibility that you accidentally disrupt the version we have
110+at http://tickery.net
111
112
113 Prerequisites
114@@ -30,13 +30,10 @@
115 Tickery.
116
117 * Python (we use version 2.5.2 in production).
118-* `Twisted <http://twistedmatrix.com>`_ (we use version 8.2 in production).
119-* `Pyjamas <http://pyjs.org/>`_ (we run http://tickery.net against version 2389 of Pyjamas, which is quite old).
120-* `txFluidDB <https://launchpad.net/txfluiddb>`_ (trunk).
121-* `txRDQ <https://launchpad.net/txrdq>`_ (trunk).
122-* `txJSON-RPC <https://launchpad.net/txjsonrpc>`_ (we are using a slightly modified version of txJSON-RPC, available from http://jon.es/other/txJSON-RPC-fluidinfo.tar.gz We'll fix this soon!)
123 * `Ply <http://www.dabeaz.com/ply/>`_.
124 * `Sphinx <http://sphinx.pocoo.org/>`_ (to build this documentation)
125+* `Virtualenv <http://pypi.python.org/pypi/virtualenv>`_.
126+* `Fabric <http://fabfile.org>`_.
127
128 One-time Fluidinfo setup
129 ------------------------
130@@ -72,28 +69,23 @@
131
132 Note that the above assume you're using ``bash`` as a shell.
133
134-One-time PYTHONPATH setup
135+One-time virtualenv setup
136 -------------------------
137
138-You'll need the top-level Tickery source directory (which contains a
139-directory called ``twisted``) in your Python path. The simplest way to do
140-that is to add it to your PYTHONPATH environment variable. If you have
141-things set up correctly, you should then be able to run
142+Create a virtualenv to run Tickery inside of, and install the
143+requirements.
144
145 .. code-block:: sh
146
147- $ twisted tickery --help
148-
149-and see command line options for Tickery. Note: if you cannot run this
150-command without error, you will not be able to run Tickery until you
151-resolve the issue.
152+ $ virtualenv tickery-env
153+ $ . tickery-env/bin/activate
154+ $ pip install -r requirements.txt
155
156 Building Tickery's HTML and Javascript via Pyjamas
157 --------------------------------------------------
158
159-If you've installed `Pyjamas <http://pyjs.org/>`_ correctly, you'll have
160-``pyjsbuild`` on your shell's PATH, and you should be able to type ``make``
161-at the top level of your ``tickery`` source tree to have the Javascript
162+If you've installed things correctly you should be able to type ``make`` at
163+the top level of your ``tickery`` source tree to have the Javascript
164 built. If this is successful, you'll see terminal output such as the
165 following:
166
167@@ -101,23 +93,11 @@
168 .. code-block:: sh
169
170 $ make
171- make -C tickery/www all
172- make[1]: Entering directory `/opt/tickery/trunk/tickery/www'
173- pyjsbuild -O index.py
174- Building: index
175- PYJSPATH: ['/opt/tickery/trunk/tickery/www', '/home/terry/s/net/pyjamas/trunk/library', '/home/terry/s/net/pyjamas/trunk/addons']
176- Built to : /opt/tickery/trunk/tickery/www/output
177- make[1]: Leaving directory `/opt/tickery/trunk/tickery/www'
178- make -C tickery/admin all
179- make[1]: Entering directory `/opt/tickery/trunk/tickery/admin'
180- pyjsbuild -O index.py
181- Building: index
182- PYJSPATH: ['/opt/tickery/trunk/tickery/admin', '/home/terry/s/net/pyjamas/trunk/library', '/home/terry/s/net/pyjamas/trunk/addons']
183- Built to : /opt/tickery/trunk/tickery/admin/output
184- make[1]: Leaving directory `/opt/tickery/trunk/tickery/admin'
185+ fab build_pyjs
186+ [localhost] run: cd tickery/www && ../../pyjamas/bin/pyjsbuild index.py
187+ [localhost] run: cd tickery/admin && ../../pyjamas/bin/pyjsbuild index.py
188
189-You'll see lots of ``.html`` and ``.js`` files have been created in
190-both ``tickery/www/output`` and ``tickery/admin/output``
191+ Done.
192
193 To build a debug version of Tickery, use ``make debug`` instead. Note: The
194 debug version is about 4 times larger than the non-debug one.
195@@ -133,11 +113,12 @@
196 .. code-block:: sh
197
198 $ cd tickery
199- $ twistd -n tickery
200+ $ PYTHONPATH=.. twistd -n tickery
201
202 Note that you have to be in the ``tickery`` directory when you run the
203 ``twistd`` command. The ``twistd`` server expects to find a ``www/output``
204-directory to serve files from.
205+directory to serve files from. The PYTHONPATH=.. is needed so that Twisted
206+can find its plugins.
207
208 There are various options you can use, add ``--help`` to the ``twistd``
209 command above to list them. An important one is ``--cache-dir`` (which
210
211=== modified file 'fabfile.py'
212--- fabfile.py 2011-06-16 17:37:48 +0000
213+++ fabfile.py 2011-06-17 00:27:27 +0000
214@@ -30,17 +30,32 @@
215 env.path = '%s-%s' % (env.sitename, RELEASE)
216
217
218+def install_pyjs():
219+ """
220+ Download and configure Pyjamas.
221+ """
222+ local('git clone git://pyjs.org/git/pyjamas.git')
223+ local('cd pyjamas && /usr/bin/env python bootstrap.py')
224+
225+
226 def build_pyjs():
227 """
228 Generate HTML and Javascript from Pyjamas.
229 """
230- pyjs_rev = 2389
231- pyjs_url = 'https://pyjamas.svn.sourceforge.net/svnroot/pyjamas/trunk'
232-
233- local('svn co --force -r %d %s pyjamas' % (pyjs_rev, pyjs_url))
234- local('cd pyjamas && /usr/bin/env python bootstrap.py')
235- local('cd tickery/www && ../../pyjamas/bin/pyjsbuild -O index.py')
236- local('cd tickery/admin && ../../pyjamas/bin/pyjsbuild -O index.py')
237+ local('cd tickery/www && ../../pyjamas/bin/pyjsbuild index.py')
238+ local('cd tickery/admin && ../../pyjamas/bin/pyjsbuild index.py')
239+
240+
241+def build_pyjs_debug():
242+ """
243+ Generate a debugging version of the HTML and Javascript from Pyjamas.
244+ """
245+ local('cd tickery/www && ../../pyjamas/bin/pyjsbuild '
246+ '--strict --print-statements --debug --debug-wrap -o output '
247+ 'index.py')
248+ local('cd tickery/admin && ../../pyjamas/bin/pyjsbuild '
249+ '--strict --print-statements --debug --debug-wrap -o output '
250+ 'index.py')
251
252
253 def upload_tickery():
254
255=== modified file 'requirements.txt'
256--- requirements.txt 2011-06-16 17:12:50 +0000
257+++ requirements.txt 2011-06-17 00:27:27 +0000
258@@ -1,4 +1,3 @@
259 bzr+http://bazaar.launchpad.net/~terrycojones/txrdq/trunk#egg=txRDQ
260 bzr+http://bazaar.launchpad.net/~txfluiddb-maint/txfluiddb/trunk#egg=txFluidDB
261 http://jon.es/other/txJSON-RPC-fluidinfo.tar.gz#egg=txJSON-RPC
262-#-e svn+https://pyjamas.svn.sourceforge.net/svnroot/pyjamas/trunk/pyjs@2389#egg=pyjamas
263
264=== removed file 'tickery/Makefile'
265--- tickery/Makefile 2011-06-14 20:49:53 +0000
266+++ tickery/Makefile 1970-01-01 00:00:00 +0000
267@@ -1,13 +0,0 @@
268-.PHONY: all debug check clean
269-
270-all:
271- $(MAKE) -C www $@
272- $(MAKE) -C admin $@
273-
274-debug:
275- $(MAKE) -C www $@
276- $(MAKE) -C admin $@
277-
278-clean:
279- $(MAKE) -C www $@
280- $(MAKE) -C admin $@
281
282=== removed file 'tickery/admin/Makefile'
283--- tickery/admin/Makefile 2011-06-14 20:49:53 +0000
284+++ tickery/admin/Makefile 1970-01-01 00:00:00 +0000
285@@ -1,14 +0,0 @@
286-.PHONY: all debug index check clean
287-
288-all: index
289-
290-debug: index-debug
291-
292-index:
293- pyjsbuild -O index.py
294-
295-index-debug:
296- pyjsbuild -d --strict --print-statements index.py
297-
298-clean:
299- rm -fr output
300
301=== removed file 'tickery/www/Makefile'
302--- tickery/www/Makefile 2011-06-14 20:49:53 +0000
303+++ tickery/www/Makefile 1970-01-01 00:00:00 +0000
304@@ -1,12 +0,0 @@
305-.PHONY: all debug index check clean
306-
307-all: index
308-
309-index:
310- pyjsbuild -O index.py
311-
312-debug:
313- pyjsbuild -d --strict --print-statements index.py
314-
315-clean:
316- rm -fr output
317
318=== modified file 'tickery/www/login.py'
319--- tickery/www/login.py 2011-06-16 16:10:07 +0000
320+++ tickery/www/login.py 2011-06-17 00:27:27 +0000
321@@ -60,8 +60,7 @@
322
323 class LoginPanel(Grid):
324 def __init__(self):
325- Grid.__init__(self, 1, 2, StyleName='login-panel',
326- HorizontalAlignment=HasAlignment.ALIGN_RIGHT)
327+ Grid.__init__(self, 1, 2, StyleName='login-panel')
328 self.setCellPadding(0)
329 self.setCellSpacing(0)
330 formatter = self.getCellFormatter()
331
332=== modified file 'tickery/www/tickerytab.py'
333--- tickery/www/tickerytab.py 2011-06-16 17:37:48 +0000
334+++ tickery/www/tickerytab.py 2011-06-17 00:27:27 +0000
335@@ -84,8 +84,7 @@
336 StyleName='tickery-tab',
337 **kwargs)
338 self.topPanel = topPanel # don't add this yet!
339- self.topGrid = Grid(1, 2, StyleName='tickery-tab-top-grid',
340- HorizontalAlignment=HasAlignment.ALIGN_LEFT)
341+ self.topGrid = Grid(1, 2, StyleName='tickery-tab-top-grid')
342 self.add(self.topGrid)
343 self.autoActivate = False
344
345@@ -148,8 +147,7 @@
346 StyleName='large-query-area')
347 self.checkResult = HorizontalPanel(Spacing=4)
348
349- mainGrid = Grid(2, 2, StyleName='tickery-tab-panel',
350- HorizontalAlignment=HasAlignment.ALIGN_LEFT)
351+ mainGrid = Grid(2, 2, StyleName='tickery-tab-panel')
352 formatter = mainGrid.getCellFormatter()
353 mainGrid.setWidget(0, 0, help)
354 mainGrid.setWidget(1, 0, self.query)

Subscribers

People subscribed via source and target branches

to all changes: