From e23efeb1138ab70a25153f20f3b6d9ef08194429 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Tue, 8 Jun 2021 20:51:12 +0200 Subject: nxdialog: use os.linesep to make it work on other systems --- nxdialog/bin/nxdialog | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'nxdialog') diff --git a/nxdialog/bin/nxdialog b/nxdialog/bin/nxdialog index 8713b77c1..4ef19dffc 100755 --- a/nxdialog/bin/nxdialog +++ b/nxdialog/bin/nxdialog @@ -290,7 +290,7 @@ class NxDialogProgram(object): raise except Exception as expt: - sys.stderr.write("Caught exception: %s\n" % (expt)) + sys.stderr.write("Caught exception: %s" % (expt) + os.linesep) sys.exit(EXIT_FAILURE) @staticmethod @@ -363,23 +363,23 @@ class NxDialogProgram(object): """ Disconnect/terminate NX session upon user's request. """ if not self.options.dialog_type: - sys.stderr.write("Dialog type not supplied via --dialog\n") + sys.stderr.write("Dialog type not supplied via --dialog" + os.linesep) sys.exit(EXIT_FAILURE) dlgtype = self.options.dialog_type if dlgtype not in VALID_DLG_TYPES: - sys.stderr.write("Invalid dialog type '%s'\n" % (dlgtype)) + sys.stderr.write("Invalid dialog type '%s'" % (dlgtype) + os.linesep) sys.exit(EXIT_FAILURE) if dlgtype in (DLG_TYPE_PULLDOWN, DLG_TYPE_YESNOSUSPEND, DLG_TYPE_YESNO) and self.options.agentpid is None: - sys.stderr.write("Agent pid not supplied via --parent\n") + sys.stderr.write("Agent pid not supplied via --parent" + os.linesep) sys.exit(EXIT_FAILURE) if dlgtype == DLG_TYPE_PULLDOWN and not self.options.window: - sys.stderr.write("Window id not supplied via --window\n") + sys.stderr.write("Window id not supplied via --window" + os.linesep) sys.exit(EXIT_FAILURE) if self.options.caption: @@ -397,5 +397,4 @@ class NxDialogProgram(object): self.show_dialog(message_caption, message_text) - NxDialogProgram().main() -- cgit v1.2.3