[X2Go-Commits] [x2goclient] 09/38: pyhoca-cli: Follow-up fix for --dpi switch. Fix input value verification. Only demand an integer, if args.dpi is set to something else than None.

git-admin at x2go.org git-admin at x2go.org
Fri Dec 15 21:15:12 CET 2023


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2goclient.

commit 7928f2e770a369a0338612660695cff456e39c5b
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Fri Aug 20 14:44:09 2021 +0200

    pyhoca-cli: Follow-up fix for --dpi switch. Fix input value verification. Only demand an integer, if args.dpi is set to something else than None.
---
 debian/changelog |  2 ++
 pyhoca-cli       | 12 +++++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index fbdf35b2..839f81a7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,8 @@ pyhoca-cli (0.6.1.3-0x2go1) UNRELEASED; urgency=medium
     - pyhoca-cli: Add cmdline parameter --dpi.
     - pyhoca-cli: Do input check on value passed in via the --link option.
     - pyhoca-cli: Add cmdline parameter --clipboard-mode.
+    - pyhoca-cli: Follow-up fix for --dpi switch. Fix input value verification.
+      Only demand an integer, if args.dpi is set to something else than None.
 
   [ Daniel Teichmann ]
   * New upstream release (0.6.1.3):
diff --git a/pyhoca-cli b/pyhoca-cli
index 1d5b0726..18bbf362 100755
--- a/pyhoca-cli
+++ b/pyhoca-cli
@@ -426,11 +426,13 @@ Possible values for the --pack NX option are:
         runtime_error ("value for cmd line argument --link is not any of 'modem', 'isdn', 'adsl', 'wan' or 'lan'", parser=p, exitcode=1)
 
     # input check for --dpi
-    try:
-        if int(a.dpi) < 20 or int(a.dpi) > 400:
-            runtime_error ("value for cmd line argument --dpi must be between 20 and 400", parser=p, exitcode=1)
-    except ValueError:
-        runtime_error ("value for cmd line argument --dpi must be an positive integer value between 20 and 400", parser=p, exitcode=1)
+
+    if a.dpi:
+        try:
+            if int(a.dpi) < 20 or int(a.dpi) > 400:
+                runtime_error ("value for cmd line argument --dpi must be between 20 and 400", parser=p, exitcode=1)
+        except ValueError:
+            runtime_error ("value for cmd line argument --dpi must be an positive integer value between 20 and 400", parser=p, exitcode=1)
 
     # input check for --clipboard-mode
     a.clipboard_mode = a.clipboard_mode.lower()

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goclient.git


More information about the x2go-commits mailing list