CTF writer: Add function to add an integer environment field value
From the Python API, it's only possible to set an environment field
value as a string (whatever you pass, it gets stringified). This patch
adds a function to the CTF writer to allow setting an integer (int64_t)
environment field, and then exposes it in the Python interface.
The Python method Writer.add_environment_field now uses the type of the
passed value to determine which underlying C function to call (string or
integer). Any other type is rejected. This causes a behavior change,
since passing an integer value to add_environment_field used to produce
a string version of the value, whereas it will now produce an integer
version. However, I think it will now behave more closely to the
expectation of a lambda user.
Example:
w.add_environment_field("foo", 2)
Result before:
env {
foo = "2";
};
Result after:
env {
foo = 2;
};
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
This page took 0.027423 seconds and 4 git commands to generate.