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)>2009-05-20 17:24:12 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2009-05-20 17:24:12 (GMT)
commit8576bb27eca580297404d588c212b4cd00b9b28f (patch)
treed05c386f5c6abcfd15fbc3f91d216fc05a920e80
parent92e88341b8dbce661aae0b12e94fcc7b8af8e5ba (diff)
added support for "show"
-rw-r--r--taexportlogo.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/taexportlogo.py b/taexportlogo.py
index 7d8df25..79f55cb 100644
--- a/taexportlogo.py
+++ b/taexportlogo.py
@@ -21,6 +21,10 @@
import tawindow
import talogo
import math
+try:
+ from sugar.datastore import datastore
+except:
+ pass
def save_logo(self, tw):
color_processing = "\
@@ -117,8 +121,21 @@ tasetshade :shade \r"
elif write == 1:
this_stack += "labelsize "
this_stack += str(d)
+ write = 0
else:
this_stack += str(d)
+ elif write == 2:
+ # use title for Journal objects
+ if d[0:8] == '#smedia_':
+ try:
+ dsobject = datastore.get(d[8:])
+ this_stack += dsobject.metadata['title']
+ dsobject.destroy()
+ except:
+ this_stack += str(d)
+ else:
+ this_stack += str(d)
+ write = 0
else:
# transalate some TA terms into UCB Logo
if namedstack == 1:
@@ -234,9 +251,12 @@ tasetshade :shade \r"
this_stack += "sentence "
this_stack += re.sub("\s"," \"",d[2:])
this_stack += "\r"
- elif d == "write":
+ elif d == "write" or d == 'show':
this_stack == "label"
write = 1
+ elif d == "container":
+ if write == 1:
+ write = 2
elif d == "minus":
this_stack == "taminus"
minus = 1