Blame SOURCES/texlive-2017-python3.patch

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