frank's blog

Thoughts on bundling pysqlite in Python 2.5

I was really surprised when reading through the changes for the upcoming Python 2.5 release to discover that pysqlite will now be included in the standard library. If you aren't familiar with it, pysqlite provides an interface to SQLite which is an embedded SQL library. I use pysqlite all the time, so I found this really interesting.

Some immediate positive things I see about this:

  1. One less dependency that end-users have to care about.
  2. One less package to install on my development machines.
  3. Inclusion in the standard library (tends to) indicate that the code has been more rigorously reviewed for correctness and adherance to Python standards.

pyconfig.py updated for Python 2.5-alpha1

The first alpha release of Python 2.5 appeared on python.org Wednesday. Using Andrew Kuchling's "What's New In Python 2.5" document as a starting point, I updated pyconfig to test for the new features. (pyconfig is discussed in detail in The Python Tourist #5).

MYOML #8: Smoothing things out with PHP

The markup language is complete, but there are a few nice touches left to add. One is to make the articles compatible with non-XSLT capable browsers. Another is to add some preprocessing of <code> sections so that you (shouldn't have to) touch them up manually.

Issue #8: Smoothing things out with PHP

MYOML #7: Adding the final few tags

Agh, RealLife(tm) intruded on my writing progress for a while there, but I should be back on track for a bit at least.

This installment of Make Your Own Markup Language finalizes (for now at least) the design and adds the final tags. All that's left after this is to do a little polishing.

MYOML Issue #7: Adding the final few tags

Syncing jEdit settings between machines

As I've mentioned before, I've switched to jEdit from XEmacs. I use both WinXP and Linux, and one thing that was nice about using XEmacs was that it was easy to sync my settings between machines. All I had to do was worry about two files: init.el and custom.el. Both were portable, and could be copied directly between machines.

With jEdit, though, there is an entire tree of settings. These settings live under either ~/.jedit/ on POSIX machines, or under "Documents and Settings/USERNAME/.jedit" on a Windows machine. On my Linux machine, for example, there are 104 files under ~/.jedit. It certainly appears that it will be a huge task to sync between machines. There is a "HOWTO" page, but all it really tells you is how hard it is to do. Its more discouraging than helpful, I think.

MYOML #6: Metainfo, notes, warnings, and more HTML tags

As I get further into this series, the example template is diverging more and more from the "official" boodebr.org template, as I learn more and make improvements. This is making me antsy to go ahead and get finished with MYOML so I can start using the improved template on the whole site.

This time around I'm going to restructure the root template to add metainfo to the article. The metainfo is used to create the overall page layout, but can also be useful in if I ever want to create an article index. A script will be able to easily pull the metainfo from the article to create a database, etc.

I'm also going to add some 'note' and 'warning' boxes for highlighting important details, and add a few more HTML tags.

Issue #6: Metainfo, notes, warnings, and more HTML tags

MYOML #5: Attributes, titles, and other blocks.

So far so good, but the layout (although functional) is still pretty bland. Time to add a title= attribute to the <section> and <code> blocks, implement inline code samples, and see how to add some standard HTML tags to our markup language.

Issue #5: Attributes, titles, and other blocks.

The Python Tourist: Replacing sys.version_info with pyconfig

Gnosis_Utils is a package that (tries at least) to be compatible with everything from Python 1.5 and up. Of course, this isn't always possible, but it tries. Smile While working on xml.pickle, I found myself repeatedly using hardcoded version checks like "if sys.version_info[1] >= 2", etc. When refactoring some code that had those types of checks in it, I ran into difficulty because the version check told me nothing about what capability was actually required.

MYOML #4: Creating the Outline

Finally, it's time to start writing some XSLT and putting an actual article together. In this installment of Make Your Own Markup Language the basic XML document structure is created. Once this is in place, we'll be able to freely tweak the individual sections to get the desired result.

Issue #4: Creating the Outline

The Python Tourist: None, empty, and nothing.

Coming from a C background to Python, I made the assumption that Python's None value was to be used much like a NULL pointer in C. Based on this assumption, I happily coded away using patterns like "if not function()", much like you would say "if !fgets(...)" in C. Only after running into some non-obvious bugs did the wisdom of "always explicitly test for None" become clearer to me.

Issue #4: None, empty and nothing.

Syndicate content