From 288388f14e729eacde947752b655e4b26e8455a4 Mon Sep 17 00:00:00 2001 From: Alexey Masterov Date: Thu, 5 Sep 2024 11:11:26 +0200 Subject: [PATCH] remove the temp script --- scripts/copy2local.py | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 scripts/copy2local.py diff --git a/scripts/copy2local.py b/scripts/copy2local.py deleted file mode 100644 index 64a5b5efee..0000000000 --- a/scripts/copy2local.py +++ /dev/null @@ -1,28 +0,0 @@ -import sys -import os - -if len(sys.argv) == 0: - print('Usage: copy2local.py filename') - sys.exit(2) - -for arg in sys.argv[1:]: - print(arg) - tmpname = f"{arg}.tmp" - with open(arg, encoding='utf-8') as src: - with open(tmpname, 'w', encoding='utf-8') as dst: - line = src.readline() - while line: - ld = line.split() - if len(ld) > 3 and ld[0].upper() == "COPY" and \ - ld[2].upper() in {'FROM', 'TO'} and ld[3].upper() != 'STDIN': - l1 = f"\\set command '\\\\copy {ld[1]} {ld[2]} ' {ld[3]} " + " ".join( - ld[4:]) + "\n" - print(l1) - dst.write(l1) - dst.write(':command\n') - else: - dst.write(line) - line = src.readline() - os.unlink(arg) - os.link(tmpname, arg) - os.unlink(tmpname)