def save_template_once (self, dselector, fname): "Save partial template for later editing; don't overwrite!" if os.path.exists (templates_path + fname): if trace: print 'Not overwritten:', fname return ext = fname.lower().split ('.') [-1] s = dselector.outerHtml() if ext == 'minaml': s = convert_to_shpaml (s) else: print 'NYI' self._save (s, fname)
def save_template_once (self, dselector, fname): "Save partial template for later editing; don't overwrite!" if os.path.exists (os.path.join (templates_path, fname)): if trace: print 'Not overwritten:', fname return ext = fname.lower().split ('.') [-1] s = dselector.outerHtml() if ext == 'minaml': s = convert_to_shpaml (s) else: print 'NYI' self._save (s, fname)
def save_template_once (self, dselector, fname): "Save partial template for later editing; don't overwrite!" from html5lib import serialize ext = fname.lower().split ('.') [-1] #s = dselector.outerHtml() s = serialize (dselector, tree="lxml") if ext == 'minaml': s = convert_to_shpaml (s) elif ext == 'html': pass # s = s else: print 'NYI' # TODO: compiled html template, yaml for obdject / declaration if trace: print 'SAVING ONCE:', fname self.write (s, fname, overwrite=False)
def save_template_once(self, dselector, fname): "Save partial template for later editing; don't overwrite!" from html5lib import serialize ext = fname.lower().split('.')[-1] #s = dselector.outerHtml() s = serialize(dselector, tree="lxml") if ext == 'minaml': s = convert_to_shpaml(s) elif ext == 'html': pass # s = s else: print 'NYI' # TODO: compiled html template, yaml for obdject / declaration if trace: print 'SAVING ONCE:', fname self.write(s, fname, overwrite=False)