Move load_func_body_from_file to utils module

This commit is contained in:
Abdelrahman Said 2025-03-02 12:20:02 +00:00
parent 8029d26c6b
commit cb093cc030
2 changed files with 7 additions and 5 deletions

View File

@ -1,4 +1,5 @@
from pathlib import Path from pathlib import Path
from .utils import load_func_body_from_file
from .datatypes import ( from .datatypes import (
CDataType, CDataType,
CStruct, CStruct,
@ -307,8 +308,3 @@ def test_doubly_linked_list():
header.save(Path(".")) header.save(Path("."))
source.save(Path(".")) source.save(Path("."))
def load_func_body_from_file(filename: Path) -> str:
with open(filename, "r") as infile:
return infile.read()

6
codegen/utils.py Normal file
View File

@ -0,0 +1,6 @@
from pathlib import Path
def load_func_body_from_file(filename: Path) -> str:
with open(filename, "r") as infile:
return infile.read()