Dev (old posts, page 12)

Comments and templates in PyBlosxom

, | Tweet this

A while back, I adjusted the comments plugin locally so that it would allow me to have plugins that change the template type they use from "story" to other things. A couple of months ago, I sent Ted an email with which pieces go in which templates. Figured I'd stick that here in case someone is looking for it.

This is only for the "story" section. The head template goes before and the foot template goes after this example. This also only works with the latest version of the comments plugin that has the template stomping code removed.

<div class="news">           <- story.html
<h2>$title</h2>               |
<div class="content">         |
...                           |
</div>                        |
links                         |
</div>                       <-
<div class="comments">       <- comment-story.html
<div class="comment">        <- comment.html
Posted by $blah at $blah      |
$blah                         |
</div>                       <-
<div class="comment">        <- comment.html
Posted by $blah at $blah      |
$blah                         |
</div>                       <-
<div class="commentform">    <- comment-form.html
form stuff here.              |
</div>                        |
</div>                       <-

PyBlosxom status 1-12-2004

, | Tweet this

I finally got around to releasing PyBlosxom 1.1. The big change is that I'm only planning to work on and maintain the core--I'm hoping someone will come along and pick up maintenance for all the contributed plugins. I haven't figured out what the contingency plan will be. I might maintain that too, but whine about it very loudly until someone gets tired of me whining. I'm also slowly getting through working on the documentation. I noticed that the wiki that I'm basing a portion of my documentation on disappears every now and then. So... I'm thinking that's a good sign that I should finish up quickly.

George called me up and offered to take Planet PyBlosxom off my hands. I want to pass off all the little things to other people in the PyBlosxom community so that:

  1. I have more time to focus on PyBlosxom core
  2. Other people are involved in the community--more people -> more ideas -> better community
  3. Minimize the significance of me in the PyBlosxom world

In the meantime, I'm working on finishing reading Dive Into Python. It's one of those books I wished I had read years ago. I got a hard-copy from my parents for Christmas. I've put a halt on coding until I'm done.

Update January 11, 2016: Updated the dive into python link.

RSS Problems

, | Tweet this

I was checking my apache logs and noticed there are dozens of feed readers pulling my RSS data. They're not pulling index.xml--which is the RSS 2.0 nicely-rendered data, but rather the RSS 0.9.1 flavour that comes by default with PyBlosxom.

The problems with this are two-fold. First, I don't have num_entries set in So every time someone requests the RSS 0.9.1 feed, they get all of my entries. It's around 340K or so. I'm amazed no one ever complained about this. If they had, I would have told them to get the other feed--the one I advertise--instead.

The second problem is that I didn't have the conditionalhttp plugin running. So every time someone requested the RSS 0.9.1 feed, they get all my entries--even if I haven't added any new ones since the last time they requested it.

I couldn't adjust the num_entries property in my file, though, because it would mess up my paging plugin. So I tossed things around a bit and decided to add this code to my file:

import os
query_string = os.environ.get("QUERY_STRING", "")
if query_string.find("flav=rss") != -1:
   py['num_entries'] = 20

This code checks to see if someone is grabbing the RSS flavour of my blog which is my unadvertised-I-wish-no-one-would-request-it RSS 0.9.1 feed and set the num_entries property to 20. Otherwise, it doesn't get set.

Then I tossed in the conditionalhttp plugin which does the whole last-modified thing further reducing the amount of bandwidth I'm burning away pointlessly.


, | Tweet this

screen is trippy. My friend says this is what you need to know about screen:

  1. $ screen
  2. $ (launch something)
  3. ctrl-a ctrl-d
  4. $ (do something else)
  5. $ screen -x

JDEE and Ant

, | Tweet this

I've got JDEE 2.3.4 and Apache Ant 1.5. The problem I was having was that I'd get this error message whenever I tried to do C-c C-v C-b (i.e. build my project using ant):

  ant -buildfile 'c:/Tools/src/spiderutil/build.xml' -emacs
  Buildfile: 'c:\Tools\src\spiderutil\build.xml' does not exist!
  Build failed

  Compilation finished at Tue Dec 07 11:22:24

Anyhow, after some poking around, I discovered this post ( which helped me fix my issue. I went into jde-ant.el and removed two instances of "delimiter" and now everything works super duper.

Jumped to Emacs

, | Tweet this

I did a third attempt to get Eclipse working and I got it mostly working but it didn't jive with our codebase very well and it takes GOBS and GOBS of memory.

I decided NetBeans took up too much memory as well (200MB at various points depending on what I was doing) and I kept bumping into weird NullPointerExceptions in the IDE itself. If I had more time, I'd spend more time: a) fleshing them out, b) providing bug reports. But the issues were too sporadic and it was taking too much time to come up to speed to the point where I could use it all the time. And the VSS plugin was kind of flakey and made me nervous.

I uninstalled both NetBeans and Eclipse and installed Emacs. I stuck Viper mode at 2 and after reading documentation for a bit, I finally made some connections I didn't make the last time around with Emacs and I've been working with it most of today and part of yesterday without any issues.

Helpful Emacs links:


, | Tweet this

At work my dev environment consists of bash, vim, ant, jdk 1.3, vss, and a couple dozen bash aliases, bash scripts and python scripts. I spend most of the day in and out of vim sessions debugging various things.

Every 6 months or so I try to switch to Emacs full-time, but I need all the pieces to be there in order to switch and I don't have a lot of time at work to figure it out, practice and get used to a new dev environment. Thus for the last 3-4 years, I've been hanging onto vim, bash, ant, jdk 1.3, vss and tweaking my scripts to make the process as smooth as possible. There are parts that work really well and parts that suck. Debugging sucks.

I figured I'd check out Eclipse and Netbeans. I spent 30 minutes trying to figure out how to download Eclipse and set it up on Windows XP and got no where. I'm not really sure how so many people can use it--it's really difficult to get started. I spent an hour trying to get Netbeans to work with jdk 1.4.2 while compiling our stuff with jdk 1.3 and without stomping on the version of Java that runs applets in Internet Explorer. That sucked and could have been a _lot_ easier.

After that, Netbeans seems to work pretty well. I'm running 4.0 beta 2. I bump into NullPointerExceptions regularly, but Netbeans seems to recover from them pretty well without me having to restart. It's decent. I fixed my first bug today with the "new dev environment". It's already faster to iterate between the steps of the analyze, fix, test cycle than it was before. I've also caught a few bugs I didn't know about which have been there for a long time all quiet and hidden away.

I still want to switch to Emacs, but it'll have to wait until I have more free time to make it work.

Bill Mill, pyblosxom 1.1, sourceforge, et al

, | Tweet this

I gave Bill Mill CVS checkin permissions the other day. He's interested in working on the static rendering and the problems of storing metadata. The former (static rendering), I'm psyched to pass off to someone who will work on it and fix the various issues it has. At a bare minimum, I'm psyched to pass it off to someone who wants to think about it.

The latter (metadata) is something we need to figure out how to deal with and soonish. The pyblosxom-users and pyblosxom-devel mailing lists have had several people pop up with their own ideas about what constitutes metadata, where it should be stored, how it should be stored, and how to access it. But few, if any, of the proposals seem to be in-line with the PyBlosxom mission. Though maybe it's not clear what the mission is. That's a topic for another entry.

Bottom line is that I'm going to hold off on releasing pyblosxom 1.1 for a few days in case Bill wants to change things.

Bill Mill's weblog is here. He talks a bit about metadata in entries and keywords.

Also, SourceForge is finally getting around to updating their web-servers and are planning to install a version of Python greater than 1.5.2. When that happens, I'm going to re-do and move the PlanetPyBlosxom web-site. I'm hoping Wari will approve moving the PyBlosxom main site as well. If he does that, then I want to merge the two sites, fix our problems with documentation, and centralize everything under one big project web-site that's agnostic of the people involved. That's a bit project. It may be that I'll wait to do pyblosxom 1.1 release until after the "big move".

A while back, several people offered to help out but I severely lacked the resources to sort everything out to take that offer. I'm hoping to make development much easier for people who want to hop in, implement a feature they need, and hop back out again and also make room for growing PyBlosxom beyond its blosxom roots.

So that's the update. Any thoughts or comments, leave them below.

More comment spam

, | Tweet this

I think I've removed over 100 spam comments from my blog in the last 48 hours. I'm a little tired of it, so I added a few obvious words to my word blacklist and then I went and modified the comments plugin to allow for "draft" status.

Then I wrote a small script that goes through the directory, finds all the comments in draft status, prints each comment to the screen and asks me what I want to do with it. That'll prevent comments from getting published without my manual approval.

It's interesting to note that many/most of the comment spam are comments on my entries on comment spam. Amusing....