from db import Pagedb
from py.handler import BaseHTML
import py.util
import re
from reSource0 import moduleConversion
input : [[module pagelist]]
output : the list of page formats html
class Mylist(moduleConversion):
    def __init__(self):
        self.pattren = r'(\[){2}module pagelist(\]){2}'
    def conver(self, content, page):
        strlist = self.split(content)
        res = ''
        for line in strlist:
            match =,line)
            if match:
                res = self.match(page)
                #res +=
                res += line
            res += '\n'
        return res
    def match(self, page):
        pages = Pagedb.gql('where author = :1',
        for page in pages:
            page.pagetitle = py.util.quote(page.pagetitle)
        html = BaseHTML("mylistTemplete.html")
        return html.render()