Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Odom <clockmender@icloud.com>2020-01-10 23:19:58 +0300
committerRune Morling <ermo.blender.org@spammesenseless.net>2020-01-15 00:29:45 +0300
commit71c8fa1712083e83060f11321fb287eb75ed7a68 (patch)
tree9403b7bac587b58edaa98b6b93cedbdb9a661661 /precision_drawing_tools/pdt_command.py
parent9055e2684235210b4504207738e2133c78004b19 (diff)
PDT: Strip spaces from Command Line input
Also ignores blank commands rather than showing an error message.
Diffstat (limited to 'precision_drawing_tools/pdt_command.py')
-rw-r--r--precision_drawing_tools/pdt_command.py8
1 files changed, 5 insertions, 3 deletions
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