/usr/share/doc/python-cssutils/examples/imports.py is in python-cssutils 0.9.10-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | # -*- coding: utf-8 -*-
import cssutils
import os.path
import xml.dom
EXPOUT = u'''@charset "iso-8859-1";
@import "1inherit-iso.css";
##############################
1inherit-iso.css
##############################
@charset "iso-8859-1";
@import "2inherit-iso.css";
/* 1 inherited encoding iso-8859-1 */
====================
2inherit-iso.css
====================
@charset "iso-8859-1";
/* 2 inherited encoding iso-8859-1 */
'''
EXPERR = u''
def main():
def p(s, l=0):
c = '#=-'[l] * (30 - l*10)
for r in s.cssRules.rulesOfType(cssutils.css.CSSRule.IMPORT_RULE):
print c
print r.href
print c
print r.styleSheet.cssText
print
p(r.styleSheet, l=l+1)
print
s = cssutils.parseFile(os.path.join('sheets', '1import.css'))
print s.cssText
print
p(s)
if __name__ == '__main__':
main()
|