muyhomepage2 / muyhomepage2 /

Full commit
#!/usr/bin/env python
# Copyright 2009 John Mulligan <>
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2, incorporated herein by reference.
"""metadata functions

import urllib

def writepagecache(data, fp):
    for (filename, ccode, title, action) in data:
        parts = [filename, ccode, title, action]
        parts = [p or '.' for p in parts]
        parts = [urllib.quote(p) for p in parts]
        fp.write('%s\n' % ' '.join(parts))

def readpagecache(fp):
    def _unquote(value):
        if value == '.':
            return ''
            return urllib.unquote(value)
    for line in fp:
        parts = line.split()
        assert len(parts) == 4
        yield tuple([_unquote(p) for p in parts])

def writetagcache(data, fp):

def readtagcache(fp):