From 05bd038c1a1fe456fc030e6196f238a32d110b02 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Wed, 22 May 2013 13:02:34 +0000 Subject: pep8 cleanup --- diff --git a/TurtleArt/taconstants.py b/TurtleArt/taconstants.py index 6f48c30..ffacac2 100644 --- a/TurtleArt/taconstants.py +++ b/TurtleArt/taconstants.py @@ -177,7 +177,7 @@ VOICES = {'af': 'afrikaans', 'cy': 'welsh-test', 'el': 'greek', 'hr': 'croatian', 'id': 'indonesian-test', 'la': 'latin', 'nl': 'dutch-test', 'sq': 'albanian', 'ta': 'tamil', 'vi': 'vietnam-test', 'ca': 'catalan', 'de': 'german', - 'eo': 'esperanto', 'fr': 'french', 'hu': 'hungarian', + 'eo': 'esperanto', 'fr': 'french', 'hu': 'hungarian', 'is': 'icelandic-test', 'lv': 'latvian', 'no': 'norwegian', 'ro': 'romanian', 'sr': 'serbian', 'zh': 'Mandarin', 'cs': 'czech', 'it': 'italian', 'pl': 'polish', @@ -186,212 +186,212 @@ VOICES = {'af': 'afrikaans', 'cy': 'welsh-test', 'el': 'greek', # Macros (groups of blocks) MACROS = { 'ifthenelse': # Because it is too big to fit on the palette - [[0, 'ifelse', 0, 0, [None, None, None, None, None]]], + [[0, 'ifelse', 0, 0, [None, None, None, None, None]]], 'kbinput': - [[0, 'until', 0, 0, [None, 1, 4, None]], - [1, 'greater2', 0, 0, [0, 2, 3, None]], - [2, 'keyboard', 0, 0, [1, None]], - [3, ['number', '0'], 0, 0, [1, None]], - [4, 'wait', 0, 0, [0, 5, 6]], - [5, ['number', '0.1'], 0, 0, [4, None]], - [6, 'kbinput', 0, 0, [4, None]]], + [[0, 'until', 0, 0, [None, 1, 4, None]], + [1, 'greater2', 0, 0, [0, 2, 3, None]], + [2, 'keyboard', 0, 0, [1, None]], + [3, ['number', '0'], 0, 0, [1, None]], + [4, 'wait', 0, 0, [0, 5, 6]], + [5, ['number', '0.1'], 0, 0, [4, None]], + [6, 'kbinput', 0, 0, [4, None]]], 'picturelist': - [[0, 'sandwichtop_no_label', 0, 0, [None, 1]], - [1, 'penup', 0, 0, [0, 2]], - [2, 'setxy2', 0, 0, [1, 3, 4, 5]], - [3, 'titlex', 0, 0, [2, None]], - [4, 'titley', 0, 0, [2, None]], - [5, 'pendown', 0, 0, [2, 6]], - [6, 'setscale', 0, 0, [5, 7, 8]], - [7, ['number', '100'], 0, 0, [6, None]], - [8, 'show', 0, 0, [6, 9, 10]], - [9, ['string', _('Title')], 0, 0, [8, None]], - [10, 'penup', 0, 0, [8, 11]], - [11, 'setxy2', 0, 0, [10, 12, 13, 14]], - [12, 'leftx', 0, 0, [11, None]], - [13, 'topy', 0, 0, [11, None]], - [14, 'pendown', 0, 0, [11, 15]], - [15, 'setscale', 0, 0, [14, 16, 17]], - [16, ['number', '67'], 0, 0, [15, None]], - [17, 'list', 0, 0, [15, 18, 19, 20]], - [18, ['string', '∙ '], 0, 0, [17, None]], - [19, ['string', '∙ '], 0, 0, [17, None]], - [20, 'sandwichbottom', 0, 0, [17, None]]], + [[0, 'sandwichtop_no_label', 0, 0, [None, 1]], + [1, 'penup', 0, 0, [0, 2]], + [2, 'setxy2', 0, 0, [1, 3, 4, 5]], + [3, 'titlex', 0, 0, [2, None]], + [4, 'titley', 0, 0, [2, None]], + [5, 'pendown', 0, 0, [2, 6]], + [6, 'setscale', 0, 0, [5, 7, 8]], + [7, ['number', '100'], 0, 0, [6, None]], + [8, 'show', 0, 0, [6, 9, 10]], + [9, ['string', _('Title')], 0, 0, [8, None]], + [10, 'penup', 0, 0, [8, 11]], + [11, 'setxy2', 0, 0, [10, 12, 13, 14]], + [12, 'leftx', 0, 0, [11, None]], + [13, 'topy', 0, 0, [11, None]], + [14, 'pendown', 0, 0, [11, 15]], + [15, 'setscale', 0, 0, [14, 16, 17]], + [16, ['number', '67'], 0, 0, [15, None]], + [17, 'list', 0, 0, [15, 18, 19, 20]], + [18, ['string', '∙ '], 0, 0, [17, None]], + [19, ['string', '∙ '], 0, 0, [17, None]], + [20, 'sandwichbottom', 0, 0, [17, None]]], 'picture1x1a': - [[0, 'sandwichtop_no_label', 0, 0, [None, 1]], - [1, 'penup', 0, 0, [0, 2]], - [2, 'setxy2', 0, 0, [1, 3, 4, 5]], - [3, 'titlex', 0, 0, [2, None]], - [4, 'titley', 0, 0, [2, None]], - [5, 'pendown', 0, 0, [2, 6]], - [6, 'setscale', 0, 0, [5, 7, 8]], - [7, ['number', '100'], 0, 0, [6, None]], - [8, 'show', 0, 0, [6, 9, 10]], - [9, ['string', _('Title')], 0, 0, [8, None]], - [10, 'penup', 0, 0, [8, 11]], - [11, 'setxy2', 0, 0, [10, 12, 13, 14]], - [12, 'leftx', 0, 0, [11, None]], - [13, 'topy', 0, 0, [11, None]], - [14, 'pendown', 0, 0, [11, 15]], - [15, 'setscale', 0, 0, [14, 16, 17]], - [16, ['number', '90'], 0, 0, [15, None]], - [17, 'showaligned', 0, 0, [15, 18, 19]], - [18, 'journal', 0, 0, [17, None]], - [19, 'sandwichbottom', 0, 0, [17, None]]], + [[0, 'sandwichtop_no_label', 0, 0, [None, 1]], + [1, 'penup', 0, 0, [0, 2]], + [2, 'setxy2', 0, 0, [1, 3, 4, 5]], + [3, 'titlex', 0, 0, [2, None]], + [4, 'titley', 0, 0, [2, None]], + [5, 'pendown', 0, 0, [2, 6]], + [6, 'setscale', 0, 0, [5, 7, 8]], + [7, ['number', '100'], 0, 0, [6, None]], + [8, 'show', 0, 0, [6, 9, 10]], + [9, ['string', _('Title')], 0, 0, [8, None]], + [10, 'penup', 0, 0, [8, 11]], + [11, 'setxy2', 0, 0, [10, 12, 13, 14]], + [12, 'leftx', 0, 0, [11, None]], + [13, 'topy', 0, 0, [11, None]], + [14, 'pendown', 0, 0, [11, 15]], + [15, 'setscale', 0, 0, [14, 16, 17]], + [16, ['number', '90'], 0, 0, [15, None]], + [17, 'showaligned', 0, 0, [15, 18, 19]], + [18, 'journal', 0, 0, [17, None]], + [19, 'sandwichbottom', 0, 0, [17, None]]], 'picture2x2': - [[0, 'sandwichtop_no_label', 0, 0, [None, 1]], - [1, 'penup', 0, 0, [0, 2]], - [2, 'setxy2', 0, 0, [1, 3, 4, 5]], - [3, 'titlex', 0, 0, [2, None]], - [4, 'titley', 0, 0, [2, None]], - [5, 'pendown', 0, 0, [2, 6]], - [6, 'setscale', 0, 0, [5, 7, 8]], - [7, ['number', '100'], 0, 0, [6, None]], - [8, 'show', 0, 0, [6, 9, 10]], - [9, ['string', _('Title')], 0, 0, [8, None]], - [10, 'setscale', 0, 0, [8, 11, 12]], - [11, ['number', '35'], 0, 0, [10, None]], - [12, 'penup', 0, 0, [10, 13]], - [13, 'setxy2', 0, 0, [12, 14, 15, 16]], - [14, 'leftx', 0, 0, [13, None]], - [15, 'topy', 0, 0, [13, None]], - [16, 'pendown', 0, 0, [13, 17]], - [17, 'showaligned', 0, 0, [16, 18, 19]], - [18, 'journal', 0, 0, [17, None]], - [19, 'penup', 0, 0, [17, 20]], - [20, 'setxy2', 0, 0, [19, 21, 22, 23]], - [21, 'rightx', 0, 0, [20, None]], - [22, 'topy', 0, 0, [20, None]], - [23, 'pendown', 0, 0, [20, 24]], - [24, 'showaligned', 0, 0, [23, 25, 26]], - [25, 'journal', 0, 0, [24, None]], - [26, 'penup', 0, 0, [24, 27]], - [27, 'setxy2', 0, 0, [26, 28, 29, 30]], - [28, 'leftx', 0, 0, [27, None]], - [29, 'bottomy', 0, 0, [27, None]], - [30, 'pendown', 0, 0, [27, 31]], - [31, 'showaligned', 0, 0, [30, 32, 33]], - [32, 'journal', 0, 0, [31, None]], - [33, 'penup', 0, 0, [31, 34]], - [34, 'setxy2', 0, 0, [33, 35, 36, 37]], - [35, 'rightx', 0, 0, [34, None]], - [36, 'bottomy', 0, 0, [34, None]], - [37, 'pendown', 0, 0, [34, 38]], - [38, 'showaligned', 0, 0, [37, 39, 40]], - [39, 'journal', 0, 0, [38, None]], - [40, 'sandwichbottom', 0, 0, [38, None]]], + [[0, 'sandwichtop_no_label', 0, 0, [None, 1]], + [1, 'penup', 0, 0, [0, 2]], + [2, 'setxy2', 0, 0, [1, 3, 4, 5]], + [3, 'titlex', 0, 0, [2, None]], + [4, 'titley', 0, 0, [2, None]], + [5, 'pendown', 0, 0, [2, 6]], + [6, 'setscale', 0, 0, [5, 7, 8]], + [7, ['number', '100'], 0, 0, [6, None]], + [8, 'show', 0, 0, [6, 9, 10]], + [9, ['string', _('Title')], 0, 0, [8, None]], + [10, 'setscale', 0, 0, [8, 11, 12]], + [11, ['number', '35'], 0, 0, [10, None]], + [12, 'penup', 0, 0, [10, 13]], + [13, 'setxy2', 0, 0, [12, 14, 15, 16]], + [14, 'leftx', 0, 0, [13, None]], + [15, 'topy', 0, 0, [13, None]], + [16, 'pendown', 0, 0, [13, 17]], + [17, 'showaligned', 0, 0, [16, 18, 19]], + [18, 'journal', 0, 0, [17, None]], + [19, 'penup', 0, 0, [17, 20]], + [20, 'setxy2', 0, 0, [19, 21, 22, 23]], + [21, 'rightx', 0, 0, [20, None]], + [22, 'topy', 0, 0, [20, None]], + [23, 'pendown', 0, 0, [20, 24]], + [24, 'showaligned', 0, 0, [23, 25, 26]], + [25, 'journal', 0, 0, [24, None]], + [26, 'penup', 0, 0, [24, 27]], + [27, 'setxy2', 0, 0, [26, 28, 29, 30]], + [28, 'leftx', 0, 0, [27, None]], + [29, 'bottomy', 0, 0, [27, None]], + [30, 'pendown', 0, 0, [27, 31]], + [31, 'showaligned', 0, 0, [30, 32, 33]], + [32, 'journal', 0, 0, [31, None]], + [33, 'penup', 0, 0, [31, 34]], + [34, 'setxy2', 0, 0, [33, 35, 36, 37]], + [35, 'rightx', 0, 0, [34, None]], + [36, 'bottomy', 0, 0, [34, None]], + [37, 'pendown', 0, 0, [34, 38]], + [38, 'showaligned', 0, 0, [37, 39, 40]], + [39, 'journal', 0, 0, [38, None]], + [40, 'sandwichbottom', 0, 0, [38, None]]], 'picture1x2': - [[0, 'sandwichtop_no_label', 0, 0, [None, 1]], - [1, 'penup', 0, 0, [0, 2]], - [2, 'setxy2', 0, 0, [1, 3, 4, 5]], - [3, 'titlex', 0, 0, [2, None]], - [4, 'titley', 0, 0, [2, None]], - [5, 'pendown', 0, 0, [2, 6]], - [6, 'setscale', 0, 0, [5, 7, 8]], - [7, ['number', '100'], 0, 0, [6, None]], - [8, 'show', 0, 0, [6, 9, 10]], - [9, ['string', _('Title')], 0, 0, [8, None]], - [10, 'setscale', 0, 0, [8, 11, 12]], - [11, ['number', '35'], 0, 0, [10, None]], - [12, 'penup', 0, 0, [10, 13]], - [13, 'setxy2', 0, 0, [12, 14, 15, 16]], - [14, 'leftx', 0, 0, [13, None]], - [15, 'topy', 0, 0, [13, None]], - [16, 'pendown', 0, 0, [13, 17]], - [17, 'showaligned', 0, 0, [16, 18, 19]], - [18, 'journal', 0, 0, [17, None]], - [19, 'penup', 0, 0, [17, 20]], - [20, 'setxy2', 0, 0, [19, 21, 22, 23]], - [21, 'rightx', 0, 0, [20, None]], - [22, 'topy', 0, 0, [20, None]], - [23, 'pendown', 0, 0, [20, 24]], - [24, 'showaligned', 0, 0, [23, 25, 26]], - [25, 'description', 0, 0, [24, None]], - [26, 'penup', 0, 0, [24, 27]], - [27, 'setxy2', 0, 0, [26, 28, 29, 30]], - [28, 'leftx', 0, 0, [27, None]], - [29, 'bottomy', 0, 0, [27, None]], - [30, 'pendown', 0, 0, [27, 31]], - [31, 'showaligned', 0, 0, [30, 32, 33]], - [32, 'journal', 0, 0, [31, None]], - [33, 'penup', 0, 0, [31, 34]], - [34, 'setxy2', 0, 0, [33, 35, 36, 37]], - [35, 'rightx', 0, 0, [34, None]], - [36, 'bottomy', 0, 0, [34, None]], - [37, 'pendown', 0, 0, [34, 38]], - [38, 'showaligned', 0, 0, [37, 39, 40]], - [39, 'description', 0, 0, [38, None]], - [40, 'sandwichbottom', 0, 0, [38, None]]], + [[0, 'sandwichtop_no_label', 0, 0, [None, 1]], + [1, 'penup', 0, 0, [0, 2]], + [2, 'setxy2', 0, 0, [1, 3, 4, 5]], + [3, 'titlex', 0, 0, [2, None]], + [4, 'titley', 0, 0, [2, None]], + [5, 'pendown', 0, 0, [2, 6]], + [6, 'setscale', 0, 0, [5, 7, 8]], + [7, ['number', '100'], 0, 0, [6, None]], + [8, 'show', 0, 0, [6, 9, 10]], + [9, ['string', _('Title')], 0, 0, [8, None]], + [10, 'setscale', 0, 0, [8, 11, 12]], + [11, ['number', '35'], 0, 0, [10, None]], + [12, 'penup', 0, 0, [10, 13]], + [13, 'setxy2', 0, 0, [12, 14, 15, 16]], + [14, 'leftx', 0, 0, [13, None]], + [15, 'topy', 0, 0, [13, None]], + [16, 'pendown', 0, 0, [13, 17]], + [17, 'showaligned', 0, 0, [16, 18, 19]], + [18, 'journal', 0, 0, [17, None]], + [19, 'penup', 0, 0, [17, 20]], + [20, 'setxy2', 0, 0, [19, 21, 22, 23]], + [21, 'rightx', 0, 0, [20, None]], + [22, 'topy', 0, 0, [20, None]], + [23, 'pendown', 0, 0, [20, 24]], + [24, 'showaligned', 0, 0, [23, 25, 26]], + [25, 'description', 0, 0, [24, None]], + [26, 'penup', 0, 0, [24, 27]], + [27, 'setxy2', 0, 0, [26, 28, 29, 30]], + [28, 'leftx', 0, 0, [27, None]], + [29, 'bottomy', 0, 0, [27, None]], + [30, 'pendown', 0, 0, [27, 31]], + [31, 'showaligned', 0, 0, [30, 32, 33]], + [32, 'journal', 0, 0, [31, None]], + [33, 'penup', 0, 0, [31, 34]], + [34, 'setxy2', 0, 0, [33, 35, 36, 37]], + [35, 'rightx', 0, 0, [34, None]], + [36, 'bottomy', 0, 0, [34, None]], + [37, 'pendown', 0, 0, [34, 38]], + [38, 'showaligned', 0, 0, [37, 39, 40]], + [39, 'description', 0, 0, [38, None]], + [40, 'sandwichbottom', 0, 0, [38, None]]], 'picture2x1': - [[0, 'sandwichtop_no_label', 0, 0, [None, 1]], - [1, 'penup', 0, 0, [0, 2]], - [2, 'setxy2', 0, 0, [1, 3, 4, 5]], - [3, 'titlex', 0, 0, [2, None]], - [4, 'titley', 0, 0, [2, None]], - [5, 'pendown', 0, 0, [2, 6]], - [6, 'setscale', 0, 0, [5, 7, 8]], - [7, ['number', '100'], 0, 0, [6, None]], - [8, 'show', 0, 0, [6, 9, 10]], - [9, ['string', _('Title')], 0, 0, [8, None]], - [10, 'setscale', 0, 0, [8, 11, 12]], - [11, ['number', '35'], 0, 0, [10, None]], - [12, 'penup', 0, 0, [10, 13]], - [13, 'setxy2', 0, 0, [12, 14, 15, 16]], - [14, 'leftx', 0, 0, [13, None]], - [15, 'topy', 0, 0, [13, None]], - [16, 'pendown', 0, 0, [13, 17]], - [17, 'showaligned', 0, 0, [16, 18, 19]], - [18, 'journal', 0, 0, [17, None]], - [19, 'penup', 0, 0, [17, 20]], - [20, 'setxy2', 0, 0, [19, 21, 22, 23]], - [21, 'rightx', 0, 0, [20, None]], - [22, 'topy', 0, 0, [20, None]], - [23, 'pendown', 0, 0, [20, 24]], - [24, 'showaligned', 0, 0, [23, 25, 26]], - [25, 'journal', 0, 0, [24, None]], - [26, 'penup', 0, 0, [24, 27]], - [27, 'setxy2', 0, 0, [26, 28, 29, 30]], - [28, 'leftx', 0, 0, [27, None]], - [29, 'bottomy', 0, 0, [27, None]], - [30, 'pendown', 0, 0, [27, 31]], - [31, 'showaligned', 0, 0, [30, 32, 33]], - [32, 'description', 0, 0, [31, None]], - [33, 'penup', 0, 0, [31, 34]], - [34, 'setxy2', 0, 0, [33, 35, 36, 37]], - [35, 'rightx', 0, 0, [34, None]], - [36, 'bottomy', 0, 0, [34, None]], - [37, 'pendown', 0, 0, [34, 38]], - [38, 'showaligned', 0, 0, [37, 39, 40]], - [39, 'description', 0, 0, [38, None]], - [40, 'sandwichbottom', 0, 0, [38, None]]], + [[0, 'sandwichtop_no_label', 0, 0, [None, 1]], + [1, 'penup', 0, 0, [0, 2]], + [2, 'setxy2', 0, 0, [1, 3, 4, 5]], + [3, 'titlex', 0, 0, [2, None]], + [4, 'titley', 0, 0, [2, None]], + [5, 'pendown', 0, 0, [2, 6]], + [6, 'setscale', 0, 0, [5, 7, 8]], + [7, ['number', '100'], 0, 0, [6, None]], + [8, 'show', 0, 0, [6, 9, 10]], + [9, ['string', _('Title')], 0, 0, [8, None]], + [10, 'setscale', 0, 0, [8, 11, 12]], + [11, ['number', '35'], 0, 0, [10, None]], + [12, 'penup', 0, 0, [10, 13]], + [13, 'setxy2', 0, 0, [12, 14, 15, 16]], + [14, 'leftx', 0, 0, [13, None]], + [15, 'topy', 0, 0, [13, None]], + [16, 'pendown', 0, 0, [13, 17]], + [17, 'showaligned', 0, 0, [16, 18, 19]], + [18, 'journal', 0, 0, [17, None]], + [19, 'penup', 0, 0, [17, 20]], + [20, 'setxy2', 0, 0, [19, 21, 22, 23]], + [21, 'rightx', 0, 0, [20, None]], + [22, 'topy', 0, 0, [20, None]], + [23, 'pendown', 0, 0, [20, 24]], + [24, 'showaligned', 0, 0, [23, 25, 26]], + [25, 'journal', 0, 0, [24, None]], + [26, 'penup', 0, 0, [24, 27]], + [27, 'setxy2', 0, 0, [26, 28, 29, 30]], + [28, 'leftx', 0, 0, [27, None]], + [29, 'bottomy', 0, 0, [27, None]], + [30, 'pendown', 0, 0, [27, 31]], + [31, 'showaligned', 0, 0, [30, 32, 33]], + [32, 'description', 0, 0, [31, None]], + [33, 'penup', 0, 0, [31, 34]], + [34, 'setxy2', 0, 0, [33, 35, 36, 37]], + [35, 'rightx', 0, 0, [34, None]], + [36, 'bottomy', 0, 0, [34, None]], + [37, 'pendown', 0, 0, [34, 38]], + [38, 'showaligned', 0, 0, [37, 39, 40]], + [39, 'description', 0, 0, [38, None]], + [40, 'sandwichbottom', 0, 0, [38, None]]], 'picture1x1': - [[0, 'sandwichtop_no_label', 0, 0, [None, 1]], - [1, 'penup', 0, 0, [0, 2]], - [2, 'setxy2', 0, 0, [1, 3, 4, 5]], - [3, 'titlex', 0, 0, [2, None]], - [4, 'titley', 0, 0, [2, None]], - [5, 'pendown', 0, 0, [2, 6]], - [6, 'setscale', 0, 0, [5, 7, 8]], - [7, ['number', '100'], 0, 0, [6, None]], - [8, 'show', 0, 0, [6, 9, 10]], - [9, ['string', _('Title')], 0, 0, [8, None]], - [10, 'setscale', 0, 0, [8, 11, 12]], - [11, ['number', '35'], 0, 0, [10, None]], - [12, 'penup', 0, 0, [10, 13]], - [13, 'setxy2', 0, 0, [12, 14, 15, 16]], - [14, 'leftx', 0, 0, [13, None]], - [15, 'topy', 0, 0, [13, None]], - [16, 'pendown', 0, 0, [13, 17]], - [17, 'showaligned', 0, 0, [16, 18, 19]], - [18, 'journal', 0, 0, [17, None]], - [19, 'penup', 0, 0, [17, 20]], - [20, 'setxy2', 0, 0, [19, 21, 22, 23]], - [21, 'rightx', 0, 0, [20, None]], - [22, 'topy', 0, 0, [20, None]], - [23, 'pendown', 0, 0, [20, 24]], - [24, 'showaligned', 0, 0, [23, 25, 26]], - [25, 'description', 0, 0, [24, None]], - [26, 'sandwichbottom', 0, 0, [24, None]]], + [[0, 'sandwichtop_no_label', 0, 0, [None, 1]], + [1, 'penup', 0, 0, [0, 2]], + [2, 'setxy2', 0, 0, [1, 3, 4, 5]], + [3, 'titlex', 0, 0, [2, None]], + [4, 'titley', 0, 0, [2, None]], + [5, 'pendown', 0, 0, [2, 6]], + [6, 'setscale', 0, 0, [5, 7, 8]], + [7, ['number', '100'], 0, 0, [6, None]], + [8, 'show', 0, 0, [6, 9, 10]], + [9, ['string', _('Title')], 0, 0, [8, None]], + [10, 'setscale', 0, 0, [8, 11, 12]], + [11, ['number', '35'], 0, 0, [10, None]], + [12, 'penup', 0, 0, [10, 13]], + [13, 'setxy2', 0, 0, [12, 14, 15, 16]], + [14, 'leftx', 0, 0, [13, None]], + [15, 'topy', 0, 0, [13, None]], + [16, 'pendown', 0, 0, [13, 17]], + [17, 'showaligned', 0, 0, [16, 18, 19]], + [18, 'journal', 0, 0, [17, None]], + [19, 'penup', 0, 0, [17, 20]], + [20, 'setxy2', 0, 0, [19, 21, 22, 23]], + [21, 'rightx', 0, 0, [20, None]], + [22, 'topy', 0, 0, [20, None]], + [23, 'pendown', 0, 0, [20, 24]], + [24, 'showaligned', 0, 0, [23, 25, 26]], + [25, 'description', 0, 0, [24, None]], + [26, 'sandwichbottom', 0, 0, [24, None]]], 'reskin': - [[0, 'skin', 0, 0, [None, 1, None]], - [1, 'journal', 0, 0, [0, None]]]} + [[0, 'skin', 0, 0, [None, 1, None]], + [1, 'journal', 0, 0, [0, None]]]} diff --git a/TurtleArt/taexportlogo.py b/TurtleArt/taexportlogo.py index 8ddaf31..f021f94 100644 --- a/TurtleArt/taexportlogo.py +++ b/TurtleArt/taexportlogo.py @@ -37,8 +37,7 @@ def save_logo(tw): 'to action': _add_named_stack, 'action': _add_reference_to_stack, 'storeinbox': _add_named_box, - 'box': _add_reference_to_box - } + 'box': _add_reference_to_box} constants_table = { 'lpos': _lpos, 'tpos': _tpos, @@ -60,8 +59,7 @@ def save_logo(tw): 'rightx': _rightx, 'bottomy': _bottomy, 'width': _width, - 'height': _height - } + 'height': _height} stacks_of_blocks = tw.just_blocks() stack_count = 0 @@ -212,7 +210,8 @@ def _leftx(tw): def _topy(tw): - return int((tw.canvas.height * (TITLEXY[1] - 0.125)) / (tw.coord_scale * 2)) + return int((tw.canvas.height * (TITLEXY[1] - 0.125)) + / (tw.coord_scale * 2)) def _rightx(tw): diff --git a/TurtleArt/tagplay.py b/TurtleArt/tagplay.py index 335c25f..9e9f821 100644 --- a/TurtleArt/tagplay.py +++ b/TurtleArt/tagplay.py @@ -63,12 +63,12 @@ def play_movie_from_file(lc, filepath, x, y, w, h): def stop_media(lc): """ Called from Clean block and toolbar Stop button """ - if lc.gplay == None: + if lc.gplay is None: return False if lc.gplay.player is not None: lc.gplay.player.stop() - if lc.gplay.bin != None: + if lc.gplay.bin is not None: lc.gplay.bin.destroy() lc.gplay = None @@ -76,7 +76,7 @@ def stop_media(lc): def pause_media(lc): """ From pause media block """ - if lc.gplay == None: + if lc.gplay is None: return False if lc.gplay.player is not None: @@ -85,7 +85,7 @@ def pause_media(lc): def play_media(lc): """ From play media block """ - if lc.gplay == None: + if lc.gplay is None: return False if lc.gplay.player is not None: @@ -93,7 +93,7 @@ def play_media(lc): def media_playing(lc): - if lc.gplay == None: + if lc.gplay is None: return False return lc.gplay.player.is_playing() diff --git a/TurtleArt/tajail.py b/TurtleArt/tajail.py index 3fcf997..40517cd 100644 --- a/TurtleArt/tajail.py +++ b/TurtleArt/tajail.py @@ -46,7 +46,7 @@ def myfunc(f, args): def myfunc_import(parent, f, x): ''' Run Python code imported from Journal ''' - if 'def myblock(lc,' in f: + if 'def myblock(lc,' in f: base_class = parent.tw.lc # pre-v107, we passed lc else: base_class = parent.tw # as of v107, we pass tw diff --git a/TurtleArt/talogo.py b/TurtleArt/talogo.py index 069a871..29d05d9 100644 --- a/TurtleArt/talogo.py +++ b/TurtleArt/talogo.py @@ -289,7 +289,7 @@ class LogoCode: except ValueError: code.append(float(ord(blk.values[0][0]))) elif blk.name == 'string' or \ - blk.name == 'title': # deprecated block + blk.name == 'title': # deprecated block if isinstance(blk.values[0], (float, int)): if int(blk.values[0]) == blk.values[0]: blk.values[0] = int(blk.values[0]) @@ -298,8 +298,8 @@ class LogoCode: code.append('#s' + blk.values[0]) elif blk.name in PREFIX_DICTIONARY: if blk.values[0] is not None: - code.append(PREFIX_DICTIONARY[blk.name] + \ - str(blk.values[0])) + code.append(PREFIX_DICTIONARY[blk.name] + + str(blk.values[0])) else: code.append(PREFIX_DICTIONARY[blk.name] + 'None') elif blk.name in media_blocks_dictionary: @@ -436,7 +436,7 @@ class LogoCode: if self.procstop: break - if self.iresult == None: + if self.iresult is None: continue if self.bindex is not None: @@ -480,7 +480,7 @@ class LogoCode: oldcfun, oldarglist = self.cfun, self.arglist self.cfun, self.arglist = token, [] - if token.nargs == None: + if token.nargs is None: self.tw.showblocks() self.tw.display_coordinates() raise logoerror("#noinput") @@ -502,10 +502,11 @@ class LogoCode: else: result = self.cfun.fcn(self, *self.arglist) self.cfun, self.arglist = oldcfun, oldarglist - if self.arglist is not None and result == None: + if self.arglist is not None and result is None: self.tw.showblocks() - raise logoerror("%s %s %s" % \ - (oldcfun.name, _("did not output to"), self.cfun.name)) + raise logoerror("%s %s %s" % + (oldcfun.name, _("did not output to"), + self.cfun.name)) self.ireturn(result) yield True @@ -619,8 +620,9 @@ class LogoCode: return int(ord(n[0])) else: self.tw.showblocks() - raise logoerror("%s %s %s %s" \ - % (self.cfun.name, _("doesn't like"), str(n), _("as input"))) + raise logoerror("%s %s %s %s" % + (self.cfun.name, _("doesn't like"), str(n), + _("as input"))) def find_value_blocks(self): """ Find any value blocks that may need label updates """ @@ -654,8 +656,8 @@ class LogoCode: block.resize() elif self.update_values: if isinstance(value, float): - valstring = str(round_int(value)).replace('.', - self.tw.decimal_point) + valstring = str(round_int(value)).replace( + '.', self.tw.decimal_point) else: valstring = str(value) for block in self.value_blocks_to_update[name]: @@ -763,7 +765,7 @@ class LogoCode: text = None if text_media_type(self.filepath): if RTFPARSE and ( - mimetype == 'application/rtf' or \ + mimetype == 'application/rtf' or self.filepath.endswith(('rtf'))): text_only = RtfTextOnly() for line in open(self.filepath, 'r'): diff --git a/TurtleArt/tapalette.py b/TurtleArt/tapalette.py index cda2b79..3c38722 100644 --- a/TurtleArt/tapalette.py +++ b/TurtleArt/tapalette.py @@ -34,7 +34,7 @@ logo_functions = {} special_names = {} # Names for blocks without names for popup help content_blocks = ['number', 'string', 'description', 'audio', 'video', 'journal'] -hidden_proto_blocks = [] # proto blocks that are (at least initially) hidden +hidden_proto_blocks = [] # proto blocks that are (at least initially) hidden value_blocks = [] # blocks whose labels are updated get added here special_block_colors = {} string_or_number_args = [] @@ -95,8 +95,7 @@ from gettext import gettext as _ help_strings = { 'next': _('displays next palette'), - 'orientation': _("changes the orientation of the palette of blocks") - } + 'orientation': _("changes the orientation of the palette of blocks")} class Palette(): @@ -162,7 +161,8 @@ class Palette(): if self._help is None: self._help = help if hasattr(self, '_help_box') and HELP_PALETTE: - add_section(self._help_box, self._help, icon=self._name + 'off') + add_section(self._help_box, self._help, + icon=self._name + 'off') def set_special_name(self, name): self._special_name = name @@ -190,7 +190,7 @@ class Palette(): block.set_logo_command(logo_command) if help_string is not None: block.set_help(help_string) - if not hidden: + if not hidden: first_arg = None if special_name is None: if isinstance(label, list): @@ -200,7 +200,9 @@ class Palette(): else: first_arg = special_name if HELP_PALETTE: - if first_arg is None or first_arg == '' or first_arg == ' ': + if first_arg is None or \ + first_arg == '' or \ + first_arg == ' ': add_paragraph(self._help_box, '%s' % (help_string)) else: add_paragraph(self._help_box, '%s: %s' % (first_arg, @@ -241,7 +243,7 @@ def palette_name_to_index(palette_name): def define_logo_function(key, value): ''' Add a logo function to the table (not necessarily associated with a block, e.g., color lookup tables) ''' - logo_functions[key] = value + logo_functions[key] = value class Block(): @@ -291,8 +293,8 @@ class Block(): if self._palette is not None: i = palette_names.index(self._palette) if self._name in palette_blocks[i]: - debug_output('%s already in palette %s, skipping...' % ( - self._name, self._palette)) + debug_output('%s already in palette %s, skipping...' % + (self._name, self._palette)) else: if position is not None and isinstance(position, int) and \ position < len(palette_blocks[i]): @@ -300,7 +302,8 @@ class Block(): else: palette_blocks[i].append(self._name) if position is not None: - debug_output('Ignoring position (%s)' % (str(position))) + debug_output('Ignoring position (%s)' % + (str(position))) if self._help is not None: help_strings[self._name] = self._help diff --git a/TurtleArt/taturtle.py b/TurtleArt/taturtle.py index 3176eda..7db72e6 100644 --- a/TurtleArt/taturtle.py +++ b/TurtleArt/taturtle.py @@ -59,7 +59,7 @@ class Turtles: elif not append: return None else: - if colors == None: + if colors is None: Turtle(self, k) elif isinstance(colors, (list, tuple)): Turtle(self, k, colors) -- cgit v0.9.1