-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Check the skill directory and XDG_CONFIG_DIR for settings #2559
Conversation
Hello @PureTryOut! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-05-15 09:51:19 UTC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looked over it a bit and I'm not sure it will work as intended, but I can have misunderstood things
for dir in BaseDirectory.load_config_paths('mycroft'): | ||
path = dir + 'skills' + basename(self.root_dir) | ||
#: If there is a settings file here, use it | ||
if isdir(path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On first start will this path actually exist? shouldn't it be created if the XDG_CONFIG_DIR is to be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might not exist, but that shouldn't be a problem as afaik the skills currently start without settings as well on first start. At least on my system this works fine on first start without any settings anywhere.
When writing the settings we do make sure XDG_CONFIG_DIR exists though.
Voight Kampff Integration Test Succeeded (Results) |
3 similar comments
Voight Kampff Integration Test Succeeded (Results) |
Voight Kampff Integration Test Succeeded (Results) |
Voight Kampff Integration Test Succeeded (Results) |
Voight Kampff Integration Test Succeeded (Results) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to be working exactly as intended.
I've tagged a bunch of minor comments. Could you explain to me how the ~.config/mycroft/skills/SKILL
folder is created because I can't quite figure it out :)
Do we need to differentiate between settings read path and settings write path?
Yes. While you can read from |
Voight Kampff Integration Test Succeeded (Results) |
Voight Kampff Integration Test Succeeded (Results) |
Think you might have rebased on top of master instead of dev, PR is now 10000 commits |
Voight Kampff Integration Test Succeeded (Results) |
Ok why is the master branch still a thing if it's never used and updated? 🙈 Reset the branch and should be fixed now. |
Voight Kampff Integration Test Succeeded (Results) |
It is used, it's the "stable" branch pointing to the latest release basically, but due to some initial script snafu's it has a bunch of extra commits (like 500k), but since it's a branch that's used no-one has wanted to drop it and re-create it. |
How strange. Anyhow, anything more I need to fix or change? |
I think all looks good, gonna do a final test run on the Mark-1 hardware and then it should be merged. |
Voight Kampff Integration Test Succeeded (Results) |
Description
This makes the skills read their settings from either XDG_CONFIG_DIR or
/etc/mycroft
(ifXDG_CONFIG_DIR
is unset), and write to XDG_CONFIG_DIR. This however happens only if/opt/mycroft/skills/<skillname>/settings.json
(the current default location) doesn't already exist, to make sure we don't break existing setups.How to test
mycroft-skills
like before and verify if all skills still load correctlysettings.json
from any skill to either~/.config/mycroft/skills/<skillname>/settings.json
or/etc/mycroft/skills/<skillname>/settings.json
. Forskill-pairing
the skillname would be "PairingSkill" for examplemycroft-skills
again and verify if the affected skill still loads correctly and if it saves it settings to~/.config/mycroft/skills/<skillname>/settings.json
.Contributor license agreement signed?
CLA [x]