Blame SOURCES/texlive-2017-python3.patch

e946be
diff -up doc/xelatex/xepersian/dkun-0.3.py.than doc/xelatex/xepersian/dkun-0.3.py
e946be
--- doc/xelatex/xepersian/dkun-0.3.py.than	2018-05-07 11:52:01.795308478 +0200
e946be
+++ doc/xelatex/xepersian/dkun-0.3.py	2018-05-07 11:53:32.984620222 +0200
e946be
@@ -1,4 +1,4 @@
e946be
-#! /usr/bin/env python
e946be
+#! /usr/bin/python3
e946be
 
e946be
 #########################################
e946be
 #	General Public License          #
e946be
@@ -311,7 +311,7 @@ def dk_adjust_shaping(text, i):
e946be
 	try:
e946be
 		u = table_DK_UN[current][0]
e946be
 	except KeyError:
e946be
-		print 'ERROR: unmapped character'
e946be
+		print('ERROR: unmapped character')
e946be
 		return u''
e946be
 
e946be
 	#if you don't want shaping remove the following comment
e946be
@@ -407,7 +407,7 @@ def needs_english_wrapper(part):
e946be
 
e946be
 # Main body of the program 
e946be
 if len(sys.argv) <= 2:
e946be
-	print 'usage: python dkun in_filename out_filename'
e946be
+	print('usage: python dkun in_filename out_filename')
e946be
 	exit(0)
e946be
 
e946be
 filename = sys.argv[1]
e946be
@@ -416,13 +416,13 @@ outfile = sys.argv[2]
e946be
 try:
e946be
 	f = open(filename, 'r')
e946be
 except IOError:
e946be
-	print "Can not open the input file: " + filename
e946be
+	print("Can not open the input file: " + filename)
e946be
 	exit(0)
e946be
 
e946be
 try:
e946be
 	of = codecs.open(outfile, encoding='utf-8', mode='w')
e946be
 except IOError:
e946be
-	print "Can not open the output file: " + outfile
e946be
+	print("Can not open the output file: " + outfile)
e946be
 	exit(0)
e946be
 
e946be
 line_number = 0
e946be
diff -up doc/xelatex/xepersian/dkun-0.4.py.than doc/xelatex/xepersian/dkun-0.4.py
e946be
--- doc/xelatex/xepersian/dkun-0.4.py.than	2018-05-07 11:53:54.187692708 +0200
e946be
+++ doc/xelatex/xepersian/dkun-0.4.py	2018-05-07 11:54:32.272822907 +0200
e946be
@@ -1,4 +1,4 @@
e946be
-#! /usr/bin/env python
e946be
+#! /usr/bin/python3
e946be
 
e946be
 #########################################
e946be
 #	General Public License          #
e946be
@@ -311,7 +311,7 @@ def dk_adjust_shaping(text, i):
e946be
 	try:
e946be
 		u = table_DK_UN[current][0]
e946be
 	except KeyError:
e946be
-		print 'ERROR: unmapped character'
e946be
+		print('ERROR: unmapped character')
e946be
 		return u''
e946be
 
e946be
 	#if you don't want shaping remove the following comment
e946be
@@ -407,7 +407,7 @@ def needs_english_wrapper(part):
e946be
 
e946be
 # Main body of the program 
e946be
 if len(sys.argv) <= 2:
e946be
-	print 'usage: python dkun in_filename out_filename'
e946be
+	print('usage: python dkun in_filename out_filename')
e946be
 	exit(0)
e946be
 
e946be
 filename = sys.argv[1]
e946be
@@ -416,13 +416,13 @@ outfile = sys.argv[2]
e946be
 try:
e946be
 	f = open(filename, 'r')
e946be
 except IOError:
e946be
-	print "Can not open the input file: " + filename
e946be
+	print("Can not open the input file: " + filename)
e946be
 	exit(0)
e946be
 
e946be
 try:
e946be
 	of = codecs.open(outfile, encoding='utf-8', mode='w')
e946be
 except IOError:
e946be
-	print "Can not open the output file: " + outfile
e946be
+	print("Can not open the output file: " + outfile)
e946be
 	exit(0)
e946be
 
e946be
 line_number = 0
e946be
diff -up doc/xelatex/xepersian/ftxe-0.12.py.than doc/xelatex/xepersian/ftxe-0.12.py
e946be
--- doc/xelatex/xepersian/ftxe-0.12.py.than	2018-05-07 11:54:55.163901164 +0200
e946be
+++ doc/xelatex/xepersian/ftxe-0.12.py	2018-05-07 11:57:58.063526433 +0200
e946be
@@ -1,4 +1,6 @@
e946be
-#  This program is free software: you can redistribute it and/or modify
e946be
+#! /usr/bin/python3
e946be
+
e946be
+#  This program is free software: you can redistribute it and/or modify
e946be
 #  it under the terms of the GNU General Public License as published by
e946be
 #  the Free Software Foundation, either version 3 of the License, or
e946be
 #  (at your option) any later version.
e946be
@@ -488,7 +490,7 @@ def read_size(input,index,last_index):
e946be
 			dim_index = pt_index
e946be
 	next_cmd = input.find(u'\\', index)
e946be
 	if (next_cmd == -1 and dim_index == -1):
e946be
-		print "Error in parsing \epsfxsize command at " + str(line_number) + "\n"
e946be
+		print("Error in parsing \epsfxsize command at " + str(line_number) + "\n")
e946be
 		return -1
e946be
 	elif (next_cmd == -1 or (dim_index != -1 and next_cmd > dim_index)):
e946be
 		epsfxsize = input[index:dim_index+2]
e946be
@@ -499,7 +501,7 @@ def read_size(input,index,last_index):
e946be
 			end_cmd += 1
e946be
 		return end_cmd
e946be
 	else:
e946be
-		print "Error in parsing \epsfxsize command at " + str(line_number) + "\n"
e946be
+		print("Error in parsing \epsfxsize command at " + str(line_number) + "\n")
e946be
 		return -1
e946be
 
e946be
 
e946be
@@ -567,7 +569,7 @@ def generate_farsitex_cmds_file(helper_f
e946be
 	try:
e946be
 		of = codecs.open(helper_filename, encoding='utf-8', mode='w')
e946be
 	except IOError:
e946be
-		print "Can not open the output file: " + helper_filename
e946be
+		print("Can not open the output file: " + helper_filename)
e946be
 		exit(0)
e946be
 	of.write(preamble)
e946be
 	of.close
e946be
@@ -875,7 +877,7 @@ def convert_file(f, of, convert_cmds):
e946be
 
e946be
 	for line in f:
e946be
 		line_number += 1
e946be
-		print line_number,
e946be
+		print (line_number)
e946be
 		output_line = u''
e946be
 		line_len = len(line)
e946be
 		
e946be
@@ -888,7 +890,7 @@ def convert_file(f, of, convert_cmds):
e946be
 		# check line-direction character
e946be
 		line_direction_rtl = (line[0] == '<')
e946be
 		if (line[0] != '>') and (line[0] != '<'):
e946be
-			print "FORMAT ERROR AT LINE: " + str(line_number)
e946be
+			print("FORMAT ERROR AT LINE: " + str(line_number))
e946be
 			exit(0)
e946be
 	
e946be
 		i = 1
e946be
@@ -970,11 +972,11 @@ def convert_file(f, of, convert_cmds):
e946be
 	# end of file processing
e946be
 
e946be
 def print_usage():
e946be
-	print 'usage: python ftxe-0-11 [-r] [-s] [-x] [-u] in_filename1 in_filename2'
e946be
-	print '-r: (DEFAULT) recursively consider files included in the given files'
e946be
-	print '-s: do not recursively consider files'
e946be
-	print '-x: (DEFAULT) insert xepersian related commands'
e946be
-	print '-u: only convert to unicode'
e946be
+	print('usage: python ftxe-0-11 [-r] [-s] [-x] [-u] in_filename1 in_filename2')
e946be
+	print('-r: (DEFAULT) recursively consider files included in the given files')
e946be
+	print('-s: do not recursively consider files')
e946be
+	print('-x: (DEFAULT) insert xepersian related commands')
e946be
+	print('-u: only convert to unicode')
e946be
 
e946be
 ###################################
e946be
 # Begin of main body of the program
e946be
@@ -1011,7 +1013,7 @@ while (options_index < len(sys.argv)):
e946be
 	options_index += 1
e946be
 
e946be
 if (len(filenames) == 0):
e946be
-	print 'error: no input filename is specified!'
e946be
+	print('error: no input filename is specified!')
e946be
 	print_usage()
e946be
 	exit(0)
e946be
 	
e946be
@@ -1026,17 +1028,17 @@ while (index < len(filenames)):
e946be
 	else: 
e946be
 		outfile = filename + '.tex'
e946be
 
e946be
-	print '\n\nConverting "' + filename + '" into "' + outfile + '"'
e946be
+	print('\n\nConverting "' + filename + '" into "' + outfile + '"')
e946be
 	try:
e946be
 		f = open(filename, 'r')
e946be
 	except IOError:
e946be
-		print "Can not open the input file: " + filename
e946be
+		print("Can not open the input file: " + filename)
e946be
 		exit(0)
e946be
 
e946be
 	try:
e946be
 		of = codecs.open(outfile, encoding='utf-8', mode='w')
e946be
 	except IOError:
e946be
-		print "Can not open the output file: " + outfile
e946be
+		print("Can not open the output file: " + outfile)
e946be
 		exit(0)
e946be
 
e946be
 	convert_file(f, of, convert_xepersian)
e946be
diff -up doc/xelatex/xepersian/undk-0.6.py.than doc/xelatex/xepersian/undk-0.6.py
e946be
--- doc/xelatex/xepersian/undk-0.6.py.than	2018-05-07 11:58:18.706597005 +0200
e946be
+++ doc/xelatex/xepersian/undk-0.6.py	2018-05-07 11:59:18.079799981 +0200
e946be
@@ -1,4 +1,4 @@
e946be
-#! /usr/bin/env python
e946be
+#! /usr/bin/python3
e946be
 #########################################
e946be
 #	General Public License          #
e946be
 #	Author:	Mostafa Vahedi          #
e946be
@@ -328,7 +328,7 @@ def find_form(line, i):
e946be
 def map_char_unicode_DK(c, form):
e946be
 	try:
e946be
 		n = table_UN_DK[c][0]
e946be
-        except KeyError:
e946be
+	except KeyError:
e946be
 		return c.encode('latin-1')
e946be
 	if (n == 1):
e946be
 		return table_UN_DK[c][1]
e946be
@@ -371,7 +371,7 @@ def is_farsi_numerical(c):
e946be
 
e946be
 # Main body of the program 
e946be
 if len(sys.argv) <= 2:
e946be
-	print 'usage: python undk in_filename out_filename'
e946be
+	print('usage: python undk in_filename out_filename')
e946be
 	exit(0)
e946be
 
e946be
 filename = sys.argv[1]
e946be
@@ -380,13 +380,13 @@ outfile = sys.argv[2]
e946be
 try:
e946be
 	f = codecs.open(filename, 'r', 'utf-8')
e946be
 except IOError:
e946be
-	print "Can not open the input file: " + filename
e946be
+	print("Can not open the input file: " + filename)
e946be
 	exit(0)
e946be
 
e946be
 try:
e946be
 	of = open(outfile, 'w')
e946be
 except IOError:
e946be
-	print "Can not open the output file: " + outfile
e946be
+	print("Can not open the output file: " + outfile)
e946be
 	exit(0)
e946be
 
e946be
 # this is an option
e946be
@@ -425,7 +425,7 @@ for line in f:
e946be
 					this_line += auto_english_part[::-1]
e946be
 					auto_english_part = ''
e946be
 					inAutoEnglish = 0
e946be
-					print 'Warning: mixed Auto-English and Forced-English'
e946be
+					print('Warning: mixed Auto-English and Forced-English')
e946be
 				if (inFarsiNumber == 1):
e946be
 					this_line += number_part[::-1]
e946be
 					number_part = ''
e946be
diff -up doc/xelatex/xepersian/unldk-0.2.py.than doc/xelatex/xepersian/unldk-0.2.py
e946be
--- doc/xelatex/xepersian/unldk-0.2.py.than	2018-05-07 11:59:41.522880125 +0200
e946be
+++ doc/xelatex/xepersian/unldk-0.2.py	2018-05-07 12:00:21.999018500 +0200
e946be
@@ -1,4 +1,4 @@
e946be
-#! /usr/bin/env python
e946be
+#! /usr/bin/python3
e946be
 #########################################
e946be
 #	General Public License          #
e946be
 #	Author:	Mostafa Vahedi          #
e946be
@@ -328,7 +328,7 @@ def find_form(line, i):
e946be
 def map_char_unicode_DK(c, form):
e946be
 	try:
e946be
 		n = table_UN_DK[c][0]
e946be
-        except KeyError:
e946be
+	except KeyError:
e946be
 		return c.encode('latin-1')
e946be
 	if (n == 1):
e946be
 		return table_UN_DK[c][1]
e946be
@@ -364,7 +364,7 @@ def is_farsi_numerical(c):
e946be
 
e946be
 # Main body of the program 
e946be
 if len(sys.argv) <= 2:
e946be
-	print 'usage: python unldk in_filename out_filename'
e946be
+	print('usage: python unldk in_filename out_filename')
e946be
 	exit(0)
e946be
 
e946be
 filename = sys.argv[1]
e946be
@@ -373,13 +373,13 @@ outfile = sys.argv[2]
e946be
 try:
e946be
 	f = codecs.open(filename, 'r', 'utf-8')
e946be
 except IOError:
e946be
-	print "Can not open the input file: " + filename
e946be
+	print("Can not open the input file: " + filename)
e946be
 	exit(0)
e946be
 
e946be
 try:
e946be
 	of = open(outfile, 'w')
e946be
 except IOError:
e946be
-	print "Can not open the output file: " + outfile
e946be
+	print("Can not open the output file: " + outfile)
e946be
 	exit(0)
e946be
 
e946be
 inFarsi = 0