setup: use absolute paths when building icons (#8383)

This commit is contained in:
Frédéric Péters 2015-09-25 17:23:13 +02:00
parent 002d6cf922
commit 2e534d26fd
1 changed files with 4 additions and 3 deletions

View File

@ -9,13 +9,14 @@ import subprocess
import tempfile
import xml.etree.ElementTree as ET
from distutils.cmd import Command
from setuptools.command.install_lib import install_lib as _install_lib
from distutils.command.build import build as _build
from distutils.command.sdist import sdist
from setuptools import setup, find_packages
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
class eo_sdist(sdist):
def run(self):
@ -86,7 +87,7 @@ class build_icons(Command):
pass
def run(self):
destpath = 'gadjo/static/css/icons/'
destpath = os.path.join(BASE_DIR, 'gadjo/static/css/icons/')
if not os.path.exists(destpath):
os.mkdir(destpath)
variants = {
@ -98,7 +99,7 @@ class build_icons(Command):
'css': 'ul.apps li.icon-%(name)s a:hover { background-image: url(icons/%(filename)s); }'},
}
css_rules = []
for basepath, dirnames, filenames in os.walk('icons'):
for basepath, dirnames, filenames in os.walk(os.path.join(BASE_DIR, 'icons')):
for filename in filenames:
basename = os.path.splitext(filename)[0]
for variant in variants: