当前位置: 首页>>代码示例>>Python>>正文


Python LY.eval方法代码示例

本文整理汇总了Python中lightyear.LY.eval方法的典型用法代码示例。如果您正苦于以下问题:Python LY.eval方法的具体用法?Python LY.eval怎么用?Python LY.eval使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lightyear.LY的用法示例。


在下文中一共展示了LY.eval方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_keyframe_d

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import eval [as 别名]
def test_keyframe_d():
    i = dedent('''
        div
            width: 100px
            height: 100px
            background: red
            position: relative
            animation: warpmove 5s infinite
        @keyframes warpmove
            (a) 0%
                top: 0px
                background: red
                width: 100px
            (b) 0%
                top: 170px
                background: blue
                width: 50px
            (a) 100%
                top: 200px
                background: yellow
                width: 300px
            (b) 100%
                top: 300px
                background: yellow
                width: 500px
        (root)
        (root.b)
        ''')
    o = ('div{width:100px;height:100px;background:red;position:relative;animation:warpmove 5s infinite;}'
         '@keyframes warpmove{0%{top:170px;background:blue;width:50px;}'
         '100%{top:300px;background:yellow;width:500px;}}')
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:36,代码来源:test_lang.py

示例2: test_keyframe_e

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import eval [as 别名]
def test_keyframe_e():
    i = dedent('''
        start = 0%
        end = 100%
        div
            width: 100px
            height: 100px
            background: red
            position: relative
            animation: warpmove 5s infinite
        @keyframes warpmove
            start
                top: 0px
                background: red
                width: 100px
            end
                top: 200px
                background: yellow
                width: 300px
        ''')
    o = ('div{width:100px;height:100px;background:red;position:relative;animation:warpmove 5s infinite;}'
         '@keyframes warpmove{0%{top:0px;background:red;width:100px;}'
         '100%{top:200px;background:yellow;width:300px;}}')
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:28,代码来源:test_lang.py

示例3: test_grid_nested_a

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import eval [as 别名]
def test_grid_nested_a():
    i = dedent('''
        // Configure primary grid with 16 columns.
        grid-columns = 16
        grid-column-width = 60px
        grid-gutter = 32px

        // Configure nested grid
        //  - consumes 8 columns of parent grid.
        //  - configures 3 inner columns
        //  - configures gutter of 64px for inner columns
        ngrid-1-parent = 0
        ngrid-1-ocolumns = 8
        ngrid-1-icolumns = 4
        ngrid-1-gutter = 64px

        .outside
            col(8)

        .inside
            ncol(1 1)
        ''')

    o = ('.outside{box-sizing:border-box;display:inline-block;width:480px;margin-left:16px;margin-right:16px;}'
         '.inside{box-sizing:border-box;display:inline-block;width:112px;margin-left:32px;margin-right:32px;}')
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:30,代码来源:test_grid.py

示例4: test_example_vendorize

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import eval [as 别名]
def test_example_vendorize():
    with open(os.path.join(TEST_DIR, 'divmain.ly'), 'r') as f:
        i = f.read()
    with open(os.path.join(TEST_DIR, 'divmain.vendor.css'), 'r') as f:
        o = f.read()
    ly = LY(vendorize='offline')
    ly.eval(i)
    assert ly.pretty_css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:10,代码来源:test_big_examples.py

示例5: test_example_file

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import eval [as 别名]
def test_example_file():
    with open(os.path.join(TEST_DIR, 'divmain.ly'), 'r') as f:
        i = f.read()
    with open(os.path.join(TEST_DIR, 'divmain.css'), 'r') as f:
        o = f.read()
    ly = LY()
    ly.eval(i)
    assert ly.pretty_css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:10,代码来源:test_big_examples.py

示例6: test_division_int

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import eval [as 别名]
def test_division_int():
    i = dedent('''
        div#first.button
            width: 20px / 4
        ''')
    o = 'div#first.button{width:5px;}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_lang.py

示例7: test_multiplication

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import eval [as 别名]
def test_multiplication():
    i = dedent('''
        .button
            width: 4em * 8
        ''')
    o = '.button{width:32em;}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_lang.py

示例8: test_lighten_g

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import eval [as 别名]
def test_lighten_g():
    i = dedent('''
        p
            color: lighten(black #bdb76b)
        ''')
    o = 'p{color:darkkhaki;}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_builtin_functions.py

示例9: test_id_type_sel

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import eval [as 别名]
def test_id_type_sel():
    i = dedent('''
        a#first
            display: block
        ''')
    o = 'a#first{display:block;}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_lang.py

示例10: test_universal_sel

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import eval [as 别名]
def test_universal_sel():
    i = dedent('''
        *
            border: none
        ''')
    o = '*{border:none;}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_lang.py

示例11: test_lighten_e

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import eval [as 别名]
def test_lighten_e():
    i = dedent('''
        p
            color: lighten(#96fa42 #69060c)
        ''')
    o = 'p{color:#ffff4e;}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_builtin_functions.py

示例12: test_lighten_a

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import eval [as 别名]
def test_lighten_a():
    i = dedent('''
        p
            color: lighten(#202020 10%)
        ''')
    o = 'p{color:#232323;}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_builtin_functions.py

示例13: test_lighten_b

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import eval [as 别名]
def test_lighten_b():
    i = dedent('''
        p
            color: lighten(#404040 #101010)
        ''')
    o = 'p{color:#505050;}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_builtin_functions.py

示例14: test_darken_g

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import eval [as 别名]
def test_darken_g():
    i = dedent('''
        p
            color: darken(white #ff9bff)
        ''')
    o = 'p{color:darkgreen;}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_builtin_functions.py

示例15: test_darken_a

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import eval [as 别名]
def test_darken_a():
    i = dedent('''
        p
            color: darken(#ffffff 10%)
        ''')
    o = 'p{color:#e5e5e5;}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_builtin_functions.py


注:本文中的lightyear.LY.eval方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。