[Bf-extensions-cvs] [71c8fa17] blender-v2.82-release: PDT: Strip spaces from Command Line input
Alan Odom
noreply at git.blender.org
Tue Jan 14 22:32:15 CET 2020
Commit: 71c8fa1712083e83060f11321fb287eb75ed7a68
Author: Alan Odom
Date: Fri Jan 10 20:19:58 2020 +0000
Branches: blender-v2.82-release
https://developer.blender.org/rBA71c8fa1712083e83060f11321fb287eb75ed7a68
PDT: Strip spaces from Command Line input
Also ignores blank commands rather than showing an error message.
===================================================================
M precision_drawing_tools/pdt_command.py
===================================================================
diff --git a/precision_drawing_tools/pdt_command.py b/precision_drawing_tools/pdt_command.py
index 6e4a70cd..eb45f73a 100644
--- a/precision_drawing_tools/pdt_command.py
+++ b/precision_drawing_tools/pdt_command.py
@@ -175,14 +175,16 @@ def command_run(self, context):
scene = context.scene
pg = scene.pdt_pg
- cmd = pg.command
+ cmd = pg.command.strip()
- if cmd.strip() == "?" or cmd.lower().strip() == "help":
+ if cmd == "?" or cmd.lower() == "help":
# fmt: off
context.window_manager.popup_menu(pdt_help, title="PDT Command Line Help", icon="INFO")
# fmt: on
return
- if len(cmd) < 3:
+ elif cmd == "":
+ return
+ elif len(cmd) < 3:
pg.error = PDT_ERR_CHARS_NUM
context.window_manager.popup_menu(oops, title="Error", icon="ERROR")
return
More information about the Bf-extensions-cvs
mailing list