aboutsummaryrefslogtreecommitdiff
path: root/codegen/lib/utils.py
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-05-24 23:05:44 -0500
committermat <github@matdoes.dev>2022-05-24 23:05:44 -0500
commitfb3b002d94076de463e2af776666387db9e75835 (patch)
treea40cff192e4175babaa842e4b3facd17e97e6806 /codegen/lib/utils.py
parent0a314bca16f6de199c319ffb0d84a5d5c3a61387 (diff)
downloadazalea-drasl-fb3b002d94076de463e2af776666387db9e75835.tar.xz
start adding migrate
Diffstat (limited to 'codegen/lib/utils.py')
-rw-r--r--codegen/lib/utils.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/codegen/lib/utils.py b/codegen/lib/utils.py
index 5336d574..051ffe51 100644
--- a/codegen/lib/utils.py
+++ b/codegen/lib/utils.py
@@ -1,15 +1,15 @@
-import urllib.request
-import gzip
-import json
import re
-import io
-def to_snake_case(name):
+def to_snake_case(name: str):
s = re.sub('([A-Z])', r'_\1', name)
return s.lower().strip('_')
-def to_camel_case(name):
+def to_camel_case(name: str):
s = re.sub('_([a-z])', lambda m: m.group(1).upper(), name)
return s[0].upper() + s[1:]
+
+
+def padded_hex(n: int):
+ return f'0x{n:02x}'