Commit Graph

46 Commits

Author SHA1 Message Date
JoeLametta
a4f654a3f3 Fix logger statements having multiple arguments
Some of the instructions have been rendered invalid during the conversion to logger statements...

Also performed various stylistic fixes
2018-12-14 14:21:56 +00:00
JoeLametta
a23b214814 Print empty lines, not parentheses 2018-12-14 14:21:51 +00:00
JoeLametta
c377417108 Replace sys.std{out,err} statements with logger/print calls (#331)
* Change global default log level to 'INFO'

We're going to increase our usage of logger statements instead of print instructions (where deemed opportune).

* Replace sys.std{out,err} statements with logger/print calls

Fixes #303.
2018-12-13 20:21:26 +00:00
JoeLametta
32cd902821 Merge pull request #323 from whipper-team/feature/issue-215-unicode-issues
Fix UnicodeEncodeError with non ASCII MusicBrainz's catalog numbers
2018-12-11 17:50:51 +00:00
JoeLametta
c2af4459ef Preserve ToC file generated by cdrdao
Whipper uses cdrdao during its ripping process. With this commit it will now store cdrdao's generated tocfile in the ripping path.
Preserving the tocfile allows users to easily burn ripped discs having a non-compliant cue sheet.

Fixes #214.
2018-11-19 12:56:58 +01:00
JoeLametta
4f5b684ec7 Fix template validation error
Commit 9c72ebccd3 introduced a bug: all template strings are validated against the disc template RegEx (which, for example, is wrong if we're testing the track template).
2018-11-04 12:17:44 +01:00
JoeLametta
f0fcae872d Write musicbrainz_discid tag when disc is unknown
Fixes #280.
2018-11-02 18:47:52 +01:00
JoeLametta
59d5fdb84a Fix UnicodeEncodeError with non ASCII MusicBrainz's catalog numbers
Fixes #215.
2018-11-02 17:29:12 +01:00
JoeLametta
69bac864ab Raise exception if template has invalid variables
If the template string contains variables which aren't valid for whipper, raise ValueError exception listing all the included unrecognized variables.
I've also corrected the example template configuration lines in the README.

Fixes #279.
2018-11-02 08:05:00 +00:00
JoeLametta
02fd962094 Limit length of filenames (#311)
* Limit length of filenames

If whipper generated filenames are longer thant the maximum value supported by the filesystem, the I/O operations are going to fail.
With this commit filenames which may be too long are truncated to the maximum allowable length.

Fixes #197.
2018-10-22 20:51:14 +02:00
anarcat
021e621f84 Handle FreeDB server errors gracefully (#304)
* handle FreeDB server errors gracefully

In my repeated tests, I ended up upsetting freedb.org, which started
issuing 502 errors. Those errors are not correctly caught by the
program which just crashes with a backtrace. Instead, we handle those
like any other API error, which can already be generated by
perform_lookup (but not handled).

The visible result for the user is that the CD is simply not found on
FreeDB, an acceptable compromise, in my opinion.

Closes: #206

* harmonize an error message with other warnings

... which are all capitalized.
2018-10-06 17:13:27 +00:00
Andreas Oberritter
542e071443 switch CDDB implementation to freedb.py from python-audio-tools (#276)
* freedb: Import from python-audio-tools 660ee2c

License: GPL-2.0+

* freedb: Remove unused code and set client name to whipper.

The removed functions depend on other classes of python-audio-tools,
but aren't needed here.

* cddb-py: replace with newer freedb implementation

The last release of cddb-py was 15 years ago. The freedb code taken
from python-audio-tools speaks protocol version 6 (Unicode) and is
compatible to both Python 2 and 3.

* freedb: Don't allow the pedantic CI test to fail
2018-06-08 14:40:56 +00:00
Joe
241f44eff6 Merge branch 'master' into python3 2018-06-08 14:32:27 +00:00
Joe
a320f6a0a5 Remove whipper's image retag feature (#269)
Fixes #262.
2018-05-24 17:19:14 +02:00
JoeLametta
71df9124a6 Fix dict.keys referenced when not iterating 2018-05-08 18:39:08 +02:00
JoeLametta
2b4140d300 Make Python code more idiomatic 2018-05-08 18:39:08 +02:00
JoeLametta
a484815106 Fix dictionary iteration methods 2018-05-08 18:39:08 +02:00
JoeLametta
7dff041362 Replace filter calls with list comprehensions 2018-05-08 18:39:08 +02:00
JoeLametta
4280dbfafc Convert except X, T to except X as T 2018-05-08 18:39:08 +02:00
JoeLametta
44ece38740 In Python 3 print is a function 2018-05-08 18:39:08 +02:00
Andreas Oberritter
732515723e Remove dead code from program.getFastToc
The caching mechanism didn's have any effect. The inline function
'function' wasn't used anymore.
2018-05-07 20:02:36 +02:00
Samantha Baldwin
09de58852e Revert "Convert docstrings to reStructuredText"
This reverts commit 3b1bd242d0.
2018-03-02 16:47:12 -05:00
Samantha Baldwin
44e160910c remove -T/--toc-pickle 2018-03-01 21:14:15 -05:00
Merlijn Wajer
6bd389b7b1 Fix resuming previous rips
Thanks to Freso for testing.

command/cd: Only call makedirs when dir does not exist
common/checksum: Support flac input files

Fixes #136
2018-01-26 23:16:41 +01:00
JoeLametta
3b1bd242d0 Convert docstrings to reStructuredText
This commit also includes:

  - whitespace / code formatting fixes
  - slight syntax related changes: except <exception_name>, e -> except <exception_name> as e
  - 3 pointless instructions instances have been rewritten [sorted] (spotted by semi-automatic check)

The unrelated changes shouldn't have any real impact on whipper's behaviour.
2018-01-12 11:42:24 +01:00
Joe
fef437f93e Remove redundant error reporting line
Fixes #198.
2017-10-08 22:38:51 +02:00
Samantha Baldwin
d4aad57188 fix minor string handling minibugs 2017-09-15 16:10:22 -04:00
Samantha Baldwin
d6424374a8 program.py: more robust write_m3u() 2017-09-11 18:52:23 -04:00
Samantha Baldwin
94b9a1bbf6 fix image verify:
- accurip.py: raise exception if accuraterip db entry not found
- program.py: verify image with only one table, remove redundant check
2017-09-10 22:35:10 -04:00
Samantha Baldwin
b98cc32fd0 program.py: correct m3u htoa handling 2017-09-10 21:53:08 -04:00
Samantha Baldwin
a482c86832 potentially fix UnicodeEncodeError 2017-09-09 16:04:58 -04:00
Samantha Baldwin
b936aff000 fix htoa getPath bug 2017-09-09 15:31:28 -04:00
Samantha Baldwin
83729ef7f3 deflake, remove morituri hack, more error handling 2017-09-04 21:55:05 -04:00
Samantha Baldwin
bfa0308880 AccurateRip V2 support
- output path no longer has fallbacks
- refactor accuraterip cache
- use requests to download accuraterip entries
- add tests for accuraterip functionality
- remove gobject support from accuraterip-checksum calculation
- default track template now includes extension
- begin to remove support for continuing rip
- begin to use print instead of sys.stdout.write() throughout
2017-09-04 21:26:34 -04:00
Frederik “Freso” S. Olesen
a0c0ce7e47 Fix(/ignore) PEP8/flake8 errors 2017-06-01 02:31:03 +02:00
Frederik “Freso” S. Olesen
5ba3e924fb Refactor Program.getPath disambiguation logic to .addDisambiguation 2017-05-31 23:33:07 +02:00
Frederik “Freso” S. Olesen
2465f03337 Add disambiguation to the end of template strings w/o "%d" 2017-05-31 23:33:07 +02:00
Frederik “Freso” S. Olesen
e5f2afe0db Break out of disambiguation loop once disambig has been added
Instead of iterating over all the path parts and added disambiguation to
each, it now only adds the disambiguation to the first match.
2017-05-31 23:33:06 +02:00
Frederik “Freso” S. Olesen
a14989583e Use regular str.split() to split template parts in disambiguation
os.path.split() only even splits into two components, which means that
path templates that have more than two parts (e.g., `%A/%d - %y/%X`)
will not get split properly for the purpose of added disambiguation
parts to them.

os.path.join() will still work fine to splice the split template back
together as it takes an arbitrary number of arguments.
2017-05-31 23:33:06 +02:00
Frederik “Freso” S. Olesen
3f30f1d46f Always disambiguate in the release title part of the template
Fixes https://github.com/JoeLametta/whipper/issues/127
2017-05-31 23:31:15 +02:00
JoeLametta
b6fb7e8a86 Solve all flake8 warnings (#163)
Whipper is now fully PEP8 compliant.
Revised version which includes all the changes suggested by Freso.
2017-05-31 23:09:36 +02:00
Frederik “Freso” S. Olesen
8ebd329a19 Fix capitalisation of MusicBrainz everywhere
Make MusicBrainz consistently written as "MusicBrainz" and not
"musicbrainz" or "Musicbrainz".
Doesn't change instances that refer to the Python module or similar.
2017-05-19 01:16:45 +02:00
Frederik “Freso” S. Olesen
e75a54ee01 Fix typo in inline comment ("Ingore" → "Ignore") 2017-05-19 01:05:07 +02:00
Frederik “Freso” S. Olesen
a20c25258d Remove "Morituri - for those about to RIP" lines. 2017-04-26 23:08:50 +02:00
Frederik “Freso” S. Olesen
cb0042c832 Update morituri references in inline documentation. 2017-04-26 23:08:50 +02:00
Frederik “Freso” S. Olesen
ff309e468c Rename "morituri" module to "whipper".
Fixes https://github.com/JoeLametta/whipper/issues/100
2017-04-26 23:08:28 +02:00