mirror of
https://github.com/drasko/codezero.git
synced 2026-01-15 04:13:16 +01:00
Created a way to generate 0 and 1's while retaining Yes and No in CML
CML boolean type compiles into #define and #undefs. This is not useful for capabilities since a value of 0 or 1 can be used automatically for setting or unsetting bits in permission words. Meanwhile using an integer type with 0 - 1 range has a worse usability experience than the boolean Y, N. Also moved parsing of container.template.cml to newer Python argument parsing format.
This commit is contained in:
@@ -39,7 +39,6 @@ def add_container_constraint(cid):
|
||||
return cml_string
|
||||
|
||||
def generate_container_cml(arch, ncont):
|
||||
contid_occurence = 380 # Exact number of arguments
|
||||
fbody = ""
|
||||
with open(join(CML2_CONFIG_SRCDIR, arch + '.cml')) as in_cml:
|
||||
fbody += in_cml.read()
|
||||
@@ -61,7 +60,7 @@ def generate_container_cml(arch, ncont):
|
||||
with open(CML2_CONT_DEFFILE, "rU") as contdefs:
|
||||
defbody = contdefs.read()
|
||||
defbody = defbody.replace("%\n", "%%\n")
|
||||
fbody += defbody % tuple(contid_occurence * [cont])
|
||||
fbody += defbody % { 'cn' : cont }
|
||||
|
||||
# Write the result to output rules file.
|
||||
with open(join(CML2_CONFIG_SRCDIR, "out.cml"), "w+") as out_cml:
|
||||
|
||||
Reference in New Issue
Block a user