mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-05 03:22:29 +00:00
Clean-up unused methods and reuse more common utils
This commit is contained in:
8
telethon_generator/utils.py
Normal file
8
telethon_generator/utils.py
Normal file
@@ -0,0 +1,8 @@
|
||||
import re
|
||||
|
||||
|
||||
def snake_to_camel_case(name, suffix=None):
|
||||
# Courtesy of http://stackoverflow.com/a/31531797/4759433
|
||||
result = re.sub(r'_([a-z])', lambda m: m.group(1).upper(), name.lower())
|
||||
result = result[:1].upper() + result[1:].replace('_', '')
|
||||
return result + suffix if suffix else result
|
Reference in New Issue
Block a user