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@walter-laptop.(none)>2009-03-29 10:45:44 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2009-03-29 10:45:44 (GMT)
commit1fda2ddaa945c0e070f401d6996b050b6ce9f38a (patch)
treeef4f4e0a80d3fe79333b5f8b3900131ec6b70a40 /turtleart.py
parent2bc8c0abdcfc982c7c53a903b38cde1a17046cde (diff)
v46v46
Diffstat (limited to 'turtleart.py')
-rwxr-xr-xturtleart.py33
1 files changed, 29 insertions, 4 deletions
diff --git a/turtleart.py b/turtleart.py
index 0561787..a2cefab 100755
--- a/turtleart.py
+++ b/turtleart.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python
-#Copyright (c) 2007-8, Playful Invention Company.
+#Copyright (c) 2007-8, Playful Invention Company
+#Copyright (c) 2008-9, Walter Bender
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
@@ -28,12 +29,36 @@ import os.path
from tawindow import *
+"""
+Make a path if it doesn't previously exist
+"""
+def makepath(path):
+
+ from os import makedirs
+ from os.path import normpath, dirname, exists
+
+ dpath = normpath(dirname(path))
+ if not exists(dpath): makedirs(dpath)
+
+"""
+Launch Turtle Art from outside of Sugar
+$ python turtleart.py
+
+Caveats:
+ * no Sugar toolbars
+ * no Sugar Journal access
+ * no Sugar sharing
+"""
def main():
+ # make sure Sugar paths are present
+ tapath = os.path.join(os.environ['HOME'],'.sugar','default', \
+ 'org.laptop.TurtleArtActivity')
+ map (makepath, (os.path.join(tapath,'data/'), \
+ os.path.join(tapath,'instance/')))
+
win1 = gtk.Window(gtk.WINDOW_TOPLEVEL)
- twNew(win1, os.path.abspath('.'),'es')
+ twNew(win1, os.path.abspath('.'),os.environ['LANG'])
win1.connect("destroy", lambda w: gtk.main_quit())
-# win2 = gtk.Window(gtk.WINDOW_TOPLEVEL)
-# twNew(win2, os.path.abspath('.'))
gtk.main()
return 0