Я решил это, переопределив css с помощью:
.ui-row-editor{
display: inline;
}
Попробуйте:
CSS="CSS"
COMMENT="COMMENT"
EXCEPTION="EXCEPTION"
FILTER="FILTER"
def is_comment(line):
return line[0]=="!"
def is_css_rule(line):
return '##' in line
def is_exception_rule(line):
return '@' in line
def is_filter_rule(line):
return not is_comment(line) and not is_css_rule(line)
def get_rule_type(line):
if is_comment(line):
return COMMENT
elif is_css_rule(line):
return CSS
elif is_exception_rule(line):
return EXCEPTION
else:
return FILTER
with open("abc.txt") as f:
for line in f:
print('{:12s} {!r}'.format(get_rule_type(line), line))
Примечание: здесь используется Python 3. Кроме того, мы не используем регулярные выражения, поэтому нет необходимости включать пакет re
. [ 113]