diff --git a/Scripts/AmaroLib.py b/Scripts/AmaroLib.py index 42cffd2..d441c85 100644 --- a/Scripts/AmaroLib.py +++ b/Scripts/AmaroLib.py @@ -295,7 +295,11 @@ def variableNameForString(self, id_, prefixesToStrip = None, suffixesToStrip = N if lower: result = self.smartLowerCase(result) - + + if len(result) < 1: + print('variableNameForString result is too short. Returning id {}'.format(self.smartLowerCase(id_))) + return self.smartLowerCase(id_) + return result def smartLowerCase(self, s): @@ -304,7 +308,7 @@ def smartLowerCase(self, s): if len(s) > 2 and s[1].isupper(): return s - return s[0].lower() + s[1:] + return s[:1].lower() + s[1:] def die(self, message): print('error: ' + message, file = sys.stderr)