"""
Project Loader

Creates and populates a Project object.
"""

from .project import Project
from .config_loader import load_config

def load_project(
    rom_path,
    device_name
):
    project = Project()
    project.set_rom_path(
        rom_path
    )
    project.set_device(
        device_name
    )
    project.device_vars = load_config(
        f"configs/{device_name.lower()}.conf"
    )
    project.rom_vars = load_config(
        f"configs/rom.conf"
    )
    return project
