Allow using one XSD based target description for many targets. Target description XSD can now use %(target_name)s to refer to target name.
authorEdouard Tisserant
Tue, 19 Feb 2019 11:27:29 +0100
changeset 2490 2d72d8a8d7e5
parent 2489 27e4fd37fea6
child 2491 362039519454
Allow using one XSD based target description for many targets. Target description XSD can now use %(target_name)s to refer to target name.
targets/__init__.py
--- a/targets/__init__.py	Thu Feb 14 10:06:43 2019 +0100
+++ b/targets/__init__.py	Tue Feb 19 11:27:29 2019 +0100
@@ -74,9 +74,10 @@
             DictXSD_toolchain["toolchain_"+toolchainname] = open(xsdfilename).read()
 
     # Get all xsd targets
-    for _targetname, nfo in targets.iteritems():
+    for target_name, nfo in targets.iteritems():
         xsd_string = open(nfo["xsd"]).read()
-        targetchoices += xsd_string % DictXSD_toolchain
+        targetchoices += xsd_string % dict(DictXSD_toolchain,
+                                           target_name=target_name)
 
     return targetchoices