~thomas-deruyter-3/qreator/qreator

1 by David Planella
Initial project creation with Quickly!
1
#!/usr/bin/python
2
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
3
### BEGIN LICENSE
89.2.43 by Stefan Schwarzburg
automatic quickly changes
4
# Copyright (C) 2012 David Planella <david.planella@ubuntu.com>
5
# This program is free software: you can redistribute it and/or modify it 
6
# under the terms of the GNU General Public License version 3, as published 
7
# by the Free Software Foundation.
8
# 
9
# This program is distributed in the hope that it will be useful, but 
10
# WITHOUT ANY WARRANTY; without even the implied warranties of 
11
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 
12
# PURPOSE.  See the GNU General Public License for more details.
13
# 
14
# You should have received a copy of the GNU General Public License along 
15
# with this program.  If not, see <http://www.gnu.org/licenses/>.
1 by David Planella
Initial project creation with Quickly!
16
### END LICENSE
17
89.2.37 by David Planella
Pre-upgrade checkpoint
18
### DO NOT EDIT THIS FILE ###
19
1 by David Planella
Initial project creation with Quickly!
20
import sys
21
import os
22
89.2.37 by David Planella
Pre-upgrade checkpoint
23
import locale
24
locale.textdomain('qreator')
1 by David Planella
Initial project creation with Quickly!
25
26
# Add project root directory (enable symlink and trunk execution)
27
PROJECT_ROOT_DIRECTORY = os.path.abspath(
28
    os.path.dirname(os.path.dirname(os.path.realpath(sys.argv[0]))))
29
30
python_path = []
31
if os.path.abspath(__file__).startswith('/opt'):
89.2.37 by David Planella
Pre-upgrade checkpoint
32
    locale.bindtextdomain('qreator', '/opt/extras.ubuntu.com/qreator/share/locale')
33
    syspath = sys.path[:] # copy to avoid infinite loop in pending objects
1 by David Planella
Initial project creation with Quickly!
34
    for path in syspath:
35
        opt_path = path.replace('/usr', '/opt/extras.ubuntu.com/qreator')
36
        python_path.insert(0, opt_path)
37
        sys.path.insert(0, opt_path)
89.2.37 by David Planella
Pre-upgrade checkpoint
38
    os.putenv("XDG_DATA_DIRS", "%s:%s" % ("/opt/extras.ubuntu.com/qreator/share/", os.getenv("XDG_DATA_DIRS", "/usr/local/share/:/usr/share/")))
1 by David Planella
Initial project creation with Quickly!
39
if (os.path.exists(os.path.join(PROJECT_ROOT_DIRECTORY, 'qreator'))
40
    and PROJECT_ROOT_DIRECTORY not in sys.path):
41
    python_path.insert(0, PROJECT_ROOT_DIRECTORY)
42
    sys.path.insert(0, PROJECT_ROOT_DIRECTORY)
43
if python_path:
89.2.37 by David Planella
Pre-upgrade checkpoint
44
    os.putenv('PYTHONPATH', "%s:%s" % (os.getenv('PYTHONPATH', ''), ':'.join(python_path))) # for subprocesses
1 by David Planella
Initial project creation with Quickly!
45
46
import qreator
47
qreator.main()