From 228557dc14dd61d22a5eb0b06d1ede2fd4167893 Mon Sep 17 00:00:00 2001 From: Timothee 'TTimo' Besset Date: Sun, 25 Apr 2021 15:28:39 -0500 Subject: [PATCH] all this time you were printing tuples and didn't know it --- SConstruct | 2 ++ config.py | 4 +++- install.py | 8 +++++--- prepare_archive.py | 2 ++ utils.py | 19 ++----------------- 5 files changed, 14 insertions(+), 21 deletions(-) diff --git a/SConstruct b/SConstruct index d7a532a7..e5177673 100644 --- a/SConstruct +++ b/SConstruct @@ -3,6 +3,8 @@ # TTimo # http://scons.org/ +from __future__ import print_function + import sys, os, platform, pickle import utils, config diff --git a/config.py b/config.py index 0c5b572a..c3986870 100644 --- a/config.py +++ b/config.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import sys, os, traceback, platform, re, subprocess, platform import urllib3, zipfile, shutil, pprint @@ -287,7 +289,7 @@ class Config: def CopyTree( self, src, dst): for root, dirs, files in os.walk( src ): target_dir = os.path.join( dst, root[root.find( '/' )+1:] ) - print ( target_dir ) + print( target_dir ) if ( not os.path.exists( target_dir ) ): os.mkdir( target_dir ) diff --git a/install.py b/install.py index cf0a74ba..d70be33d 100644 --- a/install.py +++ b/install.py @@ -1,11 +1,13 @@ #!/usr/bin/env python +from __future__ import print_function + import os.path, sys, shutil def install_file( path, src_path, f ): src = os.path.join( src_path, f ) dst = os.path.join( path, f ) - print '%s -> %s' % ( src, dst ) + print('%s -> %s' % ( src, dst )) shutil.copyfile( src, dst ) def install( path, src_path ): @@ -42,7 +44,7 @@ def install( path, src_path ): if __name__ == '__main__': if ( len( sys.argv ) <= 2 or not os.path.exists( sys.argv[1] ) or not os.path.exists( sys.argv[2] ) ): - print 'usage: install [target directory] [source directory]' + print('usage: install [target directory] [source directory]') sys.exit(1) - print 'Install %s into %s' % ( sys.argv[2], sys.argv[1] ) + print('Install %s into %s' % ( sys.argv[2], sys.argv[1] )) install( sys.argv[1], sys.argv[2] ) diff --git a/prepare_archive.py b/prepare_archive.py index d554c0af..b68afe79 100644 --- a/prepare_archive.py +++ b/prepare_archive.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import os, time, zipfile, functools, pprint, subprocess if ( __name__ == '__main__' ): diff --git a/utils.py b/utils.py index 0a9cd6d0..f076cb23 100644 --- a/utils.py +++ b/utils.py @@ -3,6 +3,8 @@ # TTimo # http://scons.org/ +from __future__ import print_function + import os, subprocess, platform, xml.sax, re, string, platform class vcxproj( xml.sax.handler.ContentHandler ): @@ -116,20 +118,3 @@ def Enum(*names): constants = tuple(constants) EnumType = EnumClass() return EnumType - -#if __name__ == '__main__': -# print '\n*** Enum Demo ***' -# print '--- Days of week ---' -# Days = Enum('Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su') -# print Days -# print Days.Mo -# print Days.Fr -# print Days.Mo < Days.Fr -# print list(Days) -# for each in Days: -# print 'Day:', each -# print '--- Yes/No ---' -# Confirmation = Enum('No', 'Yes') -# answer = Confirmation.No -# print 'Your answer is not', ~answer -