From 422799a06e3bf91e232fc78e426968f1e7bc8e63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Fri, 27 May 2016 22:31:03 +0200 Subject: [PATCH] switch to scss --- MANIFEST.in | 2 +- debian/control | 2 +- gadjo/static/css/{gadjo.css => gadjo.scss} | 0 setup.py | 25 ++++++++++++++++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) rename gadjo/static/css/{gadjo.css => gadjo.scss} (100%) diff --git a/MANIFEST.in b/MANIFEST.in index 373ddce..77353bf 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,5 +4,5 @@ include MANIFEST.in include AUTHORS include COPYING include VERSION -recursive-include gadjo/static *.css *.png *.gif *.eot *.woff *.ttf *.svg *.jpg *.js README.md LICENSE release.sh +recursive-include gadjo/static *.scss *.css *.png *.gif *.eot *.woff *.ttf *.svg *.jpg *.js README.md LICENSE release.sh recursive-include icons *.svg diff --git a/debian/control b/debian/control index 9f13448..e5baf99 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: gadjo Maintainer: Frederic Peters Section: python Priority: optional -Build-Depends: python-setuptools (>= 0.6b3), dh-python, dpkg-dev, python-all (>= 2.6.6-3), python2.7-dev, python-all-dev, debhelper (>= 7), python-django, inkscape, python-imaging, libjpeg8-dev | libjpeg-dev, zlib1g-dev +Build-Depends: python-setuptools (>= 0.6b3), dh-python, dpkg-dev, python-all (>= 2.6.6-3), python2.7-dev, python-all-dev, debhelper (>= 7), python-django, inkscape, python-imaging, libjpeg8-dev | libjpeg-dev, zlib1g-dev, ruby-sass Standards-Version: 3.9.1 Package: python-gadjo diff --git a/gadjo/static/css/gadjo.css b/gadjo/static/css/gadjo.scss similarity index 100% rename from gadjo/static/css/gadjo.css rename to gadjo/static/css/gadjo.scss diff --git a/setup.py b/setup.py index 7ab0380..bd4ef6d 100644 --- a/setup.py +++ b/setup.py @@ -76,6 +76,29 @@ class compile_translations(Command): os.chdir(curdir) +class compile_scss(Command): + description = 'compile scss files into css files' + user_options = [] + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + for package in self.distribution.packages: + for package_path in __import__(package).__path__: + for path, dirnames, filenames in os.walk(package_path): + for filename in filenames: + if not filename.endswith('.scss'): + continue + if filename.startswith('_'): + continue + subprocess.call(['sass', '%s/%s:%s/%s' % ( + path, filename, path, filename.replace('.scss', '.css'))]) + + class build_icons(Command): description = 'build icons' user_options = [] @@ -152,6 +175,7 @@ class build_icons(Command): class build(_build): sub_commands = [('compile_translations', None), + ('compile_scss', None), ('build_icons', None)] + _build.sub_commands @@ -192,6 +216,7 @@ setup( cmdclass={ 'build': build, 'build_icons': build_icons, + 'compile_scss': compile_scss, 'compile_translations': compile_translations, 'install_lib': install_lib, 'sdist': eo_sdist