Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/taexportpython.py
diff options
context:
space:
mode:
Diffstat (limited to 'TurtleArt/taexportpython.py')
-rw-r--r--TurtleArt/taexportpython.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/TurtleArt/taexportpython.py b/TurtleArt/taexportpython.py
index 1ed1ac5..819682e 100644
--- a/TurtleArt/taexportpython.py
+++ b/TurtleArt/taexportpython.py
@@ -39,6 +39,25 @@ from tawindow import plugins_in_use
_SETUP_CODE_START = """\
#!/usr/bin/env python
+_INSTALL_PATH = '/usr/share/sugar/activities/TurtleArt.activity'
+_ALTERNATIVE_INSTALL_PATH = \
+ '/usr/local/share/sugar/activities/TurtleArt.activity'
+
+import os, sys
+if os.path.exists('../TurtleBlocks.activity'):
+ sys.path.append('../TurtleBlocks.activity')
+elif os.path.exists(os.path.join(os.path.expanduser('~'), 'Activities',
+ 'TurtleBlocks.activity')):
+ sys.path.append(os.path.join(os.path.expanduser('~'), 'Activities',
+ 'TurtleBlocks.activity'))
+elif os.path.exists(_INSTALL_PATH):
+ sys.path.append(_INSTALL_PATH)
+elif os.path.exists(_ALTERNATIVE_INSTALL_PATH):
+ sys.path.append(_ALTERNATIVE_INSTALL_PATH)
+else:
+ print 'This code require the TurtleBlocks activity to be installed.'
+ exit(1)
+
from time import *
from random import uniform
from math import *