summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/asymptote/GUI/xasyValidator.py
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/asymptote/GUI/xasyValidator.py')
-rwxr-xr-xMaster/texmf-dist/asymptote/GUI/xasyValidator.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Master/texmf-dist/asymptote/GUI/xasyValidator.py b/Master/texmf-dist/asymptote/GUI/xasyValidator.py
new file mode 100755
index 00000000000..264e105441d
--- /dev/null
+++ b/Master/texmf-dist/asymptote/GUI/xasyValidator.py
@@ -0,0 +1,13 @@
+#!/usr/bin/env python3
+
+def validateFloat(text):
+ try:
+ float(text)
+ return True
+ except ValueError:
+ return False
+
+
+if __name__ == '__main__':
+ assert validateFloat('0.5')
+ assert not validateFloat('.-')