2
2
# -*- coding: utf-8 -*-
3
3
# quickly: quickly project handler
5
# Copyright (C) 2009 Canonical Ltd.fds
6
# Author 2009 Didier Roche
5
# Copyright (C) 2009 Didier Roche
8
7
# This program is free software: you can redistribute it and/or modify
9
8
# it under the terms of the GNU General Public License version 3,
31
31
print >> sys.stderr, 'To build quickly you need https://launchpad.net/python-distutils-extra'
34
assert DistUtilsExtra.auto.__version__ >= '2.10', 'needs DistUtilsExtra.auto >= 2.10'
34
assert DistUtilsExtra.auto.__version__ >= '2.18', 'needs DistUtilsExtra.auto >= 2.18'
36
36
def update_data_path(prefix, oldvalue=None):
65
def update_tutorial(tutorial_layouts):
67
for tutorial_layout in tutorial_layouts:
68
tutorial_dir = tutorial_layout[0]
69
file_name = tutorial_layout[1]
70
po_dir= "%s/po" % tutorial_dir
72
update_cmd = ['xml2po', '-e', '-o', '%s/%s.pot' % (po_dir, file_name),
73
'%s/%s.xml' % (tutorial_dir, file_name)]
74
subprocess.call(update_cmd)
76
for po_file in glob.glob("%s/*.po" % po_dir):
77
lang = os.path.basename(po_file[:-3])
78
update_cmd = ['xml2po', '-p', '%s/%s.po' % (po_dir, lang), '-o',
79
'%s/%s-%s.xml' % (tutorial_dir, file_name, lang),
80
'%s/%s.xml' % (tutorial_dir, file_name)]
81
subprocess.call(update_cmd)
66
83
class InstallAndUpdateDataDirectory(DistUtilsExtra.auto.install_auto):
68
if self.root or self.home:
69
print "WARNING: You don't use a standard --prefix installation, take care that you eventually " \
70
"need to update quickly/quicklyconfig.py file to adjust __quickly_data_directory__. You can " \
71
"ignore this warning if you are packaging and uses --prefix."
72
85
previous_value = update_data_path(self.prefix + '/share/quickly/')
86
update_tutorial([("data/templates/ubuntu-application/help",
88
("data/templates/ubuntu-pygame/help",
73
90
DistUtilsExtra.auto.install_auto.run(self)
74
91
update_data_path(self.prefix, previous_value)
86
103
author='Quickly Developer Team',
87
104
author_email='quickly@lists.launchpad.net',
88
data_files=[('share/quickly/templates/ubuntu-project/project_root', glob.glob('data/templates/ubuntu-project/project_root/project_name.desktop.in'))],
105
data_files=[('share/quickly/templates/ubuntu-application/project_root', glob.glob('data/templates/ubuntu-application/project_root/project_name.desktop.in'))],
89
106
cmdclass={'install': InstallAndUpdateDataDirectory})