Skip to content

Instantly share code, notes, and snippets.

@cbeer
Created February 15, 2010 17:05
Show Gist options
  • Save cbeer/304792 to your computer and use it in GitHub Desktop.
Save cbeer/304792 to your computer and use it in GitHub Desktop.
RewriteEngine On
RewriteMap pairtree-map prg:/opt/local/apache2/map.pairtree.py
RewriteLock /opt/local/apache2/map.pairtree.py.lock
RewriteRule ^/pt/(.+?)/(.*)$ /pairtree/${pairtree-map:$1}/$2
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# uses the python pairtree library from github.com/edsu/pairtree/tree/master/pairtree/
import sys
import pairtree
while sys.stdin:
print pairtree.id2path(sys.stdin.readline().rstrip())
sys.stdout.flush()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment