diff options
| author | rr- <rr-@sakuya.pl> | 2016-06-18 10:55:44 +0200 |
|---|---|---|
| committer | rr- <rr-@sakuya.pl> | 2016-06-18 10:55:44 +0200 |
| commit | 3c3d0dbb8d4e83eab6e3b7243f434647a3942c04 (patch) | |
| tree | e79de2a3c4036eb991aed33061f8d6f7cedb6fd7 /server/szurubooru/func/util.py | |
| parent | 4b39e79d5bee038d04299f06194cd6ba0731f272 (diff) | |
server/info: expose a few config variables
Diffstat (limited to 'server/szurubooru/func/util.py')
| -rw-r--r-- | server/szurubooru/func/util.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/server/szurubooru/func/util.py b/server/szurubooru/func/util.py index 270bf47..65fc196 100644 --- a/server/szurubooru/func/util.py +++ b/server/szurubooru/func/util.py @@ -6,6 +6,16 @@ import tempfile from contextlib import contextmanager from szurubooru import errors +def snake_case_to_lower_camel_case(text): + components = text.split('_') + return components[0] + ''.join(word[0].upper() + word[1:] for word in components[1:]) + +def snake_case_to_lower_camel_case_keys(source): + target = {} + for key, value in source.items(): + target[snake_case_to_lower_camel_case(key)] = value + return target + def get_serialization_options(ctx): return ctx.get_param_as_list('fields', required=False, default=None) |