[projects/pld-ftp-admin] pfa-checktree: refuse to run without a terminal
arekm
arekm at pld-linux.org
Tue Oct 27 10:55:57 CET 2026
commit a8ebef597bf871064e064e4e249a38069d9605f3
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sat Oct 24 18:31:55 2026 +0200
pfa-checktree: refuse to run without a terminal
Without one curses failed with a traceback, and the cleanup after it
failed too and hid the first error.
bin/pfa-checktree | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/bin/pfa-checktree b/bin/pfa-checktree
index 124c4d9..ffe5b51 100755
--- a/bin/pfa-checktree
+++ b/bin/pfa-checktree
@@ -11,6 +11,9 @@ parser = argparse.ArgumentParser(
parser.add_argument('srctree', help='ftp tree to move from, e.g. test')
parser.add_argument('dsttree', help='ftp tree to move to, e.g. ready')
args = parser.parse_args()
+# a curses screen; fail before loading and locking the trees
+if not (sys.stdin.isatty() and sys.stdout.isatty()):
+ parser.error('needs a terminal')
# config reads ~/.ftpadmrc on import; parse options first so --help works without it
sys.path.insert(0, os.environ['HOME']+'/pld-ftp-admin/modules')
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/pld-ftp-admin.git/commitdiff/9da94db07ea316d05f5466d10ac4e10519ad6d46
More information about the pld-cvs-commit
mailing list