from Utility import *
import sys

def GetConfigContent():
    print("RootDir" + str(RootDir()))
    Config = ReadJson(jsonString=None, filename=str(RootDir()) + "\\RetailCamUpdateArchiveToolConfig.json");
    return Config

def GetCurrentModule(ReceivedModuleId, BuildEnv):
    Config = GetConfigContent()
    CurrentModule = {}
    Configuration = []
    if(BuildEnv == 1):
        Configuration = Config["StagingConfiguration"]
    elif(BuildEnv == 2):
        Configuration = Config["ProductionConfiguration"]
    
    for i in Configuration:
        if i["ModuleId"] == ReceivedModuleId:
            CurrentModule = i
        # print(i);
    # print(CurrentModule);
    return CurrentModule