ui: add QRadioButton to the stylesheet
[git-cola.git] / wscript
blobc4faf233ac4938755c99dfdc0efea08f0a3e7720
1 #!/usr/bin/env python
2 import os
3 import sys
4 import glob
5 import Params
6 import Common
7 from os.path import join
9 # Release versioning
10 def get_version():
11 """Runs version.sh and returns the output."""
12 cmd = join(os.getcwd(), 'scripts', 'version.sh')
13 pipe = os.popen(cmd)
14 version = pipe.read()
15 pipe.close()
16 return version.strip()
18 #############################################################################
19 # Mandatory variables
20 APPNAME = 'cola'
21 VERSION = get_version()
23 srcdir = '.'
24 blddir = 'obj'
26 #############################################################################
27 # Options
28 def set_options(opt):
29 opt.tool_options('python')
30 opt.tool_options('pyuic4', 'build')
31 pass
33 #############################################################################
34 # Configure
35 def configure(conf):
36 conf.check_tool('misc')
37 conf.check_tool('python')
38 conf.check_tool('pyuic4', 'build')
39 conf.check_tool('po2qm', 'build')
41 env = conf.env
42 prefix = env['PREFIX']
43 bindir = join(prefix, 'bin')
44 share = join(prefix, 'share')
45 modules = join(share, 'cola')
46 styles = join(modules, 'styles')
47 images = join(styles, 'images')
48 views = join(modules, 'views')
49 controllers = join(modules, 'controllers')
50 icons = join(prefix, 'share', 'cola', 'icons')
51 apps = join(prefix, 'share', 'applications')
53 env['COLA_BINDIR'] = bindir
54 env['COLA_MODULES'] = modules
55 env['COLA_STYLES'] = styles
56 env['COLA_IMAGES'] = images
57 env['COLA_VIEWS'] = views
58 env['COLA_CONTROLLERS'] = controllers
59 env['COLA_ICONS'] = icons
60 env['COLA_APPS'] = apps
62 return True
64 #############################################################################
65 # Build
66 def build(bld):
67 bld.add_subdirs("""
68 scripts
70 cola
71 """)
73 qm = bld.create_obj('po2qm')
74 qm.find_sources_in_dirs('po')
76 for icon in glob.glob('icons/*.png'):
77 Common.install_files('COLA_ICONS', '', icon)
79 for style in glob.glob('styles/*.qss'):
80 Common.install_files('COLA_STYLES', '', style)
82 for image in glob.glob('styles/images/*.png'):
83 Common.install_files('COLA_IMAGES', '', image)
85 #############################################################################
86 # Shutdown
87 def shutdown():
88 # always re-create the version.py file
89 for variant in Params.g_build.m_allenvs:
90 version_file = join(Params.g_build.m_bdir,
91 variant,
92 'scripts',
93 'version.py')
94 if os.path.exists(version_file):
95 os.unlink(version_file)