예제 #1
0
파일: processor.py 프로젝트: lcrees/psilib
 def tostatic(self, file=None):        
     self._exports = {}
     if file: self._doc = nr.parseUri(file)
     stripws(self._doc)
     names = [getname(i) for i in tags(self._doc, psins, rsrc)]
     classes = [getclass(i) for i in tags(self._doc, psins, rsrc)]
     self._unexpanded = [i for i in tags(self._doc, psins, rsrc)
                         if getclass(i) in names]
     self._templates = [i for i in tags(self._doc, psins, rsrc)
                        if getname(i) in classes]
     self._expandTemplates()
     self._expandResources()
     self._exportResources()
예제 #2
0
파일: htmlutils.py 프로젝트: lcrees/psilib
def htmldom(file):
    htmlstring = tidy(open(file, 'rb').read(), output_xhtml=1, wrap=0)[2]
    htmldom = nr.parseString(htmlstring, htmlns)
    stripws(htmldom)
    htmldom.normalize()
    return htmldom