diff options
Diffstat (limited to 'hello-world')
-rwxr-xr-x | hello-world | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/hello-world b/hello-world new file mode 100755 index 0000000..4c5d900 --- /dev/null +++ b/hello-world @@ -0,0 +1,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 '')) |