-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
toolkit: Allow an absolute path for app-device-config.json. #8
Conversation
If it's only used in location, may as well just make it |
Well... then there's no point in having it in the other json file... yes there are too many json config files! |
I agree. How about this: if the "binary" is not in "DEVICE" section, use |
How about remove |
Actually, no, that's not very friendly when you have hard-coded config files. It's only good for generated config files (where you have the luxury to write out the abs path). Then maybe we go with |
Yes, best way I think. Also specifying a relative/filename, in json file, and using the default config dir should still work then. |
I'd also make "binary" optional, this way we don't have to provide any dummy value. |
OK, so the logic is then:
But, that means you can really only use the second option there if you want one of the configs provided by this toolkit. If you want something else you must use the |
It is fine for our use case, if someone else is going to use the tools we could just as easily support both? For example: if args.config_file is not None:
input_device_config = args.config_file
elif "binary" in sec:
input_device_config = sec["binary"]
else:
raise Exception("...")
if not os.path.isabs(input_device_config):
input_device_config = os.path.join(args.config_dir, input_device_config) |
b845c37
to
d38fdf2
Compare
I've allowed the value in the config file to be relative (to toolkit) or absolute. The |
So we can specify one of the json files in the toolkit, right?
Also, should the option be |
Yes, it should work (although I didn't test it yet).
Maybe? Those other ones are for a different cfg json file though. But, yeah, could call it |
They are, but form a user's point of view, they're all just config options, so probably easier to use the same for all (cfg or config). I noticed the binary name too, I guess it's because it gets compiled into a binary eventually 🤷🏼♂️ |
And remove --config-dir, it's no longer needed. Signed-off-by: Damien George <[email protected]>
d38fdf2
to
b15e218
Compare
Updated to use |
I've tested this, with my CPP PR, and it seems to be working fine. I only tested specifying config in json's binary. |
@josuah FYI, we're removing |
Tested all configurations:
They all work. |
This PR does two things:
paths.CONFIG_INPUT_DIR
so it's only used in one location, which allows removing this global config variable altogetherapp-device-config.json
file to be relative (relative to--config-dir
as before), or absolute