本文整理汇总了Python中lightyear.LY.pretty_css方法的典型用法代码示例。如果您正苦于以下问题:Python LY.pretty_css方法的具体用法?Python LY.pretty_css怎么用?Python LY.pretty_css使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lightyear.LY
的用法示例。
在下文中一共展示了LY.pretty_css方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_example_vendorize
# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import pretty_css [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
示例2: test_example_file
# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import pretty_css [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
示例3: test_pretty_css_debug
# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import pretty_css [as 别名]
def test_pretty_css_debug():
i = dedent('''
div.main
color: blue
width: 800px
a
text-decoration: none
''')
o = ('div.main /*line2*/ {\n'
' color: blue; /*line3*/\n'
' width: 800px; /*line4*/\n'
'}\n'
'div.main a /*line5*/ {\n'
' text-decoration: none; /*line6*/\n'
'}\n')
ly = LY(debug=True)
ly.eval(i)
assert ly.pretty_css() == o
示例4: test_pretty_css
# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import pretty_css [as 别名]
def test_pretty_css():
i = dedent('''
div.main
color: blue
width: 800px
a
text-decoration: none
''')
o = ('div.main {\n'
' color: blue;\n'
' width: 800px;\n'
'}\n'
'div.main a {\n'
' text-decoration: none;\n'
'}\n')
ly = LY()
ly.eval(i)
assert ly.pretty_css() == o
示例5: test_pretty_at_rule
# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import pretty_css [as 别名]
def test_pretty_at_rule():
i = dedent('''
body
color: black
@media screen and (min-width: 970px)
body
color: white
''')
o = ('body {\n'
' color: black;\n'
'}\n'
'@media screen and (min-width: 970px) {\n'
' body {\n'
' color: white;\n'
' }\n'
'}\n')
ly = LY()
ly.eval(i)
assert ly.pretty_css() == o