def minaml (value): if trace: print print 'BEFORE:', value result = convert_text (value) if trace: print print 'AFTER:', result #if settings.DEBUG: # result += '<!-- \n\nBEFORE:\n%s\n\nAFTER:\n%s\n\n -->' % (value, result) return result
def shpaml_to_html(argv): fname = argv[0] try: f = open(fname, 'r') try: content = f.read() finally: f.close() except IOError: print 'The file you provided cannot be open or read' try: fm = open(fname.replace('.shpaml', '.html'), 'w') except IOError: print 'Cannot open a new file in current/designated folder' output = shpaml.convert_text(content) try: fm.write(output) except IOError: print 'Cannot write to mirror file' finally: fm.close()
def minaml_replace (self, dselector, template_code): # does NOT work for 'html' (top node) - no parent dselector.replaceWith (convert_text ('\n' + template_code))
def minaml (self, dselector, template_code): dselector.html (convert_text ('\n' + template_code))
def minaml (self, context, template_code): self.template = convert_text (template_code)
def minaml_replace( self, dselector, template_code): # does NOT work for 'html' (top node) - no parent dselector.replaceWith(convert_text('\n' + template_code))
def minaml(self, dselector, template_code): dselector.html(convert_text('\n' + template_code))
def minaml(self, context, template_code): self.template = convert_text(template_code)
def assert_shpaml(expected_output, source): actual_output = shpaml.convert_text(source).strip() assert_equals(expected_output.strip(), actual_output)
def assert_shpaml(expected_output, source): from shpaml import shpaml actual_output = shpaml.convert_text(source).strip() assert_equals(expected_output.strip(), actual_output)