Closed graysky2 closed 10 years ago
By default the script looks in the users current working directory for a config file (default name, texturecache.cfg, configurable with @config=
), and if nothing is found it will then look for texturecache.cfg in the script directory.
I don't mind adding the ability to look for ~/.config/texturecache.cfg
as a last resort if nothing is found in the cwd of the user and/or script.
I won't however create it when it doesn't exist. If a user needs it they can create it.
How does that sound?
Where is "the script directory" as you call it?
I will have the package provide the cfg file as /usr/share/texturecache/texturecache.cfg
and show a post install message directing the user to copy it to ~/.config/texturecache.cfg
if they want it.
The "script directory" is wherever texturecache.py is located, so in your case it would be /usr/bin
So the checking order could be (3 to be added): 1) Current users working directory 2) Script directory 3) ~/.config directory
I don't know what config file you are planning on offering, but please limit options in the config file to those needing non-default values, and try not to set options using their (current) default value as this causes me grief if/when I change a default value in future! Essentially the config file should be the smallest subset of options you need to set, and nothing more.
The user can see their current config (and what configuration options are available) by running texturecache.py config
. Most don't need setting at all.
Options 1-3 look good to me.
I am planning to offer your config file texturecache.cfg.defaults
unmodified. I will simply rename it to /usr/share/texturecache/texturecache.cfg
and have a statement print when the user installs the package:
==> The xbmc webserver must be enabled and running on port 8080.
==> Optionally copy /usr/share/texturecache/texturecache.cfg to ~/.config
==> and uncomment options therein for additional flexibility.
How does that sound? I am open to changing the wording per your preferences.
I am supplying this script in package for Arch Linux. My package will install texturecache.py to
/usr/bin/texturecache
Please modify the script to look for thetexturecache.cfg
from a standard location./etc/conf.d/texturecache.cfg
~/.config/texturecache.cfg
and if it does not exist, write it (all commented).