Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/turtleart.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2011-02-23 17:57:36 (GMT)
committer Walter Bender <walter.bender@gmail.com>2011-02-23 17:57:36 (GMT)
commitee166d9f100dcadd620aaba885216b26caf346bc (patch)
treec2eead30279efd6db260c890875aeeba9c0a8d01 /turtleart.py
parent11ecad2144323337aaa3437fc1a2cc4ed05bacaf (diff)
setting correct default paths
Diffstat (limited to 'turtleart.py')
-rwxr-xr-xturtleart.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/turtleart.py b/turtleart.py
index d9a205b..8fdfa9a 100755
--- a/turtleart.py
+++ b/turtleart.py
@@ -45,7 +45,10 @@ sys.argv[1:] = [] # Execution of import gst cannot see '--help' or '-h'
import gettext
-gettext.bindtextdomain('org.laptop.TurtleArtActivity', 'locale')
+# Commenting out bindtextdomain so that GNOME can find the installed .mo files,
+# but it will not find the .mo files in the local locale directory when running
+# from a git repository or the unzipped .xo file.
+# gettext.bindtextdomain('org.laptop.TurtleArtActivity', 'locale')
gettext.textdomain('org.laptop.TurtleArtActivity')
_ = gettext.gettext
@@ -66,8 +69,9 @@ class TurtleMain():
\tturtleart.py project.ta
\tturtleart.py --output_png project.ta
\tturtleart.py -o project"""
- _INSTALL_PATH = '/usr/share/turtleart'
- _ALTERNATE_INSTALL_PATH = '/usr/local/share/turtleart'
+ _INSTALL_PATH = '/usr/share/sugar/activities/TurtleArt.activity'
+ _ALTERNATE_INSTALL_PATH = \
+ '/usr/local/share/sugar/activities/TurtleArt.activity'
_ICON_SUBPATH = 'images/turtle.png'
_GNOME_PLUGIN_SUBPATH = 'gnome_plugins'
@@ -101,11 +105,6 @@ class TurtleMain():
if os.path.exists(path):
return path
path = os.path.expanduser(os.path.join('~', 'Activities',
- 'TurtleBlocks.activity',
- self._GNOME_PLUGIN_SUBPATH))
- if os.path.exists(path):
- return path
- path = os.path.expanduser(os.path.join('~', 'Activities',
'TurtleArt.activity',
self._GNOME_PLUGIN_SUBPATH))
if os.path.exists(path):
@@ -196,7 +195,13 @@ class TurtleMain():
def _init_vars(self):
""" If we are invoked to start a project from Gnome, we should make
sure our current directory is TA's source dir. """
- os.chdir(os.path.dirname(__file__))
+ dirname = os.path.dirname(__file__)
+ if dirname == '':
+ dirname = '.'
+ try:
+ os.chdir(dirname)
+ except OSError:
+ print ("Couldn't chdir to %s" % (dirname))
self.ta_file = None
self.output_png = False