all this time you were printing tuples and didn't know it

This commit is contained in:
Timothee 'TTimo' Besset 2021-04-25 15:28:39 -05:00
parent 3aa6a90d34
commit 228557dc14
5 changed files with 14 additions and 21 deletions

View file

@ -3,6 +3,8 @@
# TTimo <ttimo@ttimo.net> # TTimo <ttimo@ttimo.net>
# http://scons.org/ # http://scons.org/
from __future__ import print_function
import sys, os, platform, pickle import sys, os, platform, pickle
import utils, config import utils, config

View file

@ -1,3 +1,5 @@
from __future__ import print_function
import sys, os, traceback, platform, re, subprocess, platform import sys, os, traceback, platform, re, subprocess, platform
import urllib3, zipfile, shutil, pprint import urllib3, zipfile, shutil, pprint
@ -287,7 +289,7 @@ class Config:
def CopyTree( self, src, dst): def CopyTree( self, src, dst):
for root, dirs, files in os.walk( src ): for root, dirs, files in os.walk( src ):
target_dir = os.path.join( dst, root[root.find( '/' )+1:] ) target_dir = os.path.join( dst, root[root.find( '/' )+1:] )
print ( target_dir ) print( target_dir )
if ( not os.path.exists( target_dir ) ): if ( not os.path.exists( target_dir ) ):
os.mkdir( target_dir ) os.mkdir( target_dir )

View file

@ -1,11 +1,13 @@
#!/usr/bin/env python #!/usr/bin/env python
from __future__ import print_function
import os.path, sys, shutil import os.path, sys, shutil
def install_file( path, src_path, f ): def install_file( path, src_path, f ):
src = os.path.join( src_path, f ) src = os.path.join( src_path, f )
dst = os.path.join( path, f ) dst = os.path.join( path, f )
print '%s -> %s' % ( src, dst ) print('%s -> %s' % ( src, dst ))
shutil.copyfile( src, dst ) shutil.copyfile( src, dst )
def install( path, src_path ): def install( path, src_path ):
@ -42,7 +44,7 @@ def install( path, src_path ):
if __name__ == '__main__': if __name__ == '__main__':
if ( len( sys.argv ) <= 2 or not os.path.exists( sys.argv[1] ) or not os.path.exists( sys.argv[2] ) ): 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) 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] ) install( sys.argv[1], sys.argv[2] )

View file

@ -1,3 +1,5 @@
from __future__ import print_function
import os, time, zipfile, functools, pprint, subprocess import os, time, zipfile, functools, pprint, subprocess
if ( __name__ == '__main__' ): if ( __name__ == '__main__' ):

View file

@ -3,6 +3,8 @@
# TTimo <ttimo@ttimo.net> # TTimo <ttimo@ttimo.net>
# http://scons.org/ # http://scons.org/
from __future__ import print_function
import os, subprocess, platform, xml.sax, re, string, platform import os, subprocess, platform, xml.sax, re, string, platform
class vcxproj( xml.sax.handler.ContentHandler ): class vcxproj( xml.sax.handler.ContentHandler ):
@ -116,20 +118,3 @@ def Enum(*names):
constants = tuple(constants) constants = tuple(constants)
EnumType = EnumClass() EnumType = EnumClass()
return EnumType 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