From 569cc12d1e19919f5af44f38331c3a9ad7fe7683 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Sun, 03 May 2009 20:36:16 +0000 Subject: refactoring of media blocks --- (limited to 'svg') diff --git a/svg/makesvg.py b/svg/makesvg.py index fac6771..43f6ca8 100644 --- a/svg/makesvg.py +++ b/svg/makesvg.py @@ -67,14 +67,18 @@ def main(): "remainder.py", \ "repeat.py", \ "right.py", \ + "scale.py", \ "sensorsgroup.py", \ "setcolor.py", \ "seth.py", \ "setpensize.py", \ + "setscale.py", \ "setshade.py", \ "settextcolor.py", \ + "settextsize.py", \ "setxy.py", \ "shade.py", \ + "show.py", \ "sound.py", \ "stack1.py", \ "stack2.py", \ @@ -83,6 +87,8 @@ def main(): "storeinbox1.py", \ "storeinbox2.py", \ "templatesgroup.py", \ + "textcolor.py", \ + "textsize.py", \ "turtlegroup.py", \ "vres.py", \ "wait.py", \ diff --git a/svg/pengroup.py b/svg/pengroup.py index ac05797..88069d5 100644 --- a/svg/pengroup.py +++ b/svg/pengroup.py @@ -47,7 +47,10 @@ def main(): mystring8 = _("pen size") mystring9 = _("color") mystring10 = _("shade") - mystring11 = _("set text color") + mystring11 = _("set text size") + mystring12 = _("set text color") + mystring13 = _("text color") + mystring14 = _("text size") mygroup = "pen" print mystring1 @@ -61,247 +64,321 @@ def main(): print mystring9 print mystring10 print mystring11 + print mystring12 + print mystring13 + print mystring14 data0 = \ -" \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - X \n \ - \n \ - \n \ - \n \ +\n \ +\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + X\n \ + \n \ + \n \ + " data1 = \ -" \n \ - \n \ - \n " +"\n \ + \n \ + \n \ + \n" data2a = \ -" \n \ - " +" \n \ + " data2b = \ " " data3b = \ @@ -322,26 +398,24 @@ def main(): " data4 = \ -" \n \ - \n \ - \n " +"\n \ + \n \ + \n \ + \n \ + \n" data5a = \ -" \n \ - " +" \n \ + " data5b = \ " " data6b = \ @@ -362,34 +435,31 @@ def main(): " data7 = \ -" \n \ - \n \ - \n \ - \n \ - \n " +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n" data8a = \ -" \n \ - " +" \n \ + " data8b = \ " " data8c = \ @@ -407,8 +476,7 @@ def main(): style=\"font-size:12px;text-align:center;text-anchor:middle;font-family:Bitstream Vera Sans\"> \n \ " data9b = \ @@ -420,7 +488,6 @@ def main(): " data9c = \ @@ -431,8 +498,7 @@ def main(): style=\"font-size:12px;text-align:center;text-anchor:middle;font-family:Bitstream Vera Sans\"> \n \ " data10c = \ @@ -443,35 +509,32 @@ def main(): style=\"font-size:12px;text-align:center;text-anchor:middle;font-family:Bitstream Vera Sans\"> \n \ " data11 = \ -" \n \ - \n \ - \n \ - \n \ - \n " +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n" data12a = \ -" \n \ - " +" \n \ + " data12b = \ " " data13b =\ @@ -492,34 +554,31 @@ def main(): " data14 = \ -" \n \ - \n \ - \n \ - \n \ - \n " +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n" data15a = \ -" \n \ - " +" \n \ + " data15b = \ " \n \ " @@ -539,33 +598,31 @@ def main(): style=\"font-size:12px;text-align:center;text-anchor:middle;font-family:Bitstream Vera Sans\"> \n \ " data17 = \ -" \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ \n \ @@ -612,111 +669,179 @@ def main(): style=\"font-size:8px\">" data21 = \ -" \n \ - \n \ - \n \ - \n \ - " +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " data22 = \ -" \n \ - \n \ - \n \ - \n \ - " +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " data23 = \ -" \n \ - \n \ - \n \ - \n \ - " +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " data24 = \ -" \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - " +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " data25 = \ -" \n \ - \n \ - \n \ - " +"\n \ + \n \ + \n \ + " data26 = \ -" \n \ - \n \ - \n \ - " +"\n \ + \n \ + \n \ + " data27 = \ +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data28 = \ +"\n \ + \n \ + \n \ + " + + data29 = \ +"\n \ + \n \ + \n \ + " + + data30 = \ +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data31 = \ +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data32 = \ " \n \ \n \ + \n \ \n " @@ -814,6 +939,19 @@ def main(): if len(strings) > 2: FILE.write(strings[2].encode("utf-8")) FILE.write(data27) + strings = mystring12.split(" ",3) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data28) + if len(strings) > 1: + FILE.write(strings[1].encode("utf-8")) + FILE.write(data29) + if len(strings) > 2: + FILE.write(strings[2].encode("utf-8")) + FILE.write(data30) + FILE.write(mystring13.encode("utf-8")) + FILE.write(data31) + FILE.write(mystring14.encode("utf-8")) + FILE.write(data32) FILE.close() return diff --git a/svg/random.pyc b/svg/random.pyc deleted file mode 100644 index 2135ec5..0000000 --- a/svg/random.pyc +++ /dev/null Binary files differ diff --git a/svg/scale.py b/svg/scale.py new file mode 100644 index 0000000..954cd77 --- /dev/null +++ b/svg/scale.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +#Copyright (c) 2009, Sugar Labs + +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: + +#The above copyright notice and this permission notice shall be included in +#all copies or substantial portions of the Software. + +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +#THE SOFTWARE. + +import sys +import os +import os.path +import gettext + +def main(): + + myname = "scale" + if len(sys.argv) != 2: + print "Error: Usage is " + myname + ".py lang" + return + + t = gettext.translation("org.laptop.TurtleArtActivity", "../locale", languages=[sys.argv[1]]) + _ = t.ugettext + t.install() + + mystring = _("scale") + mygroup = "turtle" + + print mystring + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data1 = \ +" \n \ + \n \ + \n" + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname + ".svg"), "w") + FILE.write(data0) + FILE.write(mystring.encode("utf-8")) + FILE.write(data1) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/setscale.py b/svg/setscale.py new file mode 100644 index 0000000..cf9d9cd --- /dev/null +++ b/svg/setscale.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +#Copyright (c) 2009, Sugar Labs + +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: + +#The above copyright notice and this permission notice shall be included in +#all copies or substantial portions of the Software. + +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +#THE SOFTWARE. + +import sys +import os +import os.path +import gettext + +def main(): + + myname = "setscale" + if len(sys.argv) != 2: + print "Error: Usage is " + myname + ".py lang" + return + + t = gettext.translation("org.laptop.TurtleArtActivity", "../locale", languages=[sys.argv[1]]) + _ = t.ugettext + t.install() + + mystring1 = _("set scale") + mygroup = "turtle" + + print _(mystring1) + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n " + data1a = \ +" \n \ + " + + data1b = \ +" \n \ + " + + data2b = \ +" \n \ + \n \ + \n \ + " + + data3 = \ +" \n \ + \n \ + \n " + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname + ".svg"), "w") + FILE.write(data0) + strings = mystring1.split(" ",2) + if len(strings) == 1: + FILE.write(data1a) + FILE.write(strings[0].encode("utf-8")) + else: + FILE.write(data1b) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data2b) + FILE.write(strings[1].encode("utf-8")) + FILE.write(data3) + FILE.close() + return + +if __name__ == "__main__": + main() + diff --git a/svg/settextsize.py b/svg/settextsize.py new file mode 100644 index 0000000..1f2481e --- /dev/null +++ b/svg/settextsize.py @@ -0,0 +1,170 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +#Copyright (c) 2009, Sugar Labs + +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: + +#The above copyright notice and this permission notice shall be included in +#all copies or substantial portions of the Software. + +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +#THE SOFTWARE. + +import sys +import os +import os.path +import gettext + +def main(): + + myname = "settextsize" + if len(sys.argv) != 2: + print "Error: Usage is " + myname + ".py lang" + return + + t = gettext.translation("org.laptop.TurtleArtActivity", "../locale", languages=[sys.argv[1]]) + _ = t.ugettext + t.install() + + mystring1 = _("set text size") + mygroup = "pen" + + print mystring1 + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n " + data1a = \ +" \n \ + " + + data1b = \ +" \n \ + " + + data1c = \ +" \n \ + " + + data2b = \ +" \n \ + \n \ + \n \ + " + + data2c = \ +" \n \ + \n \ + \n \ + " + + data3c = \ +" \n \ + \n \ + \n \ + " + + data4 = \ +" \n \ + \n \ + \n" + + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname + ".svg"), "w") + FILE.write(data0) + strings = mystring1.split(" ",2) + if len(strings) == 1: + FILE.write(data1a) + FILE.write(strings[0].encode("utf-8")) + elif len(strings) == 2: + FILE.write(data1b) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data2b) + FILE.write(strings[1].encode("utf-8")) + else: + FILE.write(data1c) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data2c) + FILE.write(strings[1].encode("utf-8")) + FILE.write(data3c) + FILE.write(strings[2].encode("utf-8")) + FILE.write(data4) + FILE.close() + return + +if __name__ == "__main__": + main() + diff --git a/svg/show.py b/svg/show.py new file mode 100644 index 0000000..e767555 --- /dev/null +++ b/svg/show.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +#Copyright (c) 2009, Sugar Labs + +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: + +#The above copyright notice and this permission notice shall be included in +#all copies or substantial portions of the Software. + +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +#THE SOFTWARE. + +import sys +import os +import os.path +import gettext + +def main(): + + myname = "show" + if len(sys.argv) != 2: + print "Error: Usage is " + myname + ".py lang" + return + + t = gettext.translation("org.laptop.TurtleArtActivity", "../locale", languages=[sys.argv[1]]) + _ = t.ugettext + t.install() + + mystring1 = _("show") + mygroup = "turtle" + + print _(mystring1) + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n " + data1a = \ +" \n \ + " + + data1b = \ +" \n \ + " + + data2b = \ +" \n \ + \n \ + \n \ + " + + data3 = \ +" \n \ + \n \ + \n " + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname + ".svg"), "w") + FILE.write(data0) + strings = mystring1.split(" ",2) + if len(strings) == 1: + FILE.write(data1a) + FILE.write(strings[0].encode("utf-8")) + else: + FILE.write(data1b) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data2b) + FILE.write(strings[1].encode("utf-8")) + FILE.write(data3) + FILE.close() + return + +if __name__ == "__main__": + main() + diff --git a/svg/templatesgroup.py b/svg/templatesgroup.py index 1ba6929..5638ef9 100644 --- a/svg/templatesgroup.py +++ b/svg/templatesgroup.py @@ -39,263 +39,392 @@ def main(): mystring1 = _("Templates") mystring2 = _("hide blocks") - mystring3 = _("sound") mygroup = "templates" print mystring1 print mystring2 - print mystring3 data0 = \ -" \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - X \n \ - \n \ - \n \ +\n \ +\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + X\n \ + \n \ + " data1 = \ -" \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n" +"\n \ + \n \ + \n " data2a = \ -" \n \ - \n \ + " data2b = \ -" \n \ - \n \ + " data3b = \ @@ -305,364 +434,409 @@ def main(): style=\"font-size:12.06000042px;text-align:center;text-anchor:middle;font-family:Bitstream Vera Sans\"> \n \ " data4 = \ -" \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - " - - data5 = \ -" \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n " +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ +" FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname + ".svg"), "w") FILE.write(data0) @@ -678,8 +852,6 @@ def main(): FILE.write(data3b) FILE.write(strings[1].encode("utf-8")) FILE.write(data4) - FILE.write(mystring3.encode("utf-8")) - FILE.write(data5) FILE.close() return diff --git a/svg/textcolor.py b/svg/textcolor.py new file mode 100644 index 0000000..9d8bcb9 --- /dev/null +++ b/svg/textcolor.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +#Copyright (c) 2009, Sugar Labs + +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: + +#The above copyright notice and this permission notice shall be included in +#all copies or substantial portions of the Software. + +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +#THE SOFTWARE. + +import sys +import os +import os.path +import gettext + +def main(): + + myname = "textcolor" + if len(sys.argv) != 2: + print "Error: Usage is " + myname + ".py lang" + return + + t = gettext.translation("org.laptop.TurtleArtActivity", "../locale", languages=[sys.argv[1]]) + _ = t.ugettext + t.install() + + mystring = _("text color") + mygroup = "pen" + + print mystring + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data1 = \ +" \n \ + \n \ + \n " + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname + ".svg"), "w") + FILE.write(data0) + FILE.write(mystring.encode("utf-8")) + FILE.write(data1) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/textsize.py b/svg/textsize.py new file mode 100644 index 0000000..0a68a6f --- /dev/null +++ b/svg/textsize.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +#Copyright (c) 2009, Sugar Labs + +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: + +#The above copyright notice and this permission notice shall be included in +#all copies or substantial portions of the Software. + +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +#THE SOFTWARE. + +import sys +import os +import os.path +import gettext + +def main(): + + myname = "textsize" + if len(sys.argv) != 2: + print "Error: Usage is " + myname + ".py lang" + return + + t = gettext.translation("org.laptop.TurtleArtActivity", "../locale", languages=[sys.argv[1]]) + _ = t.ugettext + t.install() + + mystring = _("text size") + mygroup = "pen" + + print mystring + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data1 = \ +" \n \ + \n \ + \n " + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname + ".svg"), "w") + FILE.write(data0) + FILE.write(mystring.encode("utf-8")) + FILE.write(data1) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/turtlegroup.py b/svg/turtlegroup.py index 847dd70..3b59e85 100644 --- a/svg/turtlegroup.py +++ b/svg/turtlegroup.py @@ -53,6 +53,9 @@ def main(): mystring14 = _("ycor") mystring15 = _("heading") mystring16 = _("Turtle") + mystring17 = _("show") + mystring18 = _("set scale") + mystring19 = _("scale") mygroup = "turtle" print mystring1 @@ -71,644 +74,691 @@ def main(): print mystring14 print mystring15 print mystring16 + print mystring17 + print mystring18 + print mystring19 data0 = \ -" \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - X \n \ - \n \ - \n \ - \n \ - " +"\n \ +\n \ +\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + X\n \ + \n \ + \n \ + \n \ + " data1 = \ -" \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - " +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " data2 = \ -" \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - " +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " data3 = \ -" \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - " +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " data4 = \ -" \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - " +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " data5 = \ -" \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - " +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " data6 = \ -" \n \ - \n \ - \n \ - " +"\n \ + \n \ + \n \ + " data7 = \ -" \n \ - " +"\n \ + " data8 = \ -" \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - " +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " data9 = \ -" \n \ - \n \ - \n \ - " +"\n \ + \n \ + \n \ + " data10 = \ -" \n \ - " +"\n \ + " data11 = \ -" \n \ - \n \ - \n \ - \n \ - \n" - +"\n \ + \n \ + \n \ + \n \ + \n \ + \n" data12a = \ -" \n \ - " +" \n \ + " data12b = \ " \n \ + style=\"font-size:8px;text-align:center;text-anchor:middle;font-family:Bitstream Vera Sans\"> \n \ " data13b = \ " \n \ \n \ \n \ + style=\"font-size:8px;text-align:center;text-anchor:middle;font-family:Bitstream Vera Sans\"> \n \ " data14 = \ -" \n \ - \n \ - \n \ - \n \ - " +"\n \ + \n \ + \n \ + \n \ + \n \ + " data15 = \ -" \n \ - \n \ - \n \ - \n \ - " +"\n \ + \n \ + \n \ + \n \ + " data16 = \ -" \n \ - \n \ - \n \ - \n \ - \n \ + \n \ + \n \ + \n \ + " data17 = \ -" \n \ - \n \ - \n \ - \n \ + \n \ + \n \ + " data18 = \ -" \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n \ - \n " - +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data19 = \ +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n" + + data19a = \ +" \n \ + " + + data19b = \ +" \n \ + " + + data19c = \ +"\n \ + \n \ + \n \ + " + + data20 = \ +"\n \ + \n \ + \n \ + \n \ + \n \ + " + + data21 = \ +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ +" FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname + ".svg"), "w") FILE.write(data0) @@ -752,6 +802,20 @@ def main(): FILE.write(data17) FILE.write(mystring16.encode("utf-8")) FILE.write(data18) + FILE.write(mystring17.encode("utf-8")) + FILE.write(data19) + strings = mystring18.split(" ",2) + if len(strings) == 1: + FILE.write(data19a) + FILE.write(strings[0].encode("utf-8")) + else: + FILE.write(data19b) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data19c) + FILE.write(strings[1].encode("utf-8")) + FILE.write(data20) + FILE.write(mystring19.encode("utf-8")) + FILE.write(data21) FILE.close() return -- cgit v0.9.1