1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
|
Index: aseba-plugin-blockly-20180211+git/convert_script_path.py
===================================================================
--- aseba-plugin-blockly-20180211+git.orig/convert_script_path.py
+++ aseba-plugin-blockly-20180211+git/convert_script_path.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
from bs4 import BeautifulSoup
import sys
Index: aseba-plugin-blockly-20180211+git/blockly/build.py
===================================================================
--- aseba-plugin-blockly-20180211+git.orig/blockly/build.py
+++ aseba-plugin-blockly-20180211+git/blockly/build.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.7
+#!/usr/bin/python3
# Compresses the core Blockly files into a single JavaScript file.
#
# Copyright 2012 Google Inc.
Index: aseba-plugin-blockly-20180211+git/blockly/i18n/common.py
===================================================================
--- aseba-plugin-blockly-20180211+git.orig/blockly/i18n/common.py
+++ aseba-plugin-blockly-20180211+git/blockly/i18n/common.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# Code shared by translation conversion scripts.
#
@@ -59,7 +59,7 @@ def read_json_file(filename):
if '@metadata' in defs:
del defs['@metadata']
return defs
- except ValueError, e:
+ except ValueError as e:
print('Error reading ' + filename)
raise InputError(filename, str(e))
@@ -85,7 +85,7 @@ def _create_qqq_file(output_dir):
"""
qqq_file_name = os.path.join(os.curdir, output_dir, 'qqq.json')
qqq_file = codecs.open(qqq_file_name, 'w', 'utf-8')
- print 'Created file: ' + qqq_file_name
+ print ('Created file: ' + qqq_file_name)
qqq_file.write('{\n')
return qqq_file
@@ -126,7 +126,7 @@ def _create_lang_file(author, lang, outp
"""
lang_file_name = os.path.join(os.curdir, output_dir, lang + '.json')
lang_file = codecs.open(lang_file_name, 'w', 'utf-8')
- print 'Created file: ' + lang_file_name
+ print ('Created file: ' + lang_file_name)
# string.format doesn't like printing braces, so break up our writes.
lang_file.write('{\n\t"@metadata": {')
lang_file.write("""
@@ -166,7 +166,7 @@ def _create_key_file(output_dir):
key_file_name = os.path.join(os.curdir, output_dir, 'keys.json')
key_file = open(key_file_name, 'w')
key_file.write('{\n')
- print 'Created file: ' + key_file_name
+ print ('Created file: ' + key_file_name)
return key_file
Index: aseba-plugin-blockly-20180211+git/blockly/i18n/create_messages.py
===================================================================
--- aseba-plugin-blockly-20180211+git.orig/blockly/i18n/create_messages.py
+++ aseba-plugin-blockly-20180211+git/blockly/i18n/create_messages.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# Generate .js files defining Blockly core and language messages.
#
Index: aseba-plugin-blockly-20180211+git/blockly/i18n/dedup_json.py
===================================================================
--- aseba-plugin-blockly-20180211+git.orig/blockly/i18n/dedup_json.py
+++ aseba-plugin-blockly-20180211+git/blockly/i18n/dedup_json.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# Consolidates duplicate key-value pairs in a JSON file.
# If the same key is used with different values, no warning is given,
@@ -51,7 +51,7 @@ def main():
try:
with codecs.open(filename, 'r', 'utf-8') as infile:
j = json.load(infile)
- except ValueError, e:
+ except ValueError as e:
print('Error reading ' + filename)
raise InputError(file, str(e))
Index: aseba-plugin-blockly-20180211+git/blockly/i18n/js_to_json.py
===================================================================
--- aseba-plugin-blockly-20180211+git.orig/blockly/i18n/js_to_json.py
+++ aseba-plugin-blockly-20180211+git/blockly/i18n/js_to_json.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# Gives the translation status of the specified apps and languages.
#
Index: aseba-plugin-blockly-20180211+git/blockly/i18n/json_to_js.py
===================================================================
--- aseba-plugin-blockly-20180211+git.orig/blockly/i18n/json_to_js.py
+++ aseba-plugin-blockly-20180211+git/blockly/i18n/json_to_js.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# Converts .json files into .js files for use within Blockly apps.
#
@@ -100,7 +100,7 @@ def _process_file(path_to_json, target_l
if key != '@metadata':
try:
identifier = key_dict[key]
- except KeyError, e:
+ except KeyError as e:
print('Key "%s" is in %s but not in %s' %
(key, keyfile, args.key_file))
raise e
Index: aseba-plugin-blockly-20180211+git/blockly/i18n/tests.py
===================================================================
--- aseba-plugin-blockly-20180211+git.orig/blockly/i18n/tests.py
+++ aseba-plugin-blockly-20180211+git/blockly/i18n/tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Tests of i18n scripts.
Index: aseba-plugin-blockly-20180211+git/blockly/i18n/xliff_to_json.py
===================================================================
--- aseba-plugin-blockly-20180211+git.orig/blockly/i18n/xliff_to_json.py
+++ aseba-plugin-blockly-20180211+git/blockly/i18n/xliff_to_json.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# Converts .xlf files into .json files for use at http://translatewiki.net.
#
@@ -65,7 +65,7 @@ def _parse_trans_unit(trans_unit):
try:
result['source'] = get_value('source')
result['target'] = get_value('target')
- except InputError, e:
+ except InputError as e:
raise InputError(key, e.msg)
# Get notes, using the from value as key and the data as value.
@@ -112,8 +112,8 @@ def _process_file(filename):
except IOError:
# Don't get caught by below handler
raise
- except Exception, e:
- print
+ except Exception as e:
+ print()
raise InputError(filename, str(e))
# Make sure needed fields are present and non-empty.
@@ -146,8 +146,8 @@ def _process_file(filename):
results.append(unit)
return results
- except IOError, e:
- print 'Error with file {0}: {1}'.format(filename, e.strerror)
+ except IOError as e:
+ print ('Error with file {0}: {1}'.format(filename, e.strerror))
sys.exit(1)
Index: aseba-plugin-blockly-20180211+git/closure-library/closure/bin/scopify.py
===================================================================
--- aseba-plugin-blockly-20180211+git.orig/closure-library/closure/bin/scopify.py
+++ aseba-plugin-blockly-20180211+git/closure-library/closure/bin/scopify.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
#
# Copyright 2010 The Closure Library Authors. All Rights Reserved.
#
|