Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/hello-world
blob: 4c5d90033fb6fea572e073080e3dc13c5c3fd74a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python
#
# Copyright 2012 Daniel Francis <francis@sugarlabs.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#

import sys
import os
self_path = os.path.abspath(__file__)
print self_path
current_list_dir = os.path.split(self_path)[:-1][0]
print current_list_dir
os.chdir(current_list_dir)
sys.path.append(os.path.join(current_list_dir, 'desktop'))
os.environ['PYTHONPATH'] = ':'.join(sys.path)
os.environ['DATADIR'] = 'programabspath/data'
os.environ['TRANSLATIONDIR'] = 'programabspath/locale'
os.environ['PROGRAMRUNNING'] = 'DESKTOP'
os.environ['ICONDIR'] = 'programabspath/desktop/icons'
os.environ['INFO_L10N'] = '1'
os.system('python application.py %s' % (('"%s"' % sys.argv[1])
                                        if len(sys.argv) > 1 else ''))