For my PyMOTW series, I have found that I want to convert a lot of python source code to HTML. In a perfect world it would be easy for me to produce pretty XML/HTML and use CSS, but it is not obvious how to use CSS from Blogger. Instead, I am using a CLI app based on this ASPN recipe which produces HTML snippets that I can paste directly into a new blog post.
To start this series, let’s take a look at the fileinput module, a very useful module for creating command line programs for processing text files in a filter-ish manner. For example, the m3utorss app I recently wrote for my friend Patrick to convert some of his demo recordings into a podcastable format.
Read more at pymotw.com: fileinput
I am starting a new series of posts today that I am calling “Python Module of the Week” (PyMOTW). I have two goals for this:
to work my way though the standard library and learn something about each module to get into the habit of posting to the blog more regularly I will cheat a little, and start out with some modules that I already know something about. Hopefully that will give me enough of a head-start that I can keep up a fairly regular flow.
I had a report that version 1.2 of my codehosting package did not include all of the required files. It turns out I messed up the setup.py file and left out the templates, images, and CSS files. Oops.
In the process of trying to fix the setup file, I discovered that distutils does not include package data in sdist. Not a big deal, since I just created a MANIFEST.in file to get around it.
In no particular order:
Cull my Google Reader subscriptions. 364 is too many. Finish reading Dreaming in Code. Add tagging support to codehosting. Verify all of the domains under my control with Google Web Master tools. Create a Trac plugin for code reviews based on the process we use at work. Change the monitor feeds on CastSampler.com so they do not include items without enclosures. Enhance BlogBackup to save enclosures and images linked from blog posts.
Version 1.4 of MailArchiveByDate now supports archiving to IMAP folders.
It works exactly as expected for me, but some users have reported problems with the script not creating new mailboxes. If the mailbox exists, the messages are moved. I have not been able to reproduce the problem myself using dovecot on Fedora Core 4 or Scalix (which is supposed to look like an Exchange server).
Over at the Google Operating System blog, they offer a way to “backup” your blog. It is mostly a manual hack to load the entire blog into one page in a web browser, then save the resulting HTML, though a similar technique is offered for saving the contents of your XML feed.
There are a few problems with this technique:
It depends on knowing how many posts are in the blog, up front.
I’m a little behind on my reading, so I just noticed that Tim over at Hawk Wings is linking to MailArchiveByDate. I guess that explains the email I’ve received in the past few days asking for help. :-)
Tim comments that my update notes for the 1.2 release don’t convey much meaning. I looked, and sure enough, they aren’t end-user-ready release notes. I’ll try again. The original version of the script asked Mail for the current selection.