Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter@walter-laptop.(none)>2010-03-01 12:50:39 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2010-03-01 12:50:39 (GMT)
commit44ed1621dff52b3a6e2c89b23e1e6996af3c6a55 (patch)
tree0aee9916893102034f03056a71b87e1f93280fbf
parentd202fbe02a8e0cdfff59745ee401ff536b8ccf27 (diff)
Rainbow work-around for view source
-rw-r--r--TurtleArtActivity.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/TurtleArtActivity.py b/TurtleArtActivity.py
index c74c89e..371b762 100644
--- a/TurtleArtActivity.py
+++ b/TurtleArtActivity.py
@@ -450,8 +450,16 @@ class TurtleArtActivity(activity.Activity):
async_cb(logo_code_path)
def _dump_logo_code(self):
- import tempfile
- tafd, tafile = tempfile.mkstemp(".ta")
+ # work-around Rainbow which doesn't seem to like tempfile.mkstemp
+ try:
+ tmppath = os.path.join(activity.get_activity_root(), "instance")
+ except:
+ # Early versions of Sugar (e.g., 656) didn't support
+ # get_activity_root()
+ tmppath = os.path.join( \
+ os.environ['HOME'], \
+ ".sugar/default/org.laptop.TurtleArtActivity/instance")
+ tafile = os.path.join(tmppath,"tmpfile.ta")
try:
code = save_logo(self, self.tw)
f = file(tafile, "w")