From c7f9dc4b3d0ac7a0d85a087874c192a788b383b9 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 23 May 2024 03:29:37 +0000 Subject: remove all references to clean_property_name --- codegen/lib/code/blocks.py | 2 -- codegen/lib/code/shapes.py | 2 -- codegen/lib/code/utils.py | 13 ------------- 3 files changed, 17 deletions(-) (limited to 'codegen') diff --git a/codegen/lib/code/blocks.py b/codegen/lib/code/blocks.py index 05788731..cda95339 100755 --- a/codegen/lib/code/blocks.py +++ b/codegen/lib/code/blocks.py @@ -1,5 +1,4 @@ from lib.utils import get_dir_location, to_camel_case -from lib.code.utils import clean_property_name from ..mappings import Mappings from typing import Optional import re @@ -56,7 +55,6 @@ def generate_blocks(blocks_burger: dict, blocks_report: dict, pixlyzer_block_dat block_properties[property_struct_name] = property_variants - property_name = clean_property_name(property_name) property_struct_names_to_names[property_struct_name] = property_name properties.update(block_properties) diff --git a/codegen/lib/code/shapes.py b/codegen/lib/code/shapes.py index bedab647..b50cdcf1 100755 --- a/codegen/lib/code/shapes.py +++ b/codegen/lib/code/shapes.py @@ -1,6 +1,4 @@ from lib.utils import get_dir_location, to_camel_case -from lib.code.utils import clean_property_name -from .blocks import get_property_struct_name from ..mappings import Mappings COLLISION_BLOCKS_RS_DIR = get_dir_location( diff --git a/codegen/lib/code/utils.py b/codegen/lib/code/utils.py index 71b7d7d8..29adc247 100755 --- a/codegen/lib/code/utils.py +++ b/codegen/lib/code/utils.py @@ -173,16 +173,3 @@ def write_packet_file(state, packet_name_snake_case, code): def fmt(): os.system(f'cd {get_dir_location("..")} && cargo fmt') - - -def clean_property_name(property_name): - # if the name ends with _, remove that part - # ending = property_name.split('_')[-1] - # if ending.isdigit(): - # property_name = property_name[:-(len(ending) + 1)] - - # `type` is a reserved keyword, so we use kind instead ¯\_(ツ)_/¯ - # if property_name == 'type': - # property_name = 'kind' - - return property_name -- cgit v1.2.3