source.compile.compiler()   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 7
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 7
nop 3
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
import struct
2
3
from source.io_library import output_writer
4
5
6
def compiler(object_dict: dict, output_path: str, mode: str):
7
    header_list = list(object_dict.keys())
8
    header_list.sort()
9
    for memory_location in header_list:
10
        integer = int(object_dict[memory_location], 16)
11
        object_dict[memory_location] = struct.pack('>i', integer)
12
    output_writer(output_path, header_list, object_dict, mode)
13