2
# -*- coding: utf-8 -*-
3
# Copyright 2009 Canonical Ltd.
4
# Author 2009 Didier Roche
6
# This file is part of Quickly ubuntu-project-template
8
#This program is free software: you can redistribute it and/or modify it
9
#under the terms of the GNU General Public License version 3, as published
10
#by the Free Software Foundation.
12
#This program is distributed in the hope that it will be useful, but
13
#WITHOUT ANY WARRANTY; without even the implied warranties of
14
#MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
15
#PURPOSE. See the GNU General Public License for more details.
17
#You should have received a copy of the GNU General Public License along
18
#with this program. If not, see <http://www.gnu.org/licenses/>.
27
from gettext import gettext as _
28
gettext.textdomain('quickly')
30
from quickly import configurationhandler, templatetools
36
Runs your application. This is the best way to try test it out
37
while you are developing it. It starts up the main project window.
39
templatetools.handle_additional_parameters(sys.argv, help)
41
# if config not already loaded
42
if not configurationhandler.project_config:
43
configurationhandler.loadConfig()
45
project_bin = 'bin/' + configurationhandler.project_config['project']
46
command_line = [project_bin]
47
command_line.extend(sys.argv[1:])
49
# run with args if bin/project exist
50
st = os.stat(project_bin)
51
mode = st[stat.ST_MODE]
52
if mode & stat.S_IEXEC:
53
subprocess.call(command_line)
55
print _("Can't execute %s") % project_bin