Category archives: Snaking

Discussions of programming, particularly of programming Python

RSS feed of Snaking

Getting the old OpenGL.Tk module working again...

Had a user complain that we don't have Togl support any more (again).  It's another one of those "blah" tasks that I really feel ambivalent about.  I've long since completely given up on Tkinter, particularly since it's no longer installed by default on any reasonable Linux distributions.  However, Togl, while still not (AFAICS) packaged for ...

Continue reading

Any Win64 PyOpenGL devs?

I don't really use Windows.  I have a Vista partition on my laptop that I use for compiling and releasing projects, but it's a 32-bit image.  I honestly don't care enough about Win64 to buy a copy, but there are obviously people who do want to run PyOpenGL on it.  So, any Win64 developers feel ...

Continue reading

TurboGears "offline" processes (crons, command-line commands, etc)

TurboGears uses the Paste commands system to create command-line entry points that, for example, set up your database or start your server.  When you get to larger projects, however, you will often have other things you need to do "in the context of your application" from the command line, such as periodic imports of data, ...

Continue reading

OpenID Support in a TG2 Application

Spent most of the day playing with TurboGears Authentication/Authorization system.  In particular, I stripped out the "quickstart" configuration and created a "who.ini" based almost-equivalent.  With that, I added an OpenID provider using a repoze plugin... at the end of all that, I can log into my localhost quickstart application with a myopenid.com login.  I've documented ...

Continue reading

PostgreSQL/SQLAlchemy/TurboGears search

PostgreSQL 8.3+ has integrated the old tsearch2 plugin into the distribution.  This lets you do very formal "stemmed" textual queries on a body of text (set of columns in a table).  For instance, imagine we have a table "version_text" that stores all of the text in our version control system in the "text" column.  We ...

Continue reading

Brian's Brain as a brain-teaser...

Was just playing around with implementing "Brian's Brain" in Numpy/Pygame it's a "life" style automata where there are just 3 rules:

  • if cell is dying, cell dies
  • if cell is alive, cell starts dying
  • if cell is dead and > 2 neighbours are on, cell becomes alive

there was a post about doing this in ...

Continue reading

TurboGears Doc Sprint

Spent almost the whole day today on the TurboGears 2.x documentation sprint.  I wound up just wading in and focusing on bringing a single document "up to spec" as it were.  I have an itch to sit down and try to restructure the whole hive of documents.

Along the way had to learn the basics ...

Continue reading

ToscaWidgets JQuery and TinyMCE (Tutorialish-ly)

So you've browsed the ToscaWidgets web-site and know that there's a JQuery Plugin and a TinyMCE (Rich-text-editor control) plugin... now how the heck do you use them?  Not a lot of documentation for these two pieces, so I've tried to cobble together a minimal example.  Fair warning, I'm piecing this together basically without any documentation ...

Continue reading

ToscaWidgets JQuery and Flot Plotting (Tutorialish-ly)

Continuing on from our previous tutorial, here's a quick example showing how to create a Flot plotting library plot using tw.jquery's FlotWidget class.  In our root.py controller module, we'll import the widget and some support functions:

from tw.jquery import FlotWidget
from math import sin,cos
import simplejson

The FlotWidget is part of the core tw.jquery support, ...

Continue reading

Wrapping JQuery plugins for ToscaWidgets/TurboGears

Continuing my explorations of JQuery + TurboGears today, I started working on a simple RTE-light wrapper widget.  RTE-light is an extremely small, simple analogue to TinyMCE, so I figured it would be easy to set it up with the tw.tinymce project as reference.

There's a paster script to auto-start a widget project, so that went ...

Continue reading