-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathsetup.py
More file actions
89 lines (82 loc) · 2.39 KB
/
Copy pathsetup.py
File metadata and controls
89 lines (82 loc) · 2.39 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import distutils.cmd
import distutils.log
import os.path
import subprocess
from setuptools import setup
class RenderSVGsCommand(distutils.cmd.Command):
user_options = []
def initialize_options(self):
self.img_path = 'wuvt/static/img'
self.sources = [
('moon.svg', 1200, 42),
('logo.svg', 200, 85),
('bubble.svg', 558, 99),
('nowplaying_banner_left.svg', 32, 15),
('nowplaying_banner_right.svg', 52, 34),
('robot.svg', 160, 148),
('Hamburger_icon.svg', 60, 60),
]
def finalize_options(self):
pass
def run(self):
"""Render the SVGs into PNGs."""
for source in self.sources:
self.announce(
"Rendering SVG: {0}".format(source[0]),
level=distutils.log.INFO)
for zoom in (1, 2):
outname = source[0].replace('.svg', '-{0:d}x.png'.format(zoom))
subprocess.check_call([
'rsvg-convert',
'-w', str(source[1] * zoom),
'-h', str(source[2] * zoom),
'-o', os.path.join(self.img_path, outname),
os.path.join(self.img_path, source[0]),
])
subprocess.check_call([
'optipng', '-quiet', '-nb', '-nc', '-np',
os.path.join(self.img_path, outname),
])
setup(
name="wuvt-site",
py_modules=["wuvt"],
description="Next generation website for WUVT-FM",
license="AGPL3",
author="wuvt-site authors",
keywords="wuvt",
url="https://github.com/wuvt/wuvt-site",
install_requires=[
"bleach",
"celery",
"click",
"Flask",
"Flask-Migrate",
"Flask-RESTful",
"Flask-SQLAlchemy",
"Flask-WTF",
"humanize",
"Markdown",
"musicbrainzngs",
"netaddr",
"passlib",
"psycopg2",
"pyasn1",
"pyasn1-modules",
"PyMySQL",
"python-dateutil",
"python-editor",
"python-redis-lock",
"pytz",
"redis",
"requests",
"SQLAlchemy-Utils",
"stripe",
"Unidecode",
],
dependency_links=[
"git+https://github.com/wuvt/python-musicbrainzngs#egg=musicbrainzngs",
],
cmdclass={
"render_svgs": RenderSVGsCommand,
}
)