diff options
author | jcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5> | 2009-07-08 06:32:08 +0000 |
---|---|---|
committer | jcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5> | 2009-07-08 06:32:08 +0000 |
commit | 54e02f64a15b3a2c679399575a53b69f65bc6514 (patch) | |
tree | fceef53b27aef1abe40a53d9f818f0acc47b79a6 /grc/python/Param.py | |
parent | 103361f6898960e80f042e019369c59fef842c66 (diff) |
Adds short commandline parameter handling in GRC.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@11376 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'grc/python/Param.py')
-rw-r--r-- | grc/python/Param.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/grc/python/Param.py b/grc/python/Param.py index f971d0c3fb..15ccd323c8 100644 --- a/grc/python/Param.py +++ b/grc/python/Param.py @@ -302,6 +302,13 @@ class Param(_Param): elif t in ('string', 'file_open', 'file_save'): #do not check if file/directory exists, that is a runtime issue e = eval_string(v) + str_e = str(e) + if t == 'string' and self.get_name() == 'Short ID' and len(str_e) > 0: + try: + assert len(str_e) == 1 + ord_e = ord(str_e) + assert ord_e >= ord('a') and ord_e <= ord('z') or ord_e >= ord('A') and ord_e <= ord('Z') + except AssertionError: raise Exception, 'Short ID "%s" must be a single letter'%v return str(e) ######################### # Unique ID Type |