using property file along with config file to be used with mxmlc - mxmlc

I'm trying to run mxmlc in the following manner.
mxmlc -load-config+=mycfg.xml C:\\projects\\src\\main.mxml -output myswf.swf
In the config file, I want to keep some values configurable, for example the paths of the external libraries. Is it possible to include a property file into the config file and use it as {property_name} in the config file?
Or is it possible to pass certain arguments from the command line itself that will override/replace the corresponding values in the config file, like the -D option in the ant command?
Please provide your suggestions.

From the LiveDocs for mxmlc / -load-config:
If you specify a configuration file,
you can override individual options by
setting them on the command line.

Related

TOML how to have key without value

Many Python tools these days are using pyproject.toml as a config file, and mirror the tool's command line arguments with config file keys. Tools may have command line flags that are not passed any arguments:
sometool --some-flag
Now, I am trying to place this --some-flag into a pyproject.toml config file and can't figure out how to have a key without any value.
[tool.sometool]
# Both of the below are invalid
some-flag
some-flag =
In TOML, is it possible to have a key without a value?
This is not possible.
It'd depend on the tool how they are doing this, so please refer to their documentation. I would guess they are treating those flags as a boolean.
[tool.sometool]
some-flag = true

Yocto: add a statement in the default service file within a recipe

I'd need to add a Restart statement within a default .service file, and was looking to an alternate solution to replacing the .service file with a custom one (which works).
The idea would be just adding the following "delta" requirement in a, e.g., ${systemd_system_unitdir}/my_service.d/override.conf file:
[Service]
Restart=always
and then adding that file in a dedicated .bbappend recipe file.
Tests so far were not successful in adding the above statements in the deployed service file (despite the "delta" conf file being correctly deployed). Is this even a possible solution?
You should be able to do that simply by echoing that entry in a do_install:append() section in you .bbappend file. Something like:
do_install:append() {
echo "[Service]\nRestart=always" >> ${D}${sysconfdir}/wpa_supplicant/...
}
You can equally use sed to find and replace that section if there is already a file inplace.
${sysconfdir} will expanded to /etc. Check this file for more defined path variables: https://git.yoctoproject.org/poky/plain/meta/conf/bitbake.conf?h=blinky

Is there a way to configure pytest_plugins from a pytest.ini file?

I may have missed this detail but I'm trying to see if I can control the set of plugins made available through the ini configuration itself.
I did not find that item enumerated in any of the configurable command-line options nor in any of the documentation around the pytest_plugins global.
The goal is to reuse a given test module with different fixture implementations.
#hoefling is absolutely right, there is actually a pytest command line argument that can specify plugins to be used, which along with the addopts ini configuration can be used to select a set of plugin files, one per -p command.
As an example the following ini file selects three separate plugins, the plugins specified later in the list take precedence over those that came earlier.
projX.ini
addopts =
-p projX.plugins.plugin_1
-p projX.plugins.plugin_2
-p projY.plugins.plugin_1
We can then invoke this combination on a test module with a command like
python -m pytest projX -c projX.ini
A full experiment is detailed here in this repository
https://github.com/jxramos/pytest_behavior/tree/main/ini_plugin_selection

Is there a way to specify the output path of .coverage?

I'm looking for a way to specify the output path of the generated .coverage file. I've checked coverage help and did some research but still no luck so far. The reason is that I would like it to be specified into our tmp directory.
You can create a .coveragerc and specify the path for .coverage using the data_file attribute under the [run] section.
This is the link to the current documentation.
You can use the [run] data_file setting (https://coverage.readthedocs.io/en/latest/config.html#run), or the COVERAGE_FILE environment variable (https://coverage.readthedocs.io/en/latest/cmd.html#data-file).

diffstrings.py : how do you specify path arguments?

I am trying to use diffstrings.py from Three20 on my iPhone project, and I can't find the proper format for the path arguments (as in "Usage: diffstrings.py [options] path1 path2 ...").
For example, when I run the script in my Xcode project directory like this
~/py/diffstrings.py -b
it analyzes just the main.m and finds 0 strings to localize,
then it diffs against existing fr.lproj and others, and finds that thes contain "obsolete strings".
Can anyone post examples of successful comand line invocations of diffstrings.py, for options -b, -d and -m?
Taking a quick look at the code here http://github.com/facebook/three20/blob/master/diffstrings.py I see that if you don't specify any command line options, it assumes you mean the directory wherever the script lives in. So the option is to either copy .py file to where your .m files are, or simple use the command
~py/diffstrings.py -b .
That is, give the current directory (.) as the path argument.