Loading services/audiopolicy/engineconfigurable/tools/Android.bp +2 −2 Original line number Diff line number Diff line Loading @@ -16,10 +16,10 @@ python_defaults { name: "tools_default", version: { py2: { enabled: true, enabled: false, }, py3: { enabled: false, enabled: true, }, }, } Loading services/audiopolicy/engineconfigurable/tools/buildPolicyCriterionTypes.py +39 −39 Original line number Diff line number Diff line #!/usr/bin/python #!/usr/bin/python3 # # Copyright 2018, The Android Open Source Project Loading @@ -19,10 +19,8 @@ import argparse import re import sys import tempfile import os import logging import subprocess import xml.etree.ElementTree as ET import xml.etree.ElementInclude as EI import xml.dom.minidom as MINIDOM Loading Loading @@ -50,7 +48,8 @@ from collections import OrderedDict def parseArgs(): argparser = argparse.ArgumentParser(description="Parameter-Framework XML \ audio criterion type file generator.\n\ Exit with the number of (recoverable or not) error that occured.") Exit with the number of (recoverable or not) \ error that occured.") argparser.add_argument('--androidaudiobaseheader', help="Android Audio Base C header file, Mandatory.", metavar="ANDROID_AUDIO_BASE_HEADER", Loading @@ -64,7 +63,8 @@ def parseArgs(): argparser.add_argument('--criteriontypes', help="Criterion types XML base file, in \ '<criterion_types> \ <criterion_type name="" type=<inclusive|exclusive> values=<value1,value2,...>/>' \ <criterion_type name="" type=<inclusive|exclusive> \ values=<value1,value2,...>/>' \ format. Mandatory.", metavar="CRITERION_TYPE_FILE", type=argparse.FileType('r'), Loading Loading @@ -120,7 +120,7 @@ def generateXmlCriterionTypesFile(criterionTypes, addressCriteria, criterionType reparsed = MINIDOM.parseString(xmlstr) prettyXmlStr = reparsed.toprettyxml(newl='\r\n') prettyXmlStr = os.linesep.join([s for s in prettyXmlStr.splitlines() if s.strip()]) outputFile.write(prettyXmlStr.encode('utf-8')) outputFile.write(prettyXmlStr) def capitalizeLine(line): return ' '.join((w.capitalize() for w in line.split(' '))) Loading @@ -143,20 +143,20 @@ def parseAndroidAudioPolicyConfigurationFile(audiopolicyconfigurationfile): 'OutputDevicesAddressesType' : [], 'InputDevicesAddressesType' : []} oldWorkingDir = os.getcwd() print "Current working directory %s" % oldWorkingDir old_working_dir = os.getcwd() print("Current working directory %s" % old_working_dir) newDir = os.path.join(oldWorkingDir , audiopolicyconfigurationfile.name) new_dir = os.path.join(old_working_dir, audiopolicyconfigurationfile.name) policy_in_tree = ET.parse(audiopolicyconfigurationfile) os.chdir(os.path.dirname(os.path.normpath(newDir))) os.chdir(os.path.dirname(os.path.normpath(new_dir))) print "new working directory %s" % os.getcwd() print("new working directory %s" % os.getcwd()) policy_root = policy_in_tree.getroot() EI.include(policy_root) os.chdir(oldWorkingDir) os.chdir(old_working_dir) for device in policy_root.iter('devicePort'): for key in address_criteria_mapping_table.keys(): Loading Loading @@ -196,7 +196,7 @@ def parseAndroidAudioFile(androidaudiobaseheaderFile): ignored_values = ['CNT', 'MAX', 'ALL', 'NONE'] criteria_pattern = re.compile( r"\s*(?P<type>(?:"+'|'.join(criterion_mapping_table.keys()) + "))\_" \ r"\s*(?P<type>(?:"+'|'.join(criterion_mapping_table.keys()) + "))_" \ r"(?P<literal>(?!" + '|'.join(ignored_values) + ")\w*)\s*=\s*" \ r"(?P<values>(?:0[xX])?[0-9a-fA-F]+)") Loading @@ -221,7 +221,7 @@ def parseAndroidAudioFile(androidaudiobaseheaderFile): logging.info("criterion {} duplicated values:".format(criterion_name)) logging.info("{}:{}".format(numerical_value, literal)) logging.info("KEEPING LATEST") for key in all_criteria[criterion_name].keys(): for key in list(all_criteria[criterion_name]): if all_criteria[criterion_name][key] == int(numerical_value, 0): del all_criteria[criterion_name][key] Loading services/audiopolicy/engineconfigurable/tools/buildStrategiesStructureFile.py +34 −33 Original line number Diff line number Diff line #!/usr/bin/python #!/usr/bin/python3 # # Copyright 2019, The Android Open Source Project Loading @@ -17,16 +17,12 @@ # import argparse import re import sys import tempfile import os import logging import subprocess import xml.etree.ElementTree as ET import xml.etree.ElementInclude as EI import xml.dom.minidom as MINIDOM from collections import OrderedDict # # Helper script that helps to feed at build time the XML Product Strategies Structure file file used Loading @@ -47,7 +43,8 @@ from collections import OrderedDict def parseArgs(): argparser = argparse.ArgumentParser(description="Parameter-Framework XML \ product strategies structure file generator.\n\ Exit with the number of (recoverable or not) error that occured.") Exit with the number of (recoverable or not) \ error that occured.") argparser.add_argument('--audiopolicyengineconfigurationfile', help="Android Audio Policy Engine Configuration file, Mandatory.", metavar="(AUDIO_POLICY_ENGINE_CONFIGURATION_FILE)", Loading @@ -69,10 +66,10 @@ def parseArgs(): return argparser.parse_args() def generateXmlStructureFile(strategies, strategyStructureInFile, outputFile): def generateXmlStructureFile(strategies, strategy_structure_in_file, output_file): logging.info("Importing strategyStructureInFile {}".format(strategyStructureInFile)) strategies_in_tree = ET.parse(strategyStructureInFile) logging.info("Importing strategy_structure_in_file {}".format(strategy_structure_in_file)) strategies_in_tree = ET.parse(strategy_structure_in_file) strategies_root = strategies_in_tree.getroot() strategy_components = strategies_root.find('ComponentType') Loading @@ -80,13 +77,15 @@ def generateXmlStructureFile(strategies, strategyStructureInFile, outputFile): for strategy_name in strategies: context_mapping = "".join(map(str, ["Name:", strategy_name])) strategy_pfw_name = strategy_name.replace('STRATEGY_', '').lower() strategy_component_node = ET.SubElement(strategy_components, "Component", Name=strategy_pfw_name, Type="ProductStrategy", Mapping=context_mapping) ET.SubElement(strategy_components, "Component", Name=strategy_pfw_name, Type="ProductStrategy", Mapping=context_mapping) xmlstr = ET.tostring(strategies_root, encoding='utf8', method='xml') reparsed = MINIDOM.parseString(xmlstr) prettyXmlStr = reparsed.toprettyxml(newl='\r\n') prettyXmlStr = os.linesep.join([s for s in prettyXmlStr.splitlines() if s.strip()]) outputFile.write(prettyXmlStr.encode('utf-8')) output_file.write(prettyXmlStr) def capitalizeLine(line): return ' '.join((w.capitalize() for w in line.split(' '))) Loading @@ -97,26 +96,27 @@ def capitalizeLine(line): # def parseAndroidAudioPolicyEngineConfigurationFile(audiopolicyengineconfigurationfile): logging.info("Checking Audio Policy Engine Configuration file {}".format(audiopolicyengineconfigurationfile)) logging.info("Checking Audio Policy Engine Configuration file {}".format( audiopolicyengineconfigurationfile)) # # extract all product strategies name from audio policy engine configuration file # strategy_names = [] oldWorkingDir = os.getcwd() print "Current working directory %s" % oldWorkingDir old_working_dir = os.getcwd() print("Current working directory %s" % old_working_dir) newDir = os.path.join(oldWorkingDir , audiopolicyengineconfigurationfile.name) new_dir = os.path.join(old_working_dir, audiopolicyengineconfigurationfile.name) policy_engine_in_tree = ET.parse(audiopolicyengineconfigurationfile) os.chdir(os.path.dirname(os.path.normpath(newDir))) os.chdir(os.path.dirname(os.path.normpath(new_dir))) print "new working directory %s" % os.getcwd() print("new working directory %s" % os.getcwd()) policy_engine_root = policy_engine_in_tree.getroot() EI.include(policy_engine_root) os.chdir(oldWorkingDir) os.chdir(old_working_dir) for strategy in policy_engine_root.iter('ProductStrategy'): strategy_names.append(strategy.get('name')) Loading @@ -128,7 +128,8 @@ def main(): logging.root.setLevel(logging.INFO) args = parseArgs() strategies = parseAndroidAudioPolicyEngineConfigurationFile(args.audiopolicyengineconfigurationfile) strategies = parseAndroidAudioPolicyEngineConfigurationFile( args.audiopolicyengineconfigurationfile) product_strategies_structure = args.productstrategiesstructurefile Loading services/audiopolicy/engineconfigurable/tools/domainGeneratorPolicy.py +93 −94 Original line number Diff line number Diff line #!/usr/bin/python #!/usr/bin/python3 # # Copyright 2018, The Android Open Source Project Loading @@ -16,12 +16,7 @@ # limitations under the License. # import EddParser from PFWScriptGenerator import PfwScriptTranslator import hostConfig import argparse import re import sys import tempfile import os Loading @@ -29,6 +24,10 @@ import logging import subprocess import xml.etree.ElementTree as ET import EddParser from PFWScriptGenerator import PfwScriptTranslator import hostConfig # # In order to build the XML Settings file at build time, an instance of the parameter-framework # shall be started and fed with all the criterion types/criteria that will be used by Loading @@ -40,7 +39,8 @@ import xml.etree.ElementTree as ET def parseArgs(): argparser = argparse.ArgumentParser(description="Parameter-Framework XML \ Settings file generator.\n\ Exit with the number of (recoverable or not) error that occured.") Exit with the number of (recoverable or not) \ error that occured.") argparser.add_argument('--domain-generator-tool', help="ParameterFramework domain generator tool. Mandatory.", metavar="PFW_DOMAIN_GENERATOR_TOOL", Loading @@ -61,7 +61,8 @@ def parseArgs(): argparser.add_argument('--criteriontypes', help="Criterion types XML file, in \ '<criterion_types> \ <criterion_type name="" type=<inclusive|exclusive> values=<value1,value2,...>/> \ <criterion_type name="" type=<inclusive|exclusive> \ values=<value1,value2,...>/> \ </criterion_types>' \ format. Mandatory.", metavar="CRITERION_TYPE_FILE", Loading Loading @@ -116,7 +117,6 @@ def parseCriteriaAndCriterionTypes(criteriaFile, criterionTypesFile): logging.info("Importing criterionTypesFile {}".format(criterionTypesFile)) criteria_root = criteria_tree.getroot() criterion_types_root = criterion_types_tree.getroot() all_criteria = [] for criterion in criteria_root.findall('criterion'): Loading Loading @@ -169,7 +169,7 @@ def parseEdd(EDDFiles): try: root.propagate() except EddParser.MyPropagationError, ex : except EddParser.MyPropagationError as ex: logging.critical(str(ex)) logging.info("EXIT ON FAILURE") exit(1) Loading @@ -183,9 +183,9 @@ def parseEdd(EDDFiles): # It takes as input the collection of criteria, the domains and the simplified settings read from # pfw. # def generateDomainCommands(logging, all_criteria, initial_settings, xml_domain_files, parsed_edds): def generateDomainCommands(logger, all_criteria, initial_settings, xml_domain_files, parsed_edds): # create and inject all the criteria logging.info("Creating all criteria") logger.info("Creating all criteria") for criterion in all_criteria: yield ["createSelectionCriterion", criterion['inclusive'], criterion['name']] + criterion['values'] Loading @@ -194,17 +194,17 @@ def generateDomainCommands(logging, all_criteria, initial_settings, xml_domain_f # Import initial settings file if initial_settings: logging.info("Importing initial settings file {}".format(initial_settings)) logger.info("Importing initial settings file {}".format(initial_settings)) yield ["importDomainsWithSettingsXML", initial_settings] # Import each standalone domain files for domain_file in xml_domain_files: logging.info("Importing single domain file {}".format(domain_file)) logger.info("Importing single domain file {}".format(domain_file)) yield ["importDomainWithSettingsXML", domain_file] # Generate the script for each EDD file for filename, parsed_edd in parsed_edds: logging.info("Translating and injecting EDD file {}".format(filename)) logger.info("Translating and injecting EDD file {}".format(filename)) translator = PfwScriptTranslator() parsed_edd.translate(translator) for command in translator.getScript(): Loading Loading @@ -236,8 +236,7 @@ def main(): prefix="TMPdomainGeneratorPFConfig_") install_path = os.path.dirname(os.path.realpath(args.toplevel_config)) hostConfig.configure( infile=args.toplevel_config, hostConfig.configure(infile=args.toplevel_config, outfile=fake_toplevel_config, structPath=install_path) fake_toplevel_config.close() Loading @@ -258,8 +257,8 @@ def main(): for command in generateDomainCommands(logging, all_criteria, initial_settings, args.xml_domain_files, parsed_edds): connector.stdin.write('\0'.join(command)) connector.stdin.write("\n") connector.stdin.write('\0'.join(command).encode('utf-8')) connector.stdin.write("\n".encode('utf-8')) # Closing the connector's input triggers the domain generation connector.stdin.close() Loading Loading
services/audiopolicy/engineconfigurable/tools/Android.bp +2 −2 Original line number Diff line number Diff line Loading @@ -16,10 +16,10 @@ python_defaults { name: "tools_default", version: { py2: { enabled: true, enabled: false, }, py3: { enabled: false, enabled: true, }, }, } Loading
services/audiopolicy/engineconfigurable/tools/buildPolicyCriterionTypes.py +39 −39 Original line number Diff line number Diff line #!/usr/bin/python #!/usr/bin/python3 # # Copyright 2018, The Android Open Source Project Loading @@ -19,10 +19,8 @@ import argparse import re import sys import tempfile import os import logging import subprocess import xml.etree.ElementTree as ET import xml.etree.ElementInclude as EI import xml.dom.minidom as MINIDOM Loading Loading @@ -50,7 +48,8 @@ from collections import OrderedDict def parseArgs(): argparser = argparse.ArgumentParser(description="Parameter-Framework XML \ audio criterion type file generator.\n\ Exit with the number of (recoverable or not) error that occured.") Exit with the number of (recoverable or not) \ error that occured.") argparser.add_argument('--androidaudiobaseheader', help="Android Audio Base C header file, Mandatory.", metavar="ANDROID_AUDIO_BASE_HEADER", Loading @@ -64,7 +63,8 @@ def parseArgs(): argparser.add_argument('--criteriontypes', help="Criterion types XML base file, in \ '<criterion_types> \ <criterion_type name="" type=<inclusive|exclusive> values=<value1,value2,...>/>' \ <criterion_type name="" type=<inclusive|exclusive> \ values=<value1,value2,...>/>' \ format. Mandatory.", metavar="CRITERION_TYPE_FILE", type=argparse.FileType('r'), Loading Loading @@ -120,7 +120,7 @@ def generateXmlCriterionTypesFile(criterionTypes, addressCriteria, criterionType reparsed = MINIDOM.parseString(xmlstr) prettyXmlStr = reparsed.toprettyxml(newl='\r\n') prettyXmlStr = os.linesep.join([s for s in prettyXmlStr.splitlines() if s.strip()]) outputFile.write(prettyXmlStr.encode('utf-8')) outputFile.write(prettyXmlStr) def capitalizeLine(line): return ' '.join((w.capitalize() for w in line.split(' '))) Loading @@ -143,20 +143,20 @@ def parseAndroidAudioPolicyConfigurationFile(audiopolicyconfigurationfile): 'OutputDevicesAddressesType' : [], 'InputDevicesAddressesType' : []} oldWorkingDir = os.getcwd() print "Current working directory %s" % oldWorkingDir old_working_dir = os.getcwd() print("Current working directory %s" % old_working_dir) newDir = os.path.join(oldWorkingDir , audiopolicyconfigurationfile.name) new_dir = os.path.join(old_working_dir, audiopolicyconfigurationfile.name) policy_in_tree = ET.parse(audiopolicyconfigurationfile) os.chdir(os.path.dirname(os.path.normpath(newDir))) os.chdir(os.path.dirname(os.path.normpath(new_dir))) print "new working directory %s" % os.getcwd() print("new working directory %s" % os.getcwd()) policy_root = policy_in_tree.getroot() EI.include(policy_root) os.chdir(oldWorkingDir) os.chdir(old_working_dir) for device in policy_root.iter('devicePort'): for key in address_criteria_mapping_table.keys(): Loading Loading @@ -196,7 +196,7 @@ def parseAndroidAudioFile(androidaudiobaseheaderFile): ignored_values = ['CNT', 'MAX', 'ALL', 'NONE'] criteria_pattern = re.compile( r"\s*(?P<type>(?:"+'|'.join(criterion_mapping_table.keys()) + "))\_" \ r"\s*(?P<type>(?:"+'|'.join(criterion_mapping_table.keys()) + "))_" \ r"(?P<literal>(?!" + '|'.join(ignored_values) + ")\w*)\s*=\s*" \ r"(?P<values>(?:0[xX])?[0-9a-fA-F]+)") Loading @@ -221,7 +221,7 @@ def parseAndroidAudioFile(androidaudiobaseheaderFile): logging.info("criterion {} duplicated values:".format(criterion_name)) logging.info("{}:{}".format(numerical_value, literal)) logging.info("KEEPING LATEST") for key in all_criteria[criterion_name].keys(): for key in list(all_criteria[criterion_name]): if all_criteria[criterion_name][key] == int(numerical_value, 0): del all_criteria[criterion_name][key] Loading
services/audiopolicy/engineconfigurable/tools/buildStrategiesStructureFile.py +34 −33 Original line number Diff line number Diff line #!/usr/bin/python #!/usr/bin/python3 # # Copyright 2019, The Android Open Source Project Loading @@ -17,16 +17,12 @@ # import argparse import re import sys import tempfile import os import logging import subprocess import xml.etree.ElementTree as ET import xml.etree.ElementInclude as EI import xml.dom.minidom as MINIDOM from collections import OrderedDict # # Helper script that helps to feed at build time the XML Product Strategies Structure file file used Loading @@ -47,7 +43,8 @@ from collections import OrderedDict def parseArgs(): argparser = argparse.ArgumentParser(description="Parameter-Framework XML \ product strategies structure file generator.\n\ Exit with the number of (recoverable or not) error that occured.") Exit with the number of (recoverable or not) \ error that occured.") argparser.add_argument('--audiopolicyengineconfigurationfile', help="Android Audio Policy Engine Configuration file, Mandatory.", metavar="(AUDIO_POLICY_ENGINE_CONFIGURATION_FILE)", Loading @@ -69,10 +66,10 @@ def parseArgs(): return argparser.parse_args() def generateXmlStructureFile(strategies, strategyStructureInFile, outputFile): def generateXmlStructureFile(strategies, strategy_structure_in_file, output_file): logging.info("Importing strategyStructureInFile {}".format(strategyStructureInFile)) strategies_in_tree = ET.parse(strategyStructureInFile) logging.info("Importing strategy_structure_in_file {}".format(strategy_structure_in_file)) strategies_in_tree = ET.parse(strategy_structure_in_file) strategies_root = strategies_in_tree.getroot() strategy_components = strategies_root.find('ComponentType') Loading @@ -80,13 +77,15 @@ def generateXmlStructureFile(strategies, strategyStructureInFile, outputFile): for strategy_name in strategies: context_mapping = "".join(map(str, ["Name:", strategy_name])) strategy_pfw_name = strategy_name.replace('STRATEGY_', '').lower() strategy_component_node = ET.SubElement(strategy_components, "Component", Name=strategy_pfw_name, Type="ProductStrategy", Mapping=context_mapping) ET.SubElement(strategy_components, "Component", Name=strategy_pfw_name, Type="ProductStrategy", Mapping=context_mapping) xmlstr = ET.tostring(strategies_root, encoding='utf8', method='xml') reparsed = MINIDOM.parseString(xmlstr) prettyXmlStr = reparsed.toprettyxml(newl='\r\n') prettyXmlStr = os.linesep.join([s for s in prettyXmlStr.splitlines() if s.strip()]) outputFile.write(prettyXmlStr.encode('utf-8')) output_file.write(prettyXmlStr) def capitalizeLine(line): return ' '.join((w.capitalize() for w in line.split(' '))) Loading @@ -97,26 +96,27 @@ def capitalizeLine(line): # def parseAndroidAudioPolicyEngineConfigurationFile(audiopolicyengineconfigurationfile): logging.info("Checking Audio Policy Engine Configuration file {}".format(audiopolicyengineconfigurationfile)) logging.info("Checking Audio Policy Engine Configuration file {}".format( audiopolicyengineconfigurationfile)) # # extract all product strategies name from audio policy engine configuration file # strategy_names = [] oldWorkingDir = os.getcwd() print "Current working directory %s" % oldWorkingDir old_working_dir = os.getcwd() print("Current working directory %s" % old_working_dir) newDir = os.path.join(oldWorkingDir , audiopolicyengineconfigurationfile.name) new_dir = os.path.join(old_working_dir, audiopolicyengineconfigurationfile.name) policy_engine_in_tree = ET.parse(audiopolicyengineconfigurationfile) os.chdir(os.path.dirname(os.path.normpath(newDir))) os.chdir(os.path.dirname(os.path.normpath(new_dir))) print "new working directory %s" % os.getcwd() print("new working directory %s" % os.getcwd()) policy_engine_root = policy_engine_in_tree.getroot() EI.include(policy_engine_root) os.chdir(oldWorkingDir) os.chdir(old_working_dir) for strategy in policy_engine_root.iter('ProductStrategy'): strategy_names.append(strategy.get('name')) Loading @@ -128,7 +128,8 @@ def main(): logging.root.setLevel(logging.INFO) args = parseArgs() strategies = parseAndroidAudioPolicyEngineConfigurationFile(args.audiopolicyengineconfigurationfile) strategies = parseAndroidAudioPolicyEngineConfigurationFile( args.audiopolicyengineconfigurationfile) product_strategies_structure = args.productstrategiesstructurefile Loading
services/audiopolicy/engineconfigurable/tools/domainGeneratorPolicy.py +93 −94 Original line number Diff line number Diff line #!/usr/bin/python #!/usr/bin/python3 # # Copyright 2018, The Android Open Source Project Loading @@ -16,12 +16,7 @@ # limitations under the License. # import EddParser from PFWScriptGenerator import PfwScriptTranslator import hostConfig import argparse import re import sys import tempfile import os Loading @@ -29,6 +24,10 @@ import logging import subprocess import xml.etree.ElementTree as ET import EddParser from PFWScriptGenerator import PfwScriptTranslator import hostConfig # # In order to build the XML Settings file at build time, an instance of the parameter-framework # shall be started and fed with all the criterion types/criteria that will be used by Loading @@ -40,7 +39,8 @@ import xml.etree.ElementTree as ET def parseArgs(): argparser = argparse.ArgumentParser(description="Parameter-Framework XML \ Settings file generator.\n\ Exit with the number of (recoverable or not) error that occured.") Exit with the number of (recoverable or not) \ error that occured.") argparser.add_argument('--domain-generator-tool', help="ParameterFramework domain generator tool. Mandatory.", metavar="PFW_DOMAIN_GENERATOR_TOOL", Loading @@ -61,7 +61,8 @@ def parseArgs(): argparser.add_argument('--criteriontypes', help="Criterion types XML file, in \ '<criterion_types> \ <criterion_type name="" type=<inclusive|exclusive> values=<value1,value2,...>/> \ <criterion_type name="" type=<inclusive|exclusive> \ values=<value1,value2,...>/> \ </criterion_types>' \ format. Mandatory.", metavar="CRITERION_TYPE_FILE", Loading Loading @@ -116,7 +117,6 @@ def parseCriteriaAndCriterionTypes(criteriaFile, criterionTypesFile): logging.info("Importing criterionTypesFile {}".format(criterionTypesFile)) criteria_root = criteria_tree.getroot() criterion_types_root = criterion_types_tree.getroot() all_criteria = [] for criterion in criteria_root.findall('criterion'): Loading Loading @@ -169,7 +169,7 @@ def parseEdd(EDDFiles): try: root.propagate() except EddParser.MyPropagationError, ex : except EddParser.MyPropagationError as ex: logging.critical(str(ex)) logging.info("EXIT ON FAILURE") exit(1) Loading @@ -183,9 +183,9 @@ def parseEdd(EDDFiles): # It takes as input the collection of criteria, the domains and the simplified settings read from # pfw. # def generateDomainCommands(logging, all_criteria, initial_settings, xml_domain_files, parsed_edds): def generateDomainCommands(logger, all_criteria, initial_settings, xml_domain_files, parsed_edds): # create and inject all the criteria logging.info("Creating all criteria") logger.info("Creating all criteria") for criterion in all_criteria: yield ["createSelectionCriterion", criterion['inclusive'], criterion['name']] + criterion['values'] Loading @@ -194,17 +194,17 @@ def generateDomainCommands(logging, all_criteria, initial_settings, xml_domain_f # Import initial settings file if initial_settings: logging.info("Importing initial settings file {}".format(initial_settings)) logger.info("Importing initial settings file {}".format(initial_settings)) yield ["importDomainsWithSettingsXML", initial_settings] # Import each standalone domain files for domain_file in xml_domain_files: logging.info("Importing single domain file {}".format(domain_file)) logger.info("Importing single domain file {}".format(domain_file)) yield ["importDomainWithSettingsXML", domain_file] # Generate the script for each EDD file for filename, parsed_edd in parsed_edds: logging.info("Translating and injecting EDD file {}".format(filename)) logger.info("Translating and injecting EDD file {}".format(filename)) translator = PfwScriptTranslator() parsed_edd.translate(translator) for command in translator.getScript(): Loading Loading @@ -236,8 +236,7 @@ def main(): prefix="TMPdomainGeneratorPFConfig_") install_path = os.path.dirname(os.path.realpath(args.toplevel_config)) hostConfig.configure( infile=args.toplevel_config, hostConfig.configure(infile=args.toplevel_config, outfile=fake_toplevel_config, structPath=install_path) fake_toplevel_config.close() Loading @@ -258,8 +257,8 @@ def main(): for command in generateDomainCommands(logging, all_criteria, initial_settings, args.xml_domain_files, parsed_edds): connector.stdin.write('\0'.join(command)) connector.stdin.write("\n") connector.stdin.write('\0'.join(command).encode('utf-8')) connector.stdin.write("\n".encode('utf-8')) # Closing the connector's input triggers the domain generation connector.stdin.close() Loading