From 1fda2ddaa945c0e070f401d6996b050b6ce9f38a Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Sun, 29 Mar 2009 10:45:44 +0000 Subject: v46 --- diff --git a/NEWS b/NEWS index 118f6f2..52cce59 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ * full screen mode * scrolled window +* better support for running from the command line 45 diff --git a/activity/activity.info b/activity/activity.info index 7bff440..f6f1199 100644 --- a/activity/activity.info +++ b/activity/activity.info @@ -1,6 +1,6 @@ [Activity] name = Turtle Art -activity_version = 45 +activity_version = 46 license = MIT bundle_id = org.laptop.TurtleArtActivity exec = sugar-activity TurtleArtActivity.TurtleArtActivity diff --git a/taexporthtml.py b/taexporthtml.py index 7fa0748..edb2cdf 100644 --- a/taexporthtml.py +++ b/taexporthtml.py @@ -1,4 +1,4 @@ -#Copyright (c) 2007-9, 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 diff --git a/taexportlogo.py b/taexportlogo.py index 5166929..7d8df25 100644 --- a/taexportlogo.py +++ b/taexportlogo.py @@ -1,4 +1,4 @@ -#Copyright (c) 2007-9, 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 @@ -287,9 +287,6 @@ def walk_stack(self, tw, spr): if spr == top: # only walk the stack if the block is the top block code = talogo.run_blocks(tw.lc, top, tawindow.blocks(tw), False) - print ">> " - print code - print " <<" return code else: # not top of stack, then return empty list diff --git a/tasetup.py b/tasetup.py index 30cb79c..b9d42b6 100644 --- a/tasetup.py +++ b/tasetup.py @@ -1,4 +1,5 @@ -#Copyright (c) 2007-9, 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 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 -- cgit v0.9.1