Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Francis <francis@sugarlabs.org>2012-09-01 22:05:17 (GMT)
committer Daniel Francis <francis@sugarlabs.org>2012-09-01 22:05:17 (GMT)
commit2fa8ee6c63ae7ecbbcbe852a53bd159e474e0e18 (patch)
treee9fe64268b0d07bd06c1eae5aee69dd325db4b56
parent63e868a19ee51310774d294d9d4bc31c9d5215c2 (diff)
Abstract launcher
-rwxr-xr-xapplication.py (renamed from hello-integration.py)0
-rwxr-xr-xhello-integration20
2 files changed, 13 insertions, 7 deletions
diff --git a/hello-integration.py b/application.py
index 05b8617..05b8617 100755
--- a/hello-integration.py
+++ b/application.py
diff --git a/hello-integration b/hello-integration
index c5ff714..9a3f500 100755
--- a/hello-integration
+++ b/hello-integration
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env python
#
# Copyright 2012 Daniel Francis <francis@sugarlabs.org>
#
@@ -18,9 +18,15 @@
# MA 02110-1301, USA.
#
-# Don't modify this Script, it's auto-generated.
-
-export PYTHONPATH=$PYTHONPATH:./desktop
-export DATADIR=programabspath/data
-export ICONDIR=programabspath/desktop/icons
-python hello-integration.py
+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['ICONDIR'] = 'programabspath/desktop/icons'
+os.system('python application.py %s' % (('"%s"' % sys.argv[1]) if len(sys.argv) > 1 else ''))