Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/taexportlogo.py
diff options
context:
space:
mode:
Diffstat (limited to 'taexportlogo.py')
-rw-r--r--taexportlogo.py28
1 files changed, 27 insertions, 1 deletions
diff --git a/taexportlogo.py b/taexportlogo.py
index 7d8df25..f75dcfc 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 = "\
@@ -96,6 +100,7 @@ tasetshade :shade \r"
arc = 0
heap = 0
write = 0
+ show = 0
minus = 0
image = 0
for b in bs:
@@ -117,8 +122,21 @@ tasetshade :shade \r"
elif write == 1:
this_stack += "labelsize "
this_stack += str(d)
+ write = 0
else:
this_stack += str(d)
+ elif show == 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)
+ show = 0
else:
# transalate some TA terms into UCB Logo
if namedstack == 1:
@@ -235,13 +253,21 @@ tasetshade :shade \r"
this_stack += re.sub("\s"," \"",d[2:])
this_stack += "\r"
elif d == "write":
- this_stack == "label"
+ this_stack += "label"
write = 1
+ elif d == 'show':
+ this_stack += "label"
+ show = 1
+ elif d == "container":
+ if show == 1:
+ show = 2
elif d == "minus":
this_stack == "taminus"
minus = 1
elif d == "hideblocks":
this_stack += " "
+ elif show == 1 and d[0:2] == "#s":
+ this_stack += d[2:]
# need to handle templates somehow
else:
this_stack += d