From 02a369bf5af169b393b5ffffa503c4d3ea6bb7cb Mon Sep 17 00:00:00 2001 From: v4hn Date: Thu, 10 Oct 2019 11:48:31 +0200 Subject: [PATCH 1/2] python3 fixup: changed print syntax --- _scripts/tutorialformatter.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/_scripts/tutorialformatter.py b/_scripts/tutorialformatter.py index 0f774a4c7..e90b84f0f 100644 --- a/_scripts/tutorialformatter.py +++ b/_scripts/tutorialformatter.py @@ -44,7 +44,7 @@ # BEGIN_SUB_TUTORIAL callbackFunction def callback(): - print "in callback" + print("in callback") # END_SUB_TUTORIAL # BEGIN_TUTORIAL @@ -118,7 +118,7 @@ def flatten_sub_tutorials(self, file_): if sub_name in subs: flattened_lines.extend( subs[sub_name] ) else: - print 'tutorialformatter.py error: sub-tutorial %s not found.' % sub_name + print('tutorialformatter.py error: sub-tutorial %s not found.' % sub_name) else: flattened_lines.append( line ) return flattened_lines @@ -144,7 +144,7 @@ def run(self): code_prefix = '\n.. code-block:: ' + language + '\n\n' code_suffix = '\n' - print "tutorial-formatter running on", absfilename + print("tutorial-formatter running on " + absfilename) file_ = open( absfilename, 'r' ) text_to_process = "" current_block = "" @@ -187,9 +187,9 @@ def run(self): text_to_process += current_block # Debug writes... - # print 'text_to_process =' - # print text_to_process - # print '= text_to_process' + # print('text_to_process =') + # print(text_to_process) + # print('= text_to_process') lines = string2lines( text_to_process ) self.state_machine.insert_input( lines, absfilename ) From ce74575b123d851b5da3b1fe75355503c0b0300a Mon Sep 17 00:00:00 2001 From: v4hn Date: Wed, 16 Oct 2019 15:57:34 +0200 Subject: [PATCH 2/2] include the print function for good measures --- _scripts/tutorialformatter.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/_scripts/tutorialformatter.py b/_scripts/tutorialformatter.py index e90b84f0f..33d58282c 100644 --- a/_scripts/tutorialformatter.py +++ b/_scripts/tutorialformatter.py @@ -70,6 +70,9 @@ def callback(): # 0.1.1: fixed a bug in source file directory lookup: now source paths are # relative to the directory in which the including document lives. # 0.1.2: Added SUB_TUTORIAL support. + +from __future__ import print_function + __version__ = '0.1.2' import os