예제 #1
0
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
예제 #2
0
파일: shpatml.py 프로젝트: zmasek/pendvisor
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()
예제 #3
0
파일: engine.py 프로젝트: jowolf/tlg
 def minaml_replace (self, dselector, template_code):  # does NOT work for 'html' (top node) - no parent
   dselector.replaceWith (convert_text ('\n' + template_code))
예제 #4
0
파일: engine.py 프로젝트: jowolf/tlg
 def minaml (self, dselector, template_code):
   dselector.html (convert_text ('\n' + template_code))
예제 #5
0
파일: engine.py 프로젝트: jowolf/tlg
 def minaml (self, context, template_code):
   self.template = convert_text (template_code)
예제 #6
0
 def minaml_replace(
         self, dselector,
         template_code):  # does NOT work for 'html' (top node) - no parent
     dselector.replaceWith(convert_text('\n' + template_code))
예제 #7
0
 def minaml(self, dselector, template_code):
     dselector.html(convert_text('\n' + template_code))
예제 #8
0
 def minaml(self, context, template_code):
     self.template = convert_text(template_code)
예제 #9
0
def assert_shpaml(expected_output, source):
    actual_output = shpaml.convert_text(source).strip()
    assert_equals(expected_output.strip(), actual_output)
예제 #10
0
파일: tests.py 프로젝트: Rootbuzz/shpaml
def assert_shpaml(expected_output, source):
    from shpaml import shpaml
    actual_output = shpaml.convert_text(source).strip()
    assert_equals(expected_output.strip(), actual_output)