comparison install-static @ 52:243603aaab7e draft

Clean up the code a bit.
author David Barts <n5jrn@me.com>
date Thu, 30 May 2019 22:19:41 -0700
parents caed7c5e8318
children 60907204a265
comparison
equal deleted inserted replaced
51:caed7c5e8318 52:243603aaab7e
47 shutil.move(spath, tpath) 47 shutil.move(spath, tpath)
48 else: 48 else:
49 print("cp", repr(spath), repr(tpath)) 49 print("cp", repr(spath), repr(tpath))
50 copyfile(spath, tpath) 50 copyfile(spath, tpath)
51 elif S_ISDIR(stype): 51 elif S_ISDIR(stype):
52 if ttype is not None: 52 if ttype is None:
53 if not S_ISDIR(ttype):
54 sys.stderr.write(
55 "{0}: {1!r} not a directory\n".format(MYNAME, tpath))
56 sys.exit(1)
57 else:
58 print("mkdir", repr(tpath)) 53 print("mkdir", repr(tpath))
59 os.mkdir(tpath) 54 os.mkdir(tpath)
55 elif not S_ISDIR(ttype):
56 sys.stderr.write(
57 "{0}: {1!r} not a directory\n".format(MYNAME, tpath))
58 sys.exit(1)
60 copydir(spath, tpath, False) 59 copydir(spath, tpath, False)
61 else: 60 else:
62 sys.stderr.write( 61 sys.stderr.write(
63 "{0}: warning - {1!r} not a file or directory\n".format(spath)) 62 "{0}: warning - {1!r} not a file or directory\n".format(spath))
64 63