jqueryFileTree connector script for python cgi

If you use jquery and haven’t messed with the jqueryFileTree plugin, I’d highly recommend you do so. It’s pretty neat, and there are connector scripts already written in various languages for use with this plugin. However, there wasn’t one for python cgi (there was one for django however). So, I wrote my own! Try it out:

#!/usr/bin/python
# jqueryFileTree connector script for python cgi 
# Version: 1.0 / 10 August 2010
# Author: Charles Hamilton / musashi@nefaria.com
# Released under the GNU GPLv3
# Modifications and improvements are welcome

import os, cgi, cgitb, urllib, re
cgitb.enable()
form = cgi.FieldStorage()

print 'Content-Type: text/html\n\n'
print '<ul class="jqueryFileTree" style="display: none;">'

path = urllib.unquote(form['dir'].value)

dirs = []
files = []

filelist = sorted(os.listdir(path))

for object in filelist:
    if os.path.isfile(path + '/' + object):
       ext = os.path.splitext(object)
        files.append('<li class="file ext_' + re.sub('\.', '', ext[1]) + '"><a href="#" rel="'+ path + object + '">'+ object + '</a></li>')
    elif os.path.isdir(path + '/' + object):
        dirs.append('<li class="directory collapsed"><a href="#" rel="'+ path + object +'/">' + object + '</a></li>')

for d in dirs:
    print d

for f in files:
    print f
print '</ul>'

Autoresponse on HowToForge

Autoresponse now has a tutorial on HowToForge! Be sure to check it out. I also suggest signing up because there is a wealth of information on there, and with a paid subscription you can download any tutorial as a PDF (other formats are available as well) without the ads, graphics, and other unrelated items… it’s well worth it.

Autoresponse 1.6.2 (bugfix) released!

This version of autoresponse addresses a minor bug that could cause any text in the message body that resembles a “To” header to be replaced with something other than what the user intended. There was a fairly small chance that this would happen, but it’s an improvement nonetheless. You can find the new version on the projects page.

Autoresponse 1.6.1 (bugfix) released!

Well the first round of bugs have been discovered (and fixed). The major issue resolved by this release is that a rogue user with a forged from header could set an autoresponse message for someone else. We now require SASL authentication which addresses this. This is a highly recommended update; you can find it under the “projects” link in the upper-right corner.

Autoresponse 1.6.0 released!

The latest version of Autoresponse (1.6.0) has been released. You can find it by clicking the ‘projects’ link in the upper-right corner, and then on ‘Autoresponse’. This is a major revision; the ability for users to enable their out-of-office replies via e-mail is finally stable. The best part is that they don’t have to send their out-of-office replies in plain text format either—it can be HTML or PLAIN (RTF not tested and not probably not supported YMMV). Just send an e-mail from “user@domain.tld” to “user+autoresponse@domain.tld” exactly how you’d like the reply to appear—WYSIWYG (What You Send Is What You Get)—and you should get a message back saying whether your autoresponse was enabled or disabled (if you already had one set, then it gets deleted). So try it out! Be sure to let me know if you have any issues :-)