summaryrefslogtreecommitdiffstats
path: root/scripts/lib/bsp/engine.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/bsp/engine.py')
-rw-r--r--scripts/lib/bsp/engine.py38
1 files changed, 19 insertions, 19 deletions
diff --git a/scripts/lib/bsp/engine.py b/scripts/lib/bsp/engine.py
index 66e2162ea8..3ab4295d24 100644
--- a/scripts/lib/bsp/engine.py
+++ b/scripts/lib/bsp/engine.py
@@ -1263,13 +1263,13 @@ def conditional_filename(filename):
1263 return None 1263 return None
1264 end = filename.find(CLOSE_TAG, opentag_start) 1264 end = filename.find(CLOSE_TAG, opentag_start)
1265 if end == -1: 1265 if end == -1:
1266 print "No close tag found for open tag in filename %s" % filename 1266 print("No close tag found for open tag in filename %s" % filename)
1267 sys.exit(1) 1267 sys.exit(1)
1268 1268
1269 # we have a {{ tag i.e. code 1269 # we have a {{ tag i.e. code
1270 tag = filename[opentag_start + len(OPEN_TAG):end].strip() 1270 tag = filename[opentag_start + len(OPEN_TAG):end].strip()
1271 if not tag.lstrip().startswith(IF_TAG): 1271 if not tag.lstrip().startswith(IF_TAG):
1272 print "Only 'if' tags are allowed in file or directory names, filename: %s" % filename 1272 print("Only 'if' tags are allowed in file or directory names, filename: %s" % filename)
1273 sys.exit(1) 1273 sys.exit(1)
1274 1274
1275 return CodeLine(tag) 1275 return CodeLine(tag)
@@ -1515,7 +1515,7 @@ def expand_targets(context, bsp_output_dir, expand_common=True):
1515 1515
1516 arches = os.listdir(arch_path) 1516 arches = os.listdir(arch_path)
1517 if arch not in arches or arch == "common": 1517 if arch not in arches or arch == "common":
1518 print "Invalid karch, exiting\n" 1518 print("Invalid karch, exiting\n")
1519 sys.exit(1) 1519 sys.exit(1)
1520 1520
1521 target = os.path.join(arch_path, arch) 1521 target = os.path.join(arch_path, arch)
@@ -1541,7 +1541,7 @@ def yocto_common_create(machine, target, scripts_path, layer_output_dir, codedum
1541 expand_common - boolean, use the contents of (for bsp layers) arch/common 1541 expand_common - boolean, use the contents of (for bsp layers) arch/common
1542 """ 1542 """
1543 if os.path.exists(layer_output_dir): 1543 if os.path.exists(layer_output_dir):
1544 print "\nlayer output dir already exists, exiting. (%s)" % layer_output_dir 1544 print("\nlayer output dir already exists, exiting. (%s)" % layer_output_dir)
1545 sys.exit(1) 1545 sys.exit(1)
1546 1546
1547 properties = None 1547 properties = None
@@ -1550,7 +1550,7 @@ def yocto_common_create(machine, target, scripts_path, layer_output_dir, codedum
1550 try: 1550 try:
1551 infile = open(properties_file, "r") 1551 infile = open(properties_file, "r")
1552 except IOError: 1552 except IOError:
1553 print "Couldn't open properties file %s for reading, exiting" % properties_file 1553 print("Couldn't open properties file %s for reading, exiting" % properties_file)
1554 sys.exit(1) 1554 sys.exit(1)
1555 1555
1556 properties = json.load(infile) 1556 properties = json.load(infile)
@@ -1597,8 +1597,8 @@ def yocto_layer_create(layer_name, scripts_path, layer_output_dir, codedump, pro
1597 """ 1597 """
1598 yocto_common_create(layer_name, "layer", scripts_path, layer_output_dir, codedump, properties_file, properties, False) 1598 yocto_common_create(layer_name, "layer", scripts_path, layer_output_dir, codedump, properties_file, properties, False)
1599 1599
1600 print "\nNew layer created in %s.\n" % (layer_output_dir) 1600 print("\nNew layer created in %s.\n" % layer_output_dir)
1601 print "Don't forget to add it to your BBLAYERS (for details see %s/README)." % (layer_output_dir) 1601 print("Don't forget to add it to your BBLAYERS (for details see %s/README)." % layer_output_dir)
1602 1602
1603 1603
1604def yocto_bsp_create(machine, arch, scripts_path, bsp_output_dir, codedump, properties_file, properties=None): 1604def yocto_bsp_create(machine, arch, scripts_path, bsp_output_dir, codedump, properties_file, properties=None):
@@ -1616,7 +1616,7 @@ def yocto_bsp_create(machine, arch, scripts_path, bsp_output_dir, codedump, prop
1616 """ 1616 """
1617 yocto_common_create(machine, arch, scripts_path, bsp_output_dir, codedump, properties_file, properties) 1617 yocto_common_create(machine, arch, scripts_path, bsp_output_dir, codedump, properties_file, properties)
1618 1618
1619 print "\nNew %s BSP created in %s" % (arch, bsp_output_dir) 1619 print("\nNew %s BSP created in %s" % arch, bsp_output_dir)
1620 1620
1621 1621
1622def print_dict(items, indent = 0): 1622def print_dict(items, indent = 0):
@@ -1624,13 +1624,13 @@ def print_dict(items, indent = 0):
1624 Print the values in a possibly nested dictionary. 1624 Print the values in a possibly nested dictionary.
1625 """ 1625 """
1626 for key, val in items.iteritems(): 1626 for key, val in items.iteritems():
1627 print " "*indent + "\"%s\" :" % key, 1627 print(" "*indent + "\"%s\" :" % key)
1628 if type(val) == dict: 1628 if type(val) == dict:
1629 print "{" 1629 print("{")
1630 print_dict(val, indent + 1) 1630 print_dict(val, indent + 1)
1631 print " "*indent + "}" 1631 print(" "*indent + "}")
1632 else: 1632 else:
1633 print "%s" % val 1633 print("%s" % val)
1634 1634
1635 1635
1636def get_properties(input_lines): 1636def get_properties(input_lines):
@@ -1681,7 +1681,7 @@ def yocto_layer_list_properties(arch, scripts_path, properties_file, expand_comm
1681 try: 1681 try:
1682 of = open(properties_file, "w") 1682 of = open(properties_file, "w")
1683 except IOError: 1683 except IOError:
1684 print "Couldn't open properties file %s for writing, exiting" % properties_file 1684 print("Couldn't open properties file %s for writing, exiting" % properties_file)
1685 sys.exit(1) 1685 sys.exit(1)
1686 1686
1687 json.dump(properties, of, indent=1) 1687 json.dump(properties, of, indent=1)
@@ -1755,10 +1755,10 @@ def print_values(type, values_list):
1755 """ 1755 """
1756 if type == "choicelist": 1756 if type == "choicelist":
1757 for value in values_list: 1757 for value in values_list:
1758 print "[\"%s\", \"%s\"]" % (value[0], value[1]) 1758 print("[\"%s\", \"%s\"]" % (value[0], value[1]))
1759 elif type == "boolean": 1759 elif type == "boolean":
1760 for value in values_list: 1760 for value in values_list:
1761 print "[\"%s\", \"%s\"]" % (value[0], value[1]) 1761 print("[\"%s\", \"%s\"]" % (value[0], value[1]))
1762 1762
1763 1763
1764def yocto_layer_list_property_values(arch, property, scripts_path, properties_file, expand_common=True): 1764def yocto_layer_list_property_values(arch, property, scripts_path, properties_file, expand_common=True):
@@ -1789,7 +1789,7 @@ def yocto_layer_list_property_values(arch, property, scripts_path, properties_fi
1789 1789
1790 input_line = find_input_line(property, input_lines) 1790 input_line = find_input_line(property, input_lines)
1791 if not input_line: 1791 if not input_line:
1792 print "Couldn't find values for property %s" % property 1792 print("Couldn't find values for property %s" % property)
1793 return 1793 return
1794 1794
1795 values_list = [] 1795 values_list = []
@@ -1818,7 +1818,7 @@ def yocto_layer_list_property_values(arch, property, scripts_path, properties_fi
1818 try: 1818 try:
1819 of = open(properties_file, "w") 1819 of = open(properties_file, "w")
1820 except IOError: 1820 except IOError:
1821 print "Couldn't open properties file %s for writing, exiting" % properties_file 1821 print("Couldn't open properties file %s for writing, exiting" % properties_file)
1822 sys.exit(1) 1822 sys.exit(1)
1823 1823
1824 json.dump(values_list, of) 1824 json.dump(values_list, of)
@@ -1839,11 +1839,11 @@ def yocto_bsp_list(args, scripts_path, properties_file):
1839 lib_path = scripts_path + '/lib' 1839 lib_path = scripts_path + '/lib'
1840 bsp_path = lib_path + '/bsp' 1840 bsp_path = lib_path + '/bsp'
1841 arch_path = bsp_path + '/substrate/target/arch' 1841 arch_path = bsp_path + '/substrate/target/arch'
1842 print "Architectures available:" 1842 print("Architectures available:")
1843 for arch in os.listdir(arch_path): 1843 for arch in os.listdir(arch_path):
1844 if arch == "common" or arch == "layer": 1844 if arch == "common" or arch == "layer":
1845 continue 1845 continue
1846 print " %s" % arch 1846 print(" %s" % arch)
1847 return True 1847 return True
1848 else: 1848 else:
1849 arch = args[0] 1849 arch = args[0]