-
Notifications
You must be signed in to change notification settings - Fork 91
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
read command parameters from config sections #240
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d264d47
read command parameters from config sections
RecursiveForest bfb3b3a
README: update config file documentation
RecursiveForest 61afafc
README: config example type INI, add comma
RecursiveForest 496cb04
README: clearer and better spelled wording
RecursiveForest d077135
README: fix 'delineated' typo
RecursiveForest File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -157,42 +157,45 @@ The simplest way to get started making accurate rips is: | |
|
||
## Configuration file documentation | ||
|
||
The configuration file is stored according to the [XDG Base Directory Specification]( | ||
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) | ||
when possible. | ||
|
||
It lives in `$XDG_CONFIG_HOME/whipper/whipper.conf` (or `$HOME/.config/whipper/whipper.conf`). | ||
|
||
The configuration file follows python's [ConfigParser](https://docs.python.org/2/library/configparser.html) syntax. | ||
|
||
The possible sections are: | ||
|
||
- Main section: `[main]` | ||
- `path_filter_fat`: whether to filter path components for FAT file systems | ||
- `path_filter_special`: whether to filter path components for special characters | ||
|
||
- MusicBrainz section: `[musicbrainz]` | ||
- `server`: the MusicBrainz server to connect to, in `host:[port]` format. Defaults to `musicbrainz.org`. | ||
|
||
- Drive section: `[drive:IDENTIFIER]`, one for each configured drive. All these values are probed by whipper and should not be edited by hand. | ||
- `defeats_cache`: whether this drive can defeat the audio cache | ||
- `read_offset`: the read offset of the drive | ||
|
||
- Rip command section: `[rip.COMMAND.SUBCOMMAND]`. Can be used to change the command options default values. | ||
**Please note that this feature is currently broken (being this way since [PR #122](https://github.com/JoeLametta/whipper/pull/92) / whipper [v0.4.1](https://github.com/JoeLametta/whipper/releases/tag/v0.4.1)).** | ||
|
||
Example section to configure `whipper cd rip` defaults: | ||
|
||
```Python | ||
[rip.cd.rip] | ||
The configuration file is stored in | ||
`$XDG_CONFIG_HOME/whipper/whipper.conf`, or | ||
`$HOME/.config/whipper/whipper.conf` if `$XDG_CONFIG_HOME` is undefined. | ||
|
||
See [XDG Base Directory | ||
Specification](http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) | ||
and [ConfigParser](https://docs.python.org/2/library/configparser.html). | ||
|
||
The configuration file consists of newline-deliniated `[sections]` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this line has a typo: |
||
containing `key = value` pairs. The sections `[main]` and | ||
`[musicbrainz]` are special config sections for options not accessible | ||
from the command line interface. Sections beginning with `drive` are | ||
written by whipper; certain values should not be edited. | ||
|
||
Example configuration demonstrating all `[main]` and `[musicbrainz]` | ||
options: | ||
|
||
```INI | ||
[main] | ||
path_filter_fat = True ; replace FAT file system unsafe characters in filenames with _ | ||
path_filter_special = False ; replace special characters in filenames with _ | ||
|
||
[musicbrainz] | ||
server = musicbrainz.org:80 ; use musicbrainz server at host[:port] | ||
|
||
[drive:HL-20] | ||
defeats_cache = True ; whether the drive is capable of defeating the audio cache | ||
read_offset = 6 ; drive read offset in positive/negative frames (no leading +) | ||
# do not edit the values 'vendor', 'model', and 'release'; they are used by whipper to match the drive | ||
|
||
# command line defaults for `whipper cd rip` | ||
[whipper.cd.rip] | ||
unknown = True | ||
output_directory = ~/My Music | ||
track_template = new/%%A/%%y - %%d/%%t - %%n | ||
track_template = new/%%A/%%y - %%d/%%t - %%n ; note: the format char '%' must be represented '%%' | ||
disc_template = %(track_template)s | ||
# ... | ||
``` | ||
|
||
Note: to get a literal `%` character it must be doubled. | ||
|
||
## Backward incompatible changes | ||
|
||
- Rely on `cd-paranoia` (`libcdio-cdparanoia`) instead of `cdparanoia` (Xiph): changed dependency ([PR #213](https://github.com/JoeLametta/whipper/pull/213) / whipper [v0.6.0](https://github.com/JoeLametta/whipper/releases/tag/v0.6.0)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I would probably separate the two possibilities a bit stronger. Maybe a comma (
,
) or (en‐)hyphen (–
) before theor
?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.
As in, '"XDG...", or "HOME" if'?
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.
Yeah, exactly.