I'm back + PyCon demo source code

108 views
Skip to first unread message

Matt Chaput

unread,
Apr 11, 2013, 4:20:38 PM4/11/13
to who...@googlegroups.com
Hi all,

Well, I've finally got time to work on Whoosh again. I'm going to focus
on catching up with bugs and pull requests this weekend and make a 2.5
bug-fix release before trying finish and release Whoosh 3.0.

First, here's the source code for the demo application I showed at my
PyCon 2013 talk:

https://bitbucket.org/mchaput/whoosh-demo/

This is pretty quick-and-dirty code since I wrote it in a few hours the
day of the presentation!

The demo has a few issues right now:

* The code is undocumented/uncommented and hacky so it's not very useful
for education right now.

* It requires a Flask plugin to integrate Mako templates with Flask. You
can get the plugin here:

https://github.com/tzellman/flask-mako/

(There is a different flask-mako plugin in PyPI but that one doesn't work!)

* The "grouping" part of the demo just displays a dictionary of docnums
because I didn't have time to finish that part.

I'm going to try to come back to this code and make it more useful, but
in the meantime if anyone wants to try to fix it up be my guest :)

Cheers,

Matt

Thomas Waldmann

unread,
Apr 13, 2013, 8:42:34 AM4/13/13
to who...@googlegroups.com
I liked the demo from pycon (I wasn't there but watched the video), thanks for publishing the code!

I'll have a look at it and will see if I can improve it and maybe switch it to flask/jinja2.

Was there a special reason why you used mako instead of jinja2?

Matt Chaput

unread,
Apr 14, 2013, 5:57:01 PM4/14/13
to who...@googlegroups.com
On 2013-04-13, at 8:42 AM, Thomas Waldmann <thomas.j...@gmail.com> wrote:
> Was there a special reason why you used mako instead of jinja2?

I was madly trying to code up the demo the day of the talk and used Mako because I'm more familiar with it and it allows code in the template -- I don't like using Jinja/Django because there's so much friction trying to get around their restrictions.

Obviously if someone can convert it to use Jinja it would be much better because that's what Flask ships with :)

Thanks!

Matt

Errol Casey

unread,
Jul 3, 2014, 10:00:54 AM7/3/14
to who...@googlegroups.com
I recently got this to work in a linux vm, but now want to migrate it to a Solaris environment with python 3.4.1

I'm running into an issue where an except statement is throwing a syntax error


Traceback (most recent call last):
  File "./present.py", line 4, in <module>
    from flaskext.mako import render_template, init_mako
  File "/syshome/gecasey/virt2/lib/python3.4/site-packages/Flask_Mako-0.1-py3.4.egg/flaskext/mako.py", line 51
    except (AttributeError), e:
                           ^


I also tried, moving to the latest flask-mako against your suggestions and got present.py to actually start with a few minor
code changes; but then it tracebacks with Template error. So I'm trying to fall back to the older flask-mako as you
indicated to use but cannot get past this error.

Appreciate any suggestions.

I'm using python 3.4.1

astroid (1.1.1)
CherryPy (3.3.0)
Flask (0.10.1)
Flask-Mako (0.1)
itsdangerous (0.24)
Jinja2 (2.7.3)
logilab-common (0.61.0)
Mako (1.0.0)
MarkupSafe (0.23)
pip (1.5.6)
pylint (1.2.1)
setuptools (5.3)
Werkzeug (0.9.6)
Whoosh (2.6.0)
Reply all
Reply to author
Forward
0 new messages