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