From 2e2e3d62d6ca8afdd99b93685aae4e7069d6dc26 Mon Sep 17 00:00:00 2001 From: Anaminus Date: Fri, 30 Jan 2015 06:22:47 -0600 Subject: [PATCH] fixed toggle_snake_camel_pascal not handling single-word lowercase variables When a variable is a single word that is lowercase, it is treated as camelCase so that it toggles to PascalCase, which is more convenient than doing nothing. --- case_conversion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/case_conversion.py b/case_conversion.py index 03cdaaa..ef4aed0 100644 --- a/case_conversion.py +++ b/case_conversion.py @@ -58,7 +58,7 @@ def toggle_case(text, detectAcronyms, acronyms): return to_snake_case(text, detectAcronyms, acronyms) elif case == 'lower' and sep == '_': return to_camel_case(text, detectAcronyms, acronyms) - elif case == 'camel' and not sep: + elif (case == 'camel' or case == 'lower') and not sep: return to_pascal_case(text, detectAcronyms, acronyms) else: return text