-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsass-images.py
executable file
·35 lines (28 loc) · 1.13 KB
/
sass-images.py
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
#!/usr/bin/env python
from __future__ import unicode_literals
import argparse
import os
import sass_images
parser = argparse.ArgumentParser(description='Generates inline image information for SASS.')
parser.add_argument('-d', '--dir',
default=os.getcwd(),
help="Directory from which to read images.")
parser.add_argument('-o', '--output',
default='-',
type=argparse.FileType('w', 0),
help='Output file. Defaults to stdout.')
parser.add_argument('-i', '--inline-threshold',
default=2048,
type=int,
dest='threshold',
help='Inline images if less than this many bytes. Default 2048.')
parser.add_argument('-u', '--url-prefix',
default='',
dest='prefix',
help='Prefix non-inline URLs with this path.')
def main():
args = parser.parse_args()
sass_images.generate_sass_from_dir(args.dir, args.output,
args.threshold, args.prefix)
if __name__ == '__main__':
main()