From ff19280d3496f5ab5f2d3f45e688faf2371fa914 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Fri, 20 Feb 2009 15:22:56 +0000 Subject: adding python code to generate svg files from .po --- (limited to 'svg') diff --git a/svg/and.py b/svg/and.py new file mode 100644 index 0000000..af76ccc --- /dev/null +++ b/svg/and.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 = "and" + mystring = "and" + mygroup = "numbers" + + 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() + + print _(mystring) + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data1 = \ +" \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/arc.py b/svg/arc.py new file mode 100644 index 0000000..c178803 --- /dev/null +++ b/svg/arc.py @@ -0,0 +1,134 @@ +#!/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 = "arc" + mystring1 = "arc" + mystring2 = "angle" + mystring3 = "radius" + mygroup = "turtle" + + 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() + + print _(mystring1) + print _(mystring2) + print _(mystring3) + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data1 = \ +" \n \ + \n \ + " + + data2 = \ +" \n \ + \n \ + " + + data3 = \ +" \n \ + \n " + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname + ".svg"), "w") + FILE.write(data0) + FILE.write(_(mystring1).encode("utf-8")) + FILE.write(data1) + FILE.write(_(mystring2).encode("utf-8")) + FILE.write(data2) + FILE.write(_(mystring3).encode("utf-8")) + FILE.write(data3) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/back.py b/svg/back.py new file mode 100644 index 0000000..0ec4436 --- /dev/null +++ b/svg/back.py @@ -0,0 +1,102 @@ +#!/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 = "back" + mystring = "back" + mygroup = "turtle" + + 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() + + print _(mystring) + + data0 = \ +" \n \ + \n \ + \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/box1.py b/svg/box1.py new file mode 100644 index 0000000..e3e7a2a --- /dev/null +++ b/svg/box1.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 = "box1" + mystring = "box 1" + mygroup = "myblocks" + + 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() + + 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/box2.py b/svg/box2.py new file mode 100644 index 0000000..016b303 --- /dev/null +++ b/svg/box2.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 = "box2" + mystring = "box 2" + mygroup = "myblocks" + + 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() + + 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/clearheap.py b/svg/clearheap.py new file mode 100644 index 0000000..88891ee --- /dev/null +++ b/svg/clearheap.py @@ -0,0 +1,125 @@ +#!/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 = "clearheap" + mystring = "clear heap" + mygroup = "myblocks" + + 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() + + print _(mystring) + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n " + + data1a = \ +" \n \ + " + + data1b = \ +" \n \ + " + + data1c = \ +" \n \ + \n \ + \n \ + " + + data2 = \ +" \n \ + \n \ + \n" + + strings = _(mystring).split(" ",2) + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname+".svg"), "w") + FILE.write(data0) + 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(data1c) + FILE.write(strings[1].encode("utf-8")) + FILE.write(data2) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/color.py b/svg/color.py new file mode 100644 index 0000000..f54171c --- /dev/null +++ b/svg/color.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 = "color" + mystring = "color" + mygroup = "pen" + + 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() + + 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/fillscreen.py b/svg/fillscreen.py new file mode 100644 index 0000000..d17dd2e --- /dev/null +++ b/svg/fillscreen.py @@ -0,0 +1,144 @@ +#!/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 = "fillscreen" + mystring1 = "fill screen" + mystring2 = "color" + mystring3 = "shade" + mygroup = "pen" + + 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() + + print _(mystring1) + print _(mystring2) + print _(mystring3) + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data1 = \ +"" + + data2 = \ +" \n \ + \n \ + " + + data3 = \ +" \n \ + \n \ + " + + data4 = \ +" \n \ + \n " + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname + ".svg"), "w") + FILE.write(data0) + strings = _(mystring1).split(" ",2) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data1) + if len(strings) == 2: + FILE.write(strings[1].encode("utf-8")) + FILE.write(data2) + FILE.write(_(mystring2).encode("utf-8")) + FILE.write(data3) + FILE.write(_(mystring3).encode("utf-8")) + FILE.write(data4) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/flowgroup.py b/svg/flowgroup.py new file mode 100644 index 0000000..9e1be37 --- /dev/null +++ b/svg/flowgroup.py @@ -0,0 +1,515 @@ +#!/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 = "flowgroup" + mystring1 = "Flow" + mystring2 = "wait" + mystring3 = "forever" + mystring4 = "repeat" + mystring5 = "if" + mystring6 = "then" + mystring7 = "else" + mystring8 = "stop stack" + mygroup = "flow" + + 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() + + print _(mystring1) + print _(mystring2) + print _(mystring3) + print _(mystring4) + print _(mystring5) + print _(mystring6) + print _(mystring7) + print _(mystring8) + + 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 \ + X\n \ + \n \ + \n \ + " + + data1 = \ +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data2 = \ +"\n \ + \n \ + \n " + + data2a = \ +" \n \ + " + + data2b = \ +" \n \ + " + + data2c = \ +"\n \ + \n \ + \n \ + " + + data3 = \ +"\n \ + \n \ + \n \ + \n \ + " + + data4 = \ +"\n \ + \n \ + \n \ + \n \ + " + + data5 = \ +"\n \ + \n \ + \n \ + " + + data6 = \ +"\n \ + \n \ + \n \ + \n \ + " + + data7 = \ +"\n \ + \n \ + \n \ + " + + data8 = \ +"\n \ + \n \ + \n \ + \n \ + " + + data9 = \ +"\n \ + \n \ + \n \ + " + + data10 = \ +"\n \ + \n \ + \n \ + " + + data11 = \ +"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ +\n" + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname+".svg"), "w") + FILE.write(data0) + FILE.write(_(mystring1).encode("utf-8")) + FILE.write(data1) + FILE.write(_(mystring2).encode("utf-8")) + FILE.write(data2) + strings = _(mystring3).split(" ",2) + if len(strings) == 1: + FILE.write(data2a) + FILE.write(strings[0].encode("utf-8")) + else: + FILE.write(data2b) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data2c) + FILE.write(strings[1].encode("utf-8")) + FILE.write(data3) + FILE.write(_(mystring4).encode("utf-8")) + FILE.write(data4) + FILE.write(_(mystring5).encode("utf-8")) + FILE.write(data5) + FILE.write(_(mystring6).encode("utf-8")) + FILE.write(data6) + strings = _(mystring8).split(" ",2) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data7) + if len(strings) == 2: + FILE.write(strings[1].encode("utf-8")) + FILE.write(data8) + FILE.write(_(mystring5).encode("utf-8")) + FILE.write(data9) + FILE.write(_(mystring6).encode("utf-8")) + FILE.write(data10) + FILE.write(_(mystring7).encode("utf-8")) + FILE.write(data11) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/forever.py b/svg/forever.py new file mode 100644 index 0000000..ae672bc --- /dev/null +++ b/svg/forever.py @@ -0,0 +1,123 @@ +#!/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 = "forever" + mystring = "forever" + mygroup = "flow" + + 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() + + print _(mystring) + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n" + + data1 = \ +" \n \ + " + + data1a = \ +" \n \ + " + + data2a = \ +" \n \ + \n \ + " + + data3 = \ +" \n \ + \n" + + strings = _(mystring).split(" ",2) + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname + ".svg"), "w") + FILE.write(data0) + if len(strings) == 1: + FILE.write(data1) + FILE.write(strings[0].encode("utf-8")) + else: + FILE.write(data1a) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data2a) + FILE.write(strings[1].encode("utf-8")) + FILE.write(data3) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/forward.py b/svg/forward.py new file mode 100644 index 0000000..4162c98 --- /dev/null +++ b/svg/forward.py @@ -0,0 +1,102 @@ +#!/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 = "forward" + mystring = "forward" + mygroup = "turtle" + + 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() + + print _(mystring) + + data0 = \ +" \n \ + \n \ + \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/hat1.py b/svg/hat1.py new file mode 100644 index 0000000..ba9a2d3 --- /dev/null +++ b/svg/hat1.py @@ -0,0 +1,109 @@ +#!/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 = "hat1" + mystring = "stack 1" + mygroup = "myblocks" + + 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() + + print _(mystring) + + data0 = \ +" \n \ + \n \ + \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/hat2.py b/svg/hat2.py new file mode 100644 index 0000000..eb67702 --- /dev/null +++ b/svg/hat2.py @@ -0,0 +1,109 @@ +#!/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 = "hat2" + mystring = "stack 2" + mygroup = "myblocks" + + 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() + + print _(mystring) + + data0 = \ +" \n \ + \n \ + \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/heading.py b/svg/heading.py new file mode 100644 index 0000000..84450bc --- /dev/null +++ b/svg/heading.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 = "heading" + mystring = "heading" + mygroup = "turtle" + + 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() + + 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/hideblocks.py b/svg/hideblocks.py new file mode 100644 index 0000000..2fc5b16 --- /dev/null +++ b/svg/hideblocks.py @@ -0,0 +1,127 @@ +#!/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 = "hideblocks" + mystring1 = "hide blocks" + mygroup = "templates" + + 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() + + print _(mystring1) + + data0 = \ +" \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/hres.py b/svg/hres.py new file mode 100644 index 0000000..ecc1d35 --- /dev/null +++ b/svg/hres.py @@ -0,0 +1,104 @@ +#!/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 = "hres" + mystring = "hres" + mygroup = "sensors" + + 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() + + print _(mystring) + data0 = \ +" \n \ + \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/if.py b/svg/if.py new file mode 100644 index 0000000..e95aa51 --- /dev/null +++ b/svg/if.py @@ -0,0 +1,109 @@ +#!/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 = "if" + mystring1 = "if" + mystring2 = "then" + mygroup = "flow" + + 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() + + print _(mystring1) + print _(mystring2) + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data1 = \ +" \n \ + \n \ + " + + data2 = \ +" \n \ + \n" + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname+".svg"), "w") + FILE.write(data0) + FILE.write(_(mystring1).encode("utf-8")) + FILE.write(data1) + FILE.write(_(mystring2).encode("utf-8")) + FILE.write(data2) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/ifelse.py b/svg/ifelse.py new file mode 100644 index 0000000..a18118c --- /dev/null +++ b/svg/ifelse.py @@ -0,0 +1,122 @@ +#!/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 = "ifelse" + mystring1 = "if" + mystring2 = "then" + mystring3 = "else" + mygroup = "flow" + + 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() + + print _(mystring1) + print _(mystring2) + print _(mystring3) + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data1 = \ +" \n \ + \n \ + " + + data2 = \ +" \n \ + \n \ + " + + data3 = \ +" \n \ +" + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname+".svg"), "w") + FILE.write(data0) + FILE.write(_(mystring1).encode("utf-8")) + FILE.write(data1) + FILE.write(_(mystring2).encode("utf-8")) + FILE.write(data2) + FILE.write(_(mystring3).encode("utf-8")) + FILE.write(data3) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/kbinput.py b/svg/kbinput.py new file mode 100644 index 0000000..c0de47b --- /dev/null +++ b/svg/kbinput.py @@ -0,0 +1,138 @@ +#!/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 = "kbinput" + mystring1 = "read key" + mygroup = "sensors" + + 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() + + print _(mystring1) + + data0 = \ +" \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/keyboard.py b/svg/keyboard.py new file mode 100644 index 0000000..a1a2634 --- /dev/null +++ b/svg/keyboard.py @@ -0,0 +1,104 @@ +#!/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 = "keyboard" + mystring = "keyboard" + mygroup = "sensors" + + 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() + + print _(mystring) + data0 = \ +" \n \ + \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/left.py b/svg/left.py new file mode 100644 index 0000000..b01ab0b --- /dev/null +++ b/svg/left.py @@ -0,0 +1,102 @@ +#!/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 = "left" + mystring = "left" + mygroup = "turtle" + + 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() + + print _(mystring) + + data0 = \ +" \n \ + \n \ + \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/myblocksgroup.py b/svg/myblocksgroup.py new file mode 100644 index 0000000..66a37ef --- /dev/null +++ b/svg/myblocksgroup.py @@ -0,0 +1,963 @@ +#!/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 = "myblocksgroup" + mystring1 = "My Blocks" + mystring2 = "stack 1" + mystring3 = "stack 2" + mystring4 = "store in box 1" + mystring5 = "box 1" + mystring6 = "store in box 2" + mystring7 = "box 2" + mystring8 = "push" + mystring9 = "pop" + mystring10 = "show heap" + mystring11 = "clear heap" + mystring12 = "name" + mystring13 = "start" + mygroup = "myblocks" + + 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() + + print _(mystring1) + print _(mystring2) + print _(mystring3) + print _(mystring4) + print _(mystring5) + print _(mystring6) + print _(mystring7) + print _(mystring8) + print _(mystring9) + print _(mystring10) + print _(mystring11) + print _(mystring12) + print _(mystring13) + + 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 \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + X \n \ + \n \ + \n \ + " + + data1 = \ +" \n \ + \n \ + \n \ + \n \ + " + + data2 = \ +" \n \ + \n \ + \n \ + \n \ + " + + data3 = \ +" \n \ + \n \ + \n \ + \n \ + " + + data4 = \ +" \n \ + \n \ + \n \ + \n \ + " + + data5 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n " + + data6a = \ +" \n \ + " + + data6b = \ +" \n \ + " + + data6c = \ +" \n \ + " + + + data7b = \ +" \n \ + \n \ + \n \ + " + + data7c = \ +" \n \ + \n \ + \n \ + " + + data8c = \ +" \n \ + \n \ + \n \ + " + + data9 = \ +" \n \ + \n \ + \n \ + \n \ + " + + data10 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n " + + data11a = \ +" \n \ + " + + data11b = \ +" \n \ + " + + data11c = \ +" \n \ + " + + data12b = \ +" \n \ + \n \ + \n \ + " + + data12c = \ +" \n \ + \n \ + \n \ + " + + data13c = \ +" \n \ + \n \ + \n \ + " + + data14 = \ +" \n \ + \n \ + \n \ + \n \ + " + + data15 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data16 = \ +" \n \ + \n \ + \n \ + \n \ + " + + data17 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + " + + data18 = \ +" \n \ + \n \ + \n \ + " + + data19 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data20 = \ +" \n \ + \n \ + \n \ + " + + data21 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data22 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data23 = \ +" \n \ + \n \ + \n" + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname+".svg"), "w") + FILE.write(data0) + FILE.write(_(mystring1).encode("utf-8")) + FILE.write(data1) + FILE.write(_(mystring2).encode("utf-8")) + FILE.write(data2) + FILE.write(_(mystring2).encode("utf-8")) + FILE.write(data3) + FILE.write(_(mystring3).encode("utf-8")) + FILE.write(data4) + FILE.write(_(mystring3).encode("utf-8")) + FILE.write(data5) + strings = _(mystring4).split(" ",3) + if len(strings) == 1: + FILE.write(data6a) + FILE.write(strings[0].encode("utf-8")) + elif len(strings) == 2: + FILE.write(data6b) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data7b) + FILE.write(strings[1].encode("utf-8")) + else: + FILE.write(data6c) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data7c) + FILE.write(strings[1].encode("utf-8")) + FILE.write(data8c) + FILE.write(strings[2].encode("utf-8")) + if len(strings) == 4: + FILE.write(" " + strings[3].encode("utf-8")) + FILE.write(data9) + FILE.write(_(mystring5).encode("utf-8")) + FILE.write(data10) + strings = _(mystring6).split(" ",3) + if len(strings) == 1: + FILE.write(data11a) + FILE.write(strings[0].encode("utf-8")) + elif len(strings) == 2: + FILE.write(data11b) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data12b) + FILE.write(strings[1].encode("utf-8")) + else: + FILE.write(data11c) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data12c) + FILE.write(strings[1].encode("utf-8")) + FILE.write(data13c) + FILE.write(strings[2].encode("utf-8")) + if len(strings) == 4: + FILE.write(" " + strings[3].encode("utf-8")) + FILE.write(data14) + FILE.write(_(mystring7).encode("utf-8")) + FILE.write(data15) + FILE.write(_(mystring8).encode("utf-8")) + FILE.write(data16) + FILE.write(_(mystring9).encode("utf-8")) + FILE.write(data17) + strings = _(mystring10).split(" ",2) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data18) + if len(strings) == 2: + FILE.write(strings[1].encode("utf-8")) + FILE.write(data19) + strings = _(mystring11).split(" ",2) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data20) + if len(strings) == 2: + FILE.write(strings[1].encode("utf-8")) + FILE.write(data21) + FILE.write(_(mystring12).encode("utf-8")) + FILE.write(data22) + FILE.write(_(mystring13).encode("utf-8")) + FILE.write(data23) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/not.py b/svg/not.py new file mode 100644 index 0000000..251593e --- /dev/null +++ b/svg/not.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 = "not" + mystring = "not" + mygroup = "numbers" + + 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() + + print _(mystring) + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data1 = \ +" \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/numbersgroup.py b/svg/numbersgroup.py new file mode 100644 index 0000000..075e5b5 --- /dev/null +++ b/svg/numbersgroup.py @@ -0,0 +1,880 @@ +#!/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 = "numbersgroup" + mystring1 = "Numbers" + mystring2 = "random" + mystring3 = "and" + mystring4 = "or" + mystring5 = "not" + mystring6 = "print" + mystring7 = "number" + mystring8 = "min" + mystring9 = "max" + mystring10 = "mod" + mygroup = "numbers" + + 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() + + print _(mystring1) + print _(mystring2) + print _(mystring3) + print _(mystring4) + print _(mystring5) + print _(mystring6) + print _(mystring7) + print _(mystring8) + print _(mystring9) + print _(mystring10) + + 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 \ + \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 \ + \n \ + \n \ + \n \ + \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 \ + < \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + > \n \ + \n \ + \n \ + \n \ + " + + data3 = \ +" \n \ + \n \ + \n \ + \n \ + " + + data4 = \ +" \n \ + \n \ + \n \ + \n \ + " + + data5 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data6 = \ +" \n \ + \n \ + \n \ + " + + data7 = \ +" \n \ + \n \ + \n \ + " + + data8 = \ +" \n \ + \n \ + \n \ + " + + data9 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + + \n \ + \n \ + \n \ + \n \ + x \n \ + \n \ + \n \ + \n \ + – \n \ + \n \ + \n \ + \n \ + / \n \ + \n \ + \n \ + \n \ + " + + data10 = \ +" \n \ + \n \ + \n" + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname+".svg"), "w") + FILE.write(data0) + FILE.write(_(mystring1).encode("utf-8")) + FILE.write(data1) + FILE.write(_(mystring2).encode("utf-8")) + FILE.write(data2) + FILE.write(_(mystring3).encode("utf-8")) + FILE.write(data3) + FILE.write(_(mystring4).encode("utf-8")) + FILE.write(data4) + FILE.write(_(mystring5).encode("utf-8")) + FILE.write(data5) + FILE.write(_(mystring6).encode("utf-8")) + FILE.write(data6) + FILE.write(_(mystring7).encode("utf-8")) + FILE.write(data7) + FILE.write(_(mystring8).encode("utf-8")) + FILE.write(data8) + FILE.write(_(mystring9).encode("utf-8")) + FILE.write(data9) + FILE.write(_(mystring10).encode("utf-8")) + FILE.write(data10) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/or.py b/svg/or.py new file mode 100644 index 0000000..cf1a9e7 --- /dev/null +++ b/svg/or.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 = "or" + mystring = "or" + mygroup = "numbers" + + 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() + + print _(mystring) + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data1 = \ +" \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/pendown.py b/svg/pendown.py new file mode 100644 index 0000000..9b2931f --- /dev/null +++ b/svg/pendown.py @@ -0,0 +1,126 @@ +#!/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 = "pendown" + mystring1 = "pen down" + mygroup = "pen" + + 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() + + print _(mystring1) + + data0 = \ +" \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/pengroup.py b/svg/pengroup.py new file mode 100644 index 0000000..75fe870 --- /dev/null +++ b/svg/pengroup.py @@ -0,0 +1,814 @@ +#!/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 = "pengroup" + mystring1 = "Pen" + mystring2 = "pen up" + mystring3 = "pen down" + mystring4 = "set pen size" + mystring5 = "set color" + mystring6 = "set shade" + mystring7 = "fill screen" + mystring8 = "pen size" + mystring9 = "color" + mystring10 = "shade" + mystring11 = "set text color" + mygroup = "pen" + + 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() + + print _(mystring1) + print _(mystring2) + print _(mystring3) + print _(mystring4) + print _(mystring5) + print _(mystring6) + print _(mystring7) + print _(mystring8) + print _(mystring9) + print _(mystring10) + print _(mystring11) + + 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 \ + " + + data1 = \ +" \n \ + \n \ + \n " + + data2a = \ +" \n \ + " + + data2b = \ +" \n \ + " + + data3b = \ +" \n \ + \n \ + \n \ + " + + data4 = \ +" \n \ + \n \ + \n " + + data5a = \ +" \n \ + " + + data5b = \ +" \n \ + " + + data6b = \ +" \n \ + \n \ + \n \ + " + + data7 = \ +" \n \ + \n \ + \n \ + \n \ + \n " + data8a = \ +" \n \ + " + + data8b = \ +" \n \ + " + + data8c = \ +" \n \ + " + + data9b = \ +" \n \ + \n \ + \n \ + " + + data9c = \ +" \n \ + \n \ + \n \ + " + + data10c = \ +" \n \ + \n \ + \n \ + " + + data11 = \ +" \n \ + \n \ + \n \ + \n \ + \n " + + data12a = \ +" \n \ + " + + data12b = \ +" \n \ + " + + data13b =\ +" \n \ + \n \ + \n \ + " + + data14 = \ +" \n \ + \n \ + \n \ + \n \ + \n " + + data15a = \ +" \n \ + " + + data15b = \ +" \n \ + " + + data16b = \ +" \n \ + \n \ + \n \ + " + + data17 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data18 = \ +" \n \ + \n \ + \n \ + " + + data19 = \ +" \n \ + \n \ + \n \ + " + + data20 = \ +" \n \ + \n \ + \n \ + " + + data21 = \ +" \n \ + \n \ + \n \ + \n \ + " + + data22 = \ +" \n \ + \n \ + \n \ + \n \ + " + + data23 = \ +" \n \ + \n \ + \n \ + \n \ + " + + data24 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data25 = \ +" \n \ + \n \ + \n \ + " + + data26 = \ +" \n \ + \n \ + \n \ + " + + data27 = \ +" \n \ + \n \ + \n " + + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname + ".svg"), "w") + FILE.write(data0) + FILE.write(_(mystring1).encode("utf-8")) + FILE.write(data1) + strings = _(mystring2).split(" ",3) + if len(strings) == 1: + FILE.write(data2a) + FILE.write(strings[0].encode("utf-8")) + elif len(strings) == 2: + FILE.write(data2b) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data3b) + FILE.write(strings[1].encode("utf-8")) + FILE.write(data4) + strings = _(mystring3).split(" ",3) + if len(strings) == 1: + FILE.write(data5a) + FILE.write(strings[0].encode("utf-8")) + elif len(strings) == 2: + FILE.write(data5b) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data6b) + FILE.write(strings[1].encode("utf-8")) + FILE.write(data7) + strings = _(mystring4).split(" ",3) + if len(strings) == 1: + FILE.write(data8a) + FILE.write(strings[0].encode("utf-8")) + elif len(strings) == 2: + FILE.write(data8b) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data9b) + FILE.write(strings[1].encode("utf-8")) + else: + FILE.write(data8c) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data9c) + FILE.write(strings[1].encode("utf-8")) + FILE.write(data10c) + FILE.write(strings[2].encode("utf-8")) + if len(strings) == 4: + FILE.write(" " + strings[3].encode("utf-8")) + FILE.write(data11) + strings = _(mystring5).split(" ",3) + if len(strings) == 1: + FILE.write(data12a) + FILE.write(strings[0].encode("utf-8")) + elif len(strings) == 2: + FILE.write(data12b) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data13b) + FILE.write(strings[1].encode("utf-8")) + FILE.write(data14) + strings = _(mystring6).split(" ",3) + if len(strings) == 1: + FILE.write(data15a) + FILE.write(strings[0].encode("utf-8")) + elif len(strings) == 2: + FILE.write(data15b) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data16b) + FILE.write(strings[1].encode("utf-8")) + FILE.write(data17) + strings = _(mystring7).split(" ",2) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data18) + if len(strings) == 2: + FILE.write(strings[1].encode("utf-8")) + FILE.write(data19) + FILE.write(_(mystring9).encode("utf-8")) + FILE.write(data20) + FILE.write(_(mystring10).encode("utf-8")) + FILE.write(data21) + FILE.write(_(mystring8).encode("utf-8")) + FILE.write(data22) + FILE.write(_(mystring9).encode("utf-8")) + FILE.write(data23) + FILE.write(_(mystring10).encode("utf-8")) + FILE.write(data24) + strings = _(mystring11).split(" ",3) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data25) + if len(strings) > 1: + FILE.write(strings[1].encode("utf-8")) + FILE.write(data26) + if len(strings) > 2: + FILE.write(strings[2].encode("utf-8")) + FILE.write(data27) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/pensize.py b/svg/pensize.py new file mode 100644 index 0000000..06936f7 --- /dev/null +++ b/svg/pensize.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 = "pensize" + mystring = "pen size" + mygroup = "pen" + + 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() + + 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/penup.py b/svg/penup.py new file mode 100644 index 0000000..300720b --- /dev/null +++ b/svg/penup.py @@ -0,0 +1,126 @@ +#!/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 = "penup" + mystring1 = "pen up" + mygroup = "pen" + + 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() + + print _(mystring1) + + data0 = \ +" \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/pop.py b/svg/pop.py new file mode 100644 index 0000000..989b661 --- /dev/null +++ b/svg/pop.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 = "pop" + mystring = "pop" + mygroup = "myblocks" + + 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() + + 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/print.py b/svg/print.py new file mode 100644 index 0000000..4dba9b8 --- /dev/null +++ b/svg/print.py @@ -0,0 +1,101 @@ +#!/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 = "print" + mystring = "print" + mygroup = "numbers" + + 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() + + print _(mystring) + data0 = \ +" \n \ + \n \ + \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/printheap.py b/svg/printheap.py new file mode 100644 index 0000000..6cb06a4 --- /dev/null +++ b/svg/printheap.py @@ -0,0 +1,125 @@ +#!/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 = "printheap" + mystring = "show heap" + mygroup = "myblocks" + + 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() + + print _(mystring) + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n " + + data1a = \ +" \n \ + " + + data1b = \ +" \n \ + " + + data1c = \ +" \n \ + \n \ + \n \ + " + + data2 = \ +" \n \ + \n \ + \n" + + strings = _(mystring).split(" ",2) + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname+".svg"), "w") + FILE.write(data0) + 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(data1c) + FILE.write(strings[1].encode("utf-8")) + FILE.write(data2) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/random.py b/svg/random.py new file mode 100644 index 0000000..42f8328 --- /dev/null +++ b/svg/random.py @@ -0,0 +1,135 @@ +#!/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 = "random" + mystring = "random" + mygroup = "numbers" + + 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() + + print _(mystring) + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data1 = \ +" \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/random.pyc b/svg/random.pyc new file mode 100644 index 0000000..2135ec5 --- /dev/null +++ b/svg/random.pyc Binary files differ diff --git a/svg/remainder.py b/svg/remainder.py new file mode 100644 index 0000000..79d41b6 --- /dev/null +++ b/svg/remainder.py @@ -0,0 +1,99 @@ +#!/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 = "remainder" + mystring = "mod" + mygroup = "numbers" + + 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() + + print _(mystring) + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data1 = \ +" \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/remainder2.py b/svg/remainder2.py new file mode 100644 index 0000000..cdbb4a3 --- /dev/null +++ b/svg/remainder2.py @@ -0,0 +1,154 @@ +#!/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 = "remainder2" + mystring = "mod" + mygroup = "numbers" + + 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() + + print _(mystring) + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \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/repeat.py b/svg/repeat.py new file mode 100644 index 0000000..3f89ba7 --- /dev/null +++ b/svg/repeat.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 = "repeat" + mystring = "repeat" + mygroup = "flow" + + 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() + + print _(mystring) + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data1 = \ +" \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/right.py b/svg/right.py new file mode 100644 index 0000000..850608d --- /dev/null +++ b/svg/right.py @@ -0,0 +1,102 @@ +#!/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 = "right" + mystring = "right" + mygroup = "turtle" + + 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() + + print _(mystring) + + data0 = \ +" \n \ + \n \ + \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/sensorsgroup.py b/svg/sensorsgroup.py new file mode 100644 index 0000000..1affb19 --- /dev/null +++ b/svg/sensorsgroup.py @@ -0,0 +1,691 @@ +#!/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 = "sensorsgroup" + mystring1 = "Keyboard" + mystring2 = "read key" + mystring3 = "keyboard" + mystring4 = "hres" + mystring5 = "vres" + mygroup = "sensors" + + 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() + + print _(mystring1) + print _(mystring2) + print _(mystring3) + print _(mystring4) + print _(mystring5) + + 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 \ + \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 \ + " + + data1 = \ +" \n \ + \n \ + \n " + + data2a = \ +" \n \ + " + + data2b = \ +" \n \ + " + + data3b = \ +" \n \ + \n \ + \n \ + " + + data4 = \ +" \n \ + \n \ + \n \ + \n \ + " + + data5 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + " + + data6 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data7 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + x \n \ + \n \ + \n \ + \n" + + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname + ".svg"), "w") + FILE.write(data0) + FILE.write(_(mystring1).encode("utf-8")) + FILE.write(data1) + strings = _(mystring2).split(" ",2) + if len(strings) == 1: + FILE.write(data2a) + FILE.write(strings[0].encode("utf-8")) + else: + FILE.write(data2b) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data3b) + FILE.write(strings[1].encode("utf-8")) + FILE.write(data4) + FILE.write(_(mystring3).encode("utf-8")) + FILE.write(data5) + FILE.write(_(mystring4).encode("utf-8")) + FILE.write(data6) + FILE.write(_(mystring5).encode("utf-8")) + FILE.write(data7) + FILE.close() + return + +if __name__ == "__main__": + main() + diff --git a/svg/setcolor.py b/svg/setcolor.py new file mode 100644 index 0000000..b8be5a6 --- /dev/null +++ b/svg/setcolor.py @@ -0,0 +1,135 @@ +#!/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 = "setcolor" + mystring1 = "set color" + mygroup = "pen" + + 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() + + print _(mystring1) + + data0 = \ +" \n \ + \n \ + \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/seth.py b/svg/seth.py new file mode 100644 index 0000000..581d59d --- /dev/null +++ b/svg/seth.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 = "seth" + mystring1 = "set heading" + mygroup = "turtle" + + 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() + + 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/setpensize.py b/svg/setpensize.py new file mode 100644 index 0000000..cf9d6cc --- /dev/null +++ b/svg/setpensize.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 = "setpensize" + mystring1 = "set pen size" + mygroup = "pen" + + 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() + + 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/setshade.py b/svg/setshade.py new file mode 100644 index 0000000..b7b8d98 --- /dev/null +++ b/svg/setshade.py @@ -0,0 +1,135 @@ +#!/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 = "setshade" + mystring1 = "set shade" + mygroup = "pen" + + 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() + + print _(mystring1) + + data0 = \ +" \n \ + \n \ + \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/settextcolor.py b/svg/settextcolor.py new file mode 100644 index 0000000..1efff35 --- /dev/null +++ b/svg/settextcolor.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 = "settextcolor" + mystring1 = "set text color" + mygroup = "pen" + + 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() + + 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/setxy.py b/svg/setxy.py new file mode 100644 index 0000000..651d859 --- /dev/null +++ b/svg/setxy.py @@ -0,0 +1,134 @@ +#!/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 = "setxy" + mystring1 = "setyx" + mystring2 = "x" + mystring3 = "y" + mygroup = "turtle" + + 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() + + print _(mystring1) + print _(mystring2) + print _(mystring3) + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data1 = \ +" \n \ + \n \ + " + + data2 = \ +" \n \ + \n \ + " + + data3 = \ +" \n \ + \n " + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname + ".svg"), "w") + FILE.write(data0) + FILE.write(_(mystring1).encode("utf-8")) + FILE.write(data1) + FILE.write(_(mystring2).encode("utf-8")) + FILE.write(data2) + FILE.write(_(mystring3).encode("utf-8")) + FILE.write(data3) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/shade.py b/svg/shade.py new file mode 100644 index 0000000..cf70b2b --- /dev/null +++ b/svg/shade.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 = "shade" + mystring = "shade" + mygroup = "pen" + + 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() + + 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/sound.py b/svg/sound.py new file mode 100644 index 0000000..b3e3e68 --- /dev/null +++ b/svg/sound.py @@ -0,0 +1,315 @@ +#!/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 = "sound" + mystring1 = "sound" + mygroup = "templates" + + 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() + + print _(mystring1) + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + image/svg+xml \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 \ + " + + data1 = \ +" \n \ + \n \ + \n " + + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname + ".svg"), "w") + FILE.write(data0) + FILE.write(_(mystring1).encode("utf-8")) + FILE.write(data1) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/stack1.py b/svg/stack1.py new file mode 100644 index 0000000..f426582 --- /dev/null +++ b/svg/stack1.py @@ -0,0 +1,98 @@ +#!/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 = "stack1" + mystring = "stack 1" + mygroup = "myblocks" + + 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() + + 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/stack2.py b/svg/stack2.py new file mode 100644 index 0000000..e1197b8 --- /dev/null +++ b/svg/stack2.py @@ -0,0 +1,98 @@ +#!/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 = "stack2" + mystring = "stack 2" + mygroup = "myblocks" + + 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() + + 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/start.py b/svg/start.py new file mode 100644 index 0000000..ebc47b7 --- /dev/null +++ b/svg/start.py @@ -0,0 +1,112 @@ + #!/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 = "start" + mystring = "start" + mygroup = "myblocks" + + 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() + + print _(mystring) + + data0 = \ +" \n \ + \n \ + \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/stopstack.py b/svg/stopstack.py new file mode 100644 index 0000000..8e8d748 --- /dev/null +++ b/svg/stopstack.py @@ -0,0 +1,107 @@ +#!/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 = "stopstack" + mystring = "stop stack" + mygroup = "flow" + + 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() + + print _(mystring) + + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data1 = \ +"" + + data2 = \ +" \n \ + \n" + + strings = _(mystring).split(" ",2) + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname+".svg"), "w") + FILE.write(data0) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data1) + if len(strings) == 2: + FILE.write(strings[1].encode("utf-8")) + FILE.write(data2) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/storeinbox1.py b/svg/storeinbox1.py new file mode 100644 index 0000000..0877943 --- /dev/null +++ b/svg/storeinbox1.py @@ -0,0 +1,171 @@ +#!/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 = "storeinbox1" + mystring = "store in box 1" + mygroup = "myblocks" + + 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() + + print _(mystring) + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n " + + data1a = \ +" \n \ + " + + data1b = \ +" \n \ + " + + data2b = \ +" \n \ + \n \ + \n \ + " + + data1c = \ +" \n \ + " + + data2c = \ +" \n \ + \n \ + \n \ + " + + data3c = \ +" \n \ + \n \ + \n \ + " + + data3 = \ +" \n \ + \n \ + \n" + + strings = _(mystring).split(" ",3) + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname+".svg"), "w") + FILE.write(data0) + 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")) + if len(strings) == 4: + FILE.write(" " + strings[3].encode("utf-8")) + FILE.write(data3) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/storeinbox2.py b/svg/storeinbox2.py new file mode 100644 index 0000000..9d226cb --- /dev/null +++ b/svg/storeinbox2.py @@ -0,0 +1,171 @@ +#!/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 = "storeinbox2" + mystring = "store in box 2" + mygroup = "myblocks" + + 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() + + print _(mystring) + + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n " + + data1a = \ +" \n \ + " + + data1b = \ +" \n \ + " + + data2b = \ +" \n \ + \n \ + \n \ + " + + data1c = \ +" \n \ + " + + data2c = \ +" \n \ + \n \ + \n \ + " + + data3c = \ +" \n \ + \n \ + \n \ + " + + data3 = \ +" \n \ + \n \ + \n" + + strings = _(mystring).split(" ",3) + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname+".svg"), "w") + FILE.write(data0) + 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")) + if len(strings) == 4: + FILE.write(" " + strings[3].encode("utf-8")) + FILE.write(data3) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/templatesgroup.py b/svg/templatesgroup.py new file mode 100644 index 0000000..efe68bc --- /dev/null +++ b/svg/templatesgroup.py @@ -0,0 +1,692 @@ +#!/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 = "templatesgroup" + mystring1 = "Templates" + mystring2 = "hide blocks" + mystring3 = "sound" + mygroup = "templates" + + 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() + + print _(mystring1) + + + 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 \ + " + + data1 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n" + + data2a = \ +" \n \ + " + + data2b = \ +" \n \ + " + + data3b = \ +" \n \ + \n \ + \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 " + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname + ".svg"), "w") + FILE.write(data0) + FILE.write(_(mystring1).encode("utf-8")) + FILE.write(data1) + strings = _(mystring2).split(" ",2) + if len(strings) == 1: + FILE.write(data2a) + FILE.write(strings[0].encode("utf-8")) + else: + FILE.write(data2b) + FILE.write(strings[0].encode("utf-8")) + 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 + +if __name__ == "__main__": + main() + diff --git a/svg/turtlegroup.py b/svg/turtlegroup.py new file mode 100644 index 0000000..59195a8 --- /dev/null +++ b/svg/turtlegroup.py @@ -0,0 +1,760 @@ +#!/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 = "turtlegroup" + mystring1 = "clean" + mystring2 = "forward" + mystring3 = "back" + mystring4 = "left" + mystring5 = "right" + mystring6 = "arc" + mystring7 = "angle" + mystring8 = "radius" + mystring9 = "setyx" + mystring10 = "x" + mystring11 = "y" + mystring12 = "set heading" + mystring13 = "xcor" + mystring14 = "ycor" + mystring15 = "heading" + mystring16 = "Turtle" + + mygroup = "turtle" + + 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() + + print _(mystring1) + print _(mystring2) + print _(mystring3) + print _(mystring4) + print _(mystring5) + print _(mystring6) + print _(mystring7) + print _(mystring8) + print _(mystring9) + print _(mystring10) + print _(mystring11) + print _(mystring12) + print _(mystring13) + print _(mystring14) + print _(mystring15) + print _(mystring16) + + 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 \ + " + + data1 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data2 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data3 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data4 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data5 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data6 = \ +" \n \ + \n \ + \n \ + " + + data7 = \ +" \n \ + " + + data8 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data9 = \ +" \n \ + \n \ + \n \ + " + + data10 = \ +" \n \ + " + + data11 = \ +" \n \ + \n \ + \n \ + \n \ + \n" + + data12a = \ +" \n \ + " + + data12b = \ +" \n \ + " + + data13b = \ +" \n \ + \n \ + \n \ + " + + data14 = \ +" \n \ + \n \ + \n \ + \n \ + " + + data15 = \ +" \n \ + \n \ + \n \ + \n \ + " + + data16 = \ +" \n \ + \n \ + \n \ + \n \ + " + + data17 = \ +" \n \ + \n \ + \n \ + " + + data18 = \ +" \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) + FILE.write(_(mystring1).encode("utf-8")) + FILE.write(data1) + FILE.write(_(mystring2).encode("utf-8")) + FILE.write(data2) + FILE.write(_(mystring3).encode("utf-8")) + FILE.write(data3) + FILE.write(_(mystring4).encode("utf-8")) + FILE.write(data4) + FILE.write(_(mystring5).encode("utf-8")) + FILE.write(data5) + FILE.write(_(mystring6).encode("utf-8")) + FILE.write(data6) + FILE.write(_(mystring7).encode("utf-8")) + FILE.write(data7) + FILE.write(_(mystring8).encode("utf-8")) + FILE.write(data8) + FILE.write(_(mystring9).encode("utf-8")) + FILE.write(data9) + FILE.write(_(mystring10).encode("utf-8")) + FILE.write(data10) + FILE.write(_(mystring11).encode("utf-8")) + FILE.write(data11) + strings = _(mystring12).split(" ",2) + if len(strings) == 1: + FILE.write(data12a) + FILE.write(strings[0].encode("utf-8")) + else: + FILE.write(data12b) + FILE.write(strings[0].encode("utf-8")) + FILE.write(data13b) + FILE.write(strings[1].encode("utf-8")) + FILE.write(data14) + FILE.write(_(mystring13).encode("utf-8")) + FILE.write(data15) + FILE.write(_(mystring14).encode("utf-8")) + FILE.write(data16) + FILE.write(_(mystring15).encode("utf-8")) + FILE.write(data17) + FILE.write(_(mystring16).encode("utf-8")) + FILE.write(data18) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/vres.py b/svg/vres.py new file mode 100644 index 0000000..3665da9 --- /dev/null +++ b/svg/vres.py @@ -0,0 +1,104 @@ +#!/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 = "vres" + mystring = "vres" + mygroup = "sensors" + + 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() + + print _(mystring) + data0 = \ +" \n \ + \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/wait.py b/svg/wait.py new file mode 100644 index 0000000..e383c85 --- /dev/null +++ b/svg/wait.py @@ -0,0 +1,103 @@ +#!/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 = "wait" + mystring = "wait" + mygroup = "flow" + + 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() + + print _(mystring) + + + data0 = \ +" \n \ + \n \ + \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/xcor.py b/svg/xcor.py new file mode 100644 index 0000000..18f920c --- /dev/null +++ b/svg/xcor.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 = "xcor" + mystring = "xcor" + mygroup = "turtle" + + 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() + + 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/ycor.py b/svg/ycor.py new file mode 100644 index 0000000..586958d --- /dev/null +++ b/svg/ycor.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 = "ycor" + mystring = "ycor" + mygroup = "turtle" + + 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() + + 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() -- cgit v0.9.1