aboutsummaryrefslogtreecommitdiff
path: root/nxdialog/bin/nxdialog
diff options
context:
space:
mode:
Diffstat (limited to 'nxdialog/bin/nxdialog')
-rwxr-xr-xnxdialog/bin/nxdialog24
1 files changed, 10 insertions, 14 deletions
diff --git a/nxdialog/bin/nxdialog b/nxdialog/bin/nxdialog
index ab0dbf17f..4ef19dffc 100755
--- a/nxdialog/bin/nxdialog
+++ b/nxdialog/bin/nxdialog
@@ -8,7 +8,7 @@
# shebang line.
# Copyright (C) 2008 Google Inc.
-# Copyright (C) 2019 Ulrich Sibiller <uli42@gmx.de>
+# Copyright (C) 2019-2021 Ulrich Sibiller <uli42@gmx.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -29,13 +29,13 @@
# Google project "neatx" (https://code.google.com/archive/p/neatx/).
# List of changes:
# - pulled in the few parts of the neatx python modules that are actually
-# to make it a standlone script
+# required to make it a standlone script
# - added usage output
# - dropped logging code, print errors to stderr
# - can handle the "yesno" dialog type
# - added missing docstrings
# - pylint improvements
-# - removed neatx entry from the pulldoww menu
+# - removed neatx entry from the pulldown menu
# - use PyGObject instead of PyGtk and thus Gtk3
# - replace optparse by argparse
# - make code compatible to python2 and python3.
@@ -46,11 +46,8 @@
# nxcomp library assumes this script is located in /usr/NX/bin/nxclient
#
# Examples:
-# nxdialog --dialog yesno --message "message text" --caption "message title" --parent 0
-# nxdialog --dialog pulldown --message "message text" --caption "message title" \
-# --window 0x123456 --parent 0
-#
-# pylint: disable=fixme, broad-except
+# nxdialog --dialog yesno --message "text" --caption "title" --parent 0
+# nxdialog --dialog pulldown --message "text" --caption "title" --window 0x123456 --parent 0
from __future__ import print_function
@@ -293,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
@@ -366,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:
@@ -400,5 +397,4 @@ class NxDialogProgram(object):
self.show_dialog(message_caption, message_text)
-
NxDialogProgram().main()