fixed refactoring issues in mobility.py, fixed issue with parsing config files in a tuple string format

This commit is contained in:
Blake J. Harnden 2017-08-02 14:07:56 -07:00
parent 4d21314798
commit 05ce19b0c0
4 changed files with 24 additions and 15 deletions

View file

@ -106,7 +106,9 @@ def maketuplefromstr(s, value_type):
:return: tuple from string
:rtype: tuple
"""
return tuple(value_type(i) for i in s.split(","))
# remove tuple braces and strip commands and space from all values in the tuple string
values = [x.strip("' ") for x in s.strip("(), ").split(",")]
return tuple(value_type(i) for i in values)
def mutecall(*args, **kwargs):