Esempio n. 1
0
def test():
    # get the package
    import pyre.weaver
    # instantiate a weaver
    weaver = pyre.weaver.weaver(name="sanity")
    # with the right language
    weaver.language = "html"
    # render
    text = list(weaver.weave())
    # check
    assert text == [
        '<!doctype html>',
        '<!--',
        ' ! ',
        ' ! Michael A.G. Aïvázis',
        ' ! Orthologue',
        ' ! (c) 1998-2019 All Rights Reserved',
        ' ! ',
        ' -->',
        '<html>',
        '',
        '',
        '</html>',
        '<!-- end of file -->'
        ]
    # all done
    return
Esempio n. 2
0
def test():
    # get the package
    import pyre.weaver
    # instantiate a weaver
    weaver = pyre.weaver.weaver(name="sanity")
    weaver.language = "svg"

    text = list(weaver.weave())
    assert text == [
        '<?xml version="1.0"?>',
        '<!--',
        ' ! ',
        ' ! Michael A.G. Aïvázis',
        ' ! Orthologue',
        ' ! (c) 1998-2019 All Rights Reserved',
        ' ! ',
        ' -->',
        '',
        '<svg version="1.1" xmlns="http://www.w3.org/2000/svg">',
        '',
        '',
        '</svg>',
        '',
        '<!-- end of file -->'
        ]

    return
Esempio n. 3
0
def test():
    # get the package
    import pyre.weaver
    # instantiate a weaver
    weaver = pyre.weaver.weaver(name="sanity")
    # with the right language
    weaver.language = "html"
    # render
    text = list(weaver.weave())
    # check
    assert text == [
        '<!doctype html>',
        '<!--',
        ' ! ',
        ' ! Michael A.G. Aïvázis',
        ' ! Orthologue',
        ' ! (c) 1998-2020 All Rights Reserved',
        ' ! ',
        ' -->',
        '<html>',
        '',
        '',
        '</html>',
        '<!-- end of file -->'
        ]
    # all done
    return
Esempio n. 4
0
def test():
    # get the package
    import pyre.weaver
    # instantiate a weaver
    weaver = pyre.weaver.weaver(name="sanity")
    weaver.language = "pfg"

    text = list(weaver.weave())
    assert text == [
        ';', '; Michael A.G. Aïvázis', '; Orthologue',
        '; (c) 1998-2020 All Rights Reserved', ';', '', '', '; end of file'
    ]

    return
Esempio n. 5
0
def test():
    # get the package
    import pyre.weaver
    # instantiate a weaver
    weaver = pyre.weaver.weaver(name="sanity")
    weaver.language = "xml"

    text = list(weaver.weave())
    assert text == [
        '<?xml version="1.0"?>', '<!--', ' ! ', ' ! Michael A.G. Aïvázis',
        ' ! Orthologue', ' ! (c) 1998-2022 All Rights Reserved', ' ! ', ' -->',
        '', '', '<!-- end of file -->'
    ]

    return
Esempio n. 6
0
def test():
    # get the package
    import pyre.weaver
    # instantiate a weaver
    weaver = pyre.weaver.weaver(name="sanity")
    weaver.language = "C"

    text = list(weaver.weave())
    # print("\n".join(text))
    assert text == [
        '/*', ' * -*- C -*-', ' * ', ' * Michael A.G. Aïvázis',
        ' * Orthologue', ' * (c) 1998-2020 All Rights Reserved', ' * ', ' */',
        '', '', '/* end of file */'
    ]

    return
Esempio n. 7
0
def test():
    # get the package
    import pyre.weaver
    # instantiate a weaver
    weaver = pyre.weaver.weaver(name="sanity")
    weaver.language = "sh"

    text = list(weaver.weave())
    assert text == [
        '#!/bin/bash',
        '#',
        '# Michael A.G. Aïvázis',
        '# Orthologue',
        '# (c) 1998-2019 All Rights Reserved',
        '#',
        '',
        '',
        '# end of file',
        ]

    return
Esempio n. 8
0
def test():
    # get the package
    import pyre.weaver
    # instantiate a weaver
    weaver = pyre.weaver.weaver(name="sanity")
    weaver.language = "sql"

    text = list(weaver.weave())
    assert text == [
        '-- -*- SQL -*-',
        '--',
        '-- Michael A.G. Aïvázis',
        '-- Orthologue',
        '-- (c) 1998-2019 All Rights Reserved',
        '--',
        '',
        '',
        '-- end of file',
        ]

    return
Esempio n. 9
0
def test():
    # get the package
    import pyre.weaver
    # instantiate a weaver
    weaver = pyre.weaver.weaver(name="sanity")
    weaver.language = "sql"

    text = list(weaver.weave())
    assert text == [
        '-- -*- SQL -*-',
        '--',
        '-- Michael A.G. Aïvázis',
        '-- Orthologue',
        '-- (c) 1998-2019 All Rights Reserved',
        '--',
        '',
        '',
        '-- end of file',
    ]

    return
Esempio n. 10
0
def test():
    # get the package
    import pyre.weaver
    # instantiate a weaver
    weaver = pyre.weaver.weaver(name="sanity")
    weaver.language = "f77"

    text = list(weaver.weave())
    assert text == [
        'c -*- Fortran -*-',
        'c',
        'c Michael A.G. Aïvázis',
        'c Orthologue',
        'c (c) 1998-2020 All Rights Reserved',
        'c',
        '',
        '',
        'c end of file',
    ]

    return
Esempio n. 11
0
def test():
    # get the package
    import pyre.weaver
    # instantiate a weaver
    weaver = pyre.weaver.weaver(name="sanity")
    weaver.language = "f90"

    text = list(weaver.weave())
    assert text == [
        '! -*- F90 -*-',
        '!',
        '! Michael A.G. Aïvázis',
        '! Orthologue',
        '! (c) 1998-2019 All Rights Reserved',
        '!',
        '',
        '',
        '! end of file',
        ]

    return
Esempio n. 12
0
def test():
    # get the package
    import pyre.weaver
    # instantiate a weaver
    weaver = pyre.weaver.weaver(name="sanity")
    weaver.language = "C++"

    text = list(weaver.weave())
    assert text == [
        '// -*- C++ -*-',
        '//',
        '// Michael A.G. Aïvázis',
        '// Orthologue',
        '// (c) 1998-2019 All Rights Reserved',
        '//',
        '',
        '',
        '// end of file',
        ]

    return
Esempio n. 13
0
def test():
    # get the package
    import pyre.weaver
    # instantiate a weaver
    weaver = pyre.weaver.weaver(name="sanity")
    weaver.language = "sh"

    text = list(weaver.weave())
    assert text == [
        '#!/bin/bash',
        '#',
        '# Michael A.G. Aïvázis',
        '# Orthologue',
        '# (c) 1998-2018 All Rights Reserved',
        '#',
        '',
        '',
        '# end of file',
    ]

    return
Esempio n. 14
0
def test():
    # get the package
    import pyre.weaver
    # instantiate a weaver
    weaver = pyre.weaver.weaver(name="sanity")
    weaver.language = "C++"

    text = list(weaver.weave())
    assert text == [
        '// -*- C++ -*-',
        '//',
        '// Michael A.G. Aïvázis',
        '// Orthologue',
        '// (c) 1998-2022 All Rights Reserved',
        '//',
        '',
        '',
        '// end of file',
    ]

    return
Esempio n. 15
0
def test():
    # get the package
    import pyre.weaver
    # instantiate a weaver
    weaver = pyre.weaver.weaver(name="sanity")
    weaver.language = "f90"

    text = list(weaver.weave())
    assert text == [
        '! -*- F90 -*-',
        '!',
        '! Michael A.G. Aïvázis',
        '! Orthologue',
        '! (c) 1998-2022 All Rights Reserved',
        '!',
        '',
        '',
        '! end of file',
    ]

    return
Esempio n. 16
0
def test():
    # get the package
    import pyre.weaver
    # instantiate a weaver
    weaver = pyre.weaver.weaver(name="sanity")
    weaver.language = "TeX"
    weaver.language.languageMarker = "TeX"

    text = list(weaver.weave())
    assert text == [
        '% -*- TeX -*-',
        '%',
        '% Michael A.G. Aïvázis',
        '% Orthologue',
        '% (c) 1998-2020 All Rights Reserved',
        '%',
        '',
        '',
        '% end of file',
    ]

    return
Esempio n. 17
0
def test():
    # get the package
    import pyre.weaver
    # instantiate a weaver
    weaver = pyre.weaver.weaver(name="sanity")
    weaver.language = "TeX"
    weaver.language.languageMarker = "TeX"

    text = list(weaver.weave())
    assert text == [
        '% -*- TeX -*-',
        '%',
        '% Michael A.G. Aïvázis',
        '% Orthologue',
        '% (c) 1998-2019 All Rights Reserved',
        '%',
        '',
        '',
        '% end of file',
        ]

    return
Esempio n. 18
0
def test():
    # get the package
    import pyre.weaver
    # instantiate a weaver
    weaver = pyre.weaver.weaver(name="sanity")
    weaver.language = "python"
    weaver.language.script = True
    weaver.language.version = "3.2"
    weaver.language.languageMarker = ""

    text = list(weaver.weave())
    assert text == [
        '#!/usr/bin/env python3.2',
        '#',
        '# Michael A.G. Aïvázis',
        '# Orthologue',
        '# (c) 1998-2022 All Rights Reserved',
        '#',
        '',
        '',
        '# end of file',
        ]

    return
Esempio n. 19
0
def test():
    # get the package
    import pyre.weaver
    # instantiate a weaver
    weaver = pyre.weaver.weaver(name="sanity")
    weaver.language = "C"

    text = list(weaver.weave())
    # print("\n".join(text))
    assert text == [
        '/*',
        ' * -*- C -*-',
        ' * ',
        ' * Michael A.G. Aïvázis',
        ' * Orthologue',
        ' * (c) 1998-2019 All Rights Reserved',
        ' * ',
        ' */',
        '',
        '',
        '/* end of file */'
        ]

    return
Esempio n. 20
0
def test():
    # get the package
    import pyre.weaver
    # instantiate a weaver
    weaver = pyre.weaver.weaver(name="sanity")
    weaver.language = "python"
    weaver.language.script = True
    weaver.language.version = "3.2"
    weaver.language.languageMarker = ""

    text = list(weaver.weave())
    assert text == [
        '#!/usr/bin/env python3.2',
        '#',
        '# Michael A.G. Aïvázis',
        '# Orthologue',
        '# (c) 1998-2019 All Rights Reserved',
        '#',
        '',
        '',
        '# end of file',
        ]

    return