Commit Graph

1445 Commits

Author SHA1 Message Date
JoeLametta
50c8cbb237 Update README, .travis.yml and Dockerfile for Python 3
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-11-26 18:48:01 +00:00
JoeLametta
42019ce85f Port (misc) offsets script to Python 3
I've also changed the output format a bit.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-11-26 18:48:01 +00:00
JoeLametta
bb4c25df97 Address ResourceWarning warnings
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-11-26 18:48:01 +00:00
JoeLametta
fff3014e15 Address test failures
More details about the fix to the testDuration failure (regression):

```
FAIL: testDuration (whipper.test.test_image_toc.CapitalMergeTestCase)
testDuration
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/twisted/internet/defer.py", line 151, in maybeDeferred
    result = f(*args, **kw)
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/twisted/internet/utils.py", line 221, in runWithWarningsSuppressed
    reraise(exc_info[1], exc_info[2])
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/twisted/python/compat.py", line 464, in reraise
    raise exception.with_traceback(traceback)
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/twisted/internet/utils.py", line 217, in runWithWarningsSuppressed
    result = f(*a, **kw)
  File "/home/travis/build/whipper-team/whipper/whipper/test/test_image_toc.py", line 271, in testDuration
    self.assertEqual(self.table.getFrameLength(), 173530)
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/twisted/trial/_synctest.py", line 432, in assertEqual
    super(_Assertions, self).assertEqual(first, second, msg)
  File "/opt/python/3.5.6/lib/python3.5/unittest/case.py", line 829, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/opt/python/3.5.6/lib/python3.5/unittest/case.py", line 822, in _baseAssertEqual
    raise self.failureException(msg)
twisted.trial.unittest.FailTest: 184930 != 173530
```

The test fails because if either nextTrack.session or thisTrack.session are None the if is false and the instructions inside it aren't executed. The check for None is needed because Python 3 doesn't allow NoneType comparisons (in Python 2 that was possible).
IIRC correctly in that test nextTrack.session has value 2 while thisTrack.session is None. That means the Python 2 version evaluates the if condition to true, while the Python 3 version in the first commit does not.
With this change both of the values of nextTrack.session and thisTrack.session are compared as int (if None, the value 1 is used for the comparison - as in disc session 1).

Regression introduced in 64dd9d843a.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-11-26 18:47:54 +00:00
JoeLametta
35201d5290 Address errors, improvements, formatting
- Removed unused code not portable due to buffer() use
- raw_input() does not exist in Python 3
- Fixed octal constant syntax for Python 3
- Fixed TypeError
- Replace if not exists: makedirs(path) with single call: using makedirs(path, exist_ok=True)
- Class inherits from object, can be safely removed from bases in python3: pylint's useless-object-inheritance (W0235) check

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-11-26 18:46:12 +00:00
Andreas Oberritter
8446c290e7 accuraterip-checksum.c: Port to Python 3
Accuraterip-checksum extension will be Python 3 only (JoeLametta).

Co-authored-by: JoeLametta <JoeLametta@users.noreply.github.com>
Signed-off-by: Andreas Oberritter <obi@saftware.de>
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-11-26 18:46:12 +00:00
JoeLametta
b2d06645af Address Freso's comment
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-11-26 18:46:12 +00:00
Drew DeVault
64dd9d843a Initial pass on python 3 port
Given the imminent end-of-life for Python 2, I didn't bother making the
codebase compatible with both.

Signed-off-by: Drew DeVault <sir@cmpwn.com>
2019-11-26 18:46:10 +00:00
JoeLametta
f740a0ef0d Add missing backslash to RegEX
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-11-01 09:26:42 +00:00
Frederik “Freso” S. Olesen
42638f6e21 Merge branch 'master' into develop
(To make versioning work properly for the develop branch, since
currently the v0.8.0 tag only exists in the master branch. This merge
will pull the v0.8.0 tagged commit into the develop branch too.)
2019-10-31 19:36:54 +01:00
JoeLametta
484b2f18b7 Add missing dependency to Dockerfile
Fixes #419.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-10-28 16:07:26 +00:00
JoeLametta
4238e714be Merge branch 'develop' 2019-10-27 13:30:33 +00:00
JoeLametta
db9c44a765 Push whipper v0.8.0 release
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-10-27 13:30:18 +00:00
JoeLametta
8e60fb9a18 Merge pull request #415 from itismadness/ruamel_yaml
Use ruamel.yaml for formatting and outputting rip .log file
2019-10-27 09:11:49 +01:00
itismadness
3cd2da79c3 write unit test case for WhipperLogger
Signed-off-by: itismadness <itismadness@users.noreply.github.com>
2019-10-27 08:00:00 +00:00
itismadness
862afffee9 Use ruamel.yaml for formatting rip .log file
- insert newlines after blocks of content
- strip quotes around creation time and offset
- Change offset value representation
- Clarify logger regular expressions
- Fix missing AccurateRip Summary field
- Read usage of time.gmtime(epoch) for generating datetime string
- fix missing dependency in travis
- install pycdio with specific version separately

Signed-off-by: itismadness <itismadness@users.noreply.github.com>
2019-10-27 08:00:00 +00:00
JoeLametta
81af7a4d03 Update Dockerfile
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-10-26 09:00:00 +00:00
JoeLametta
d7f6d6888f Merge pull request #274 from mtdcr/accuraterip-module
accuraterip-checksum: convert to python C extension
2019-10-26 11:32:27 +02:00
JoeLametta
da42842e58 Merge pull request #410 from whipper-team/bugfix/issue-375-cd-info-no-attribute
Handle missing self.options for whipper cd info
2019-10-26 11:29:07 +02:00
JoeLametta
993dd6cc33 Handle missing self.options for whipper cd info
The attributes working_directory, disc_template, output_directory and offset are not defined during whipper cd info and they are only needed for ripping. self.program.getTable doesn't need output_path to gather the tocfile.

Therefore, this part is excluded, if the attributes don't exist and an offset of 0 is used.

Fixes issue #375.

Co-authored-by: gorgobacka <tho.b.j@gmx.de>
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
Signed-off-by: gorgobacka <tho.b.j@gmx.de>
2019-10-26 11:24:30 +02:00
JoeLametta
d9b49df0aa Whitespace fixes
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-10-26 08:05:00 +00:00
JoeLametta
87a477a5d6 Fix wrong logger call
Introduced in 048a31e348.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-10-26 08:00:00 +00:00
JoeLametta
4569644335 Separate out Release in log into two value map
This allows log parsers to always extract correct information about the "artist" and "title" fields: previously that was a problem if either (or both) of those fields contained a "-" character.

Fixes #416.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-10-22 07:00:00 +00:00
JoeLametta
35561b51e5 Dockerfile: build newer libcdio version
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-10-21 16:30:00 +00:00
JoeLametta
948cde7921 Update README
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-10-21 16:00:00 +00:00
JoeLametta
8b6b2d34fe Merge pull request #418 from mtdcr/fix-less-than-ten
Fix ripping discs with less than ten tracks
2019-10-21 17:40:18 +02:00
JoeLametta
2e966a446d Pass toc_path as argument in program.py
Resolves #368.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-10-21 14:00:00 +00:00
JoeLametta
1be5adda65 Merge pull request #407 from whipper-team/bugfix/issue-284-flac-file-permissions
Set FLAC files permissions to 0644
2019-10-21 16:32:13 +02:00
JoeLametta
fe13affac2 Merge pull request #409 from whipper-team/bugfix/issue-361-drive-analysis-fails
Fix erroneous result message for whipper drive analyze
2019-10-21 16:30:03 +02:00
JoeLametta
14fb96e87c Merge pull request #408 from whipper-team/bugfix/issue-354-eliminate-eject-warning
Report eject's failures as logger warnings
2019-10-21 16:26:58 +02:00
JoeLametta
3b2b732516 Merge pull request #417 from mtdcr/fast-toc
Make getFastToc() fast again
2019-10-20 16:05:17 +02:00
Andreas Oberritter
abf9a971e7 Fix ripping discs with less than ten tracks
Output lines of cdrdao for single digit track numbers start with a
whitespace character.

Broken since #345 was merged.

Signed-off-by: Andreas Oberritter <obi@saftware.de>
2019-10-20 15:41:33 +02:00
Andreas Oberritter
342bce9be2 Make getFastToc() fast again.
Broken since #345 was merged.

Signed-off-by: Andreas Oberritter <obi@saftware.de>
2019-10-20 15:25:17 +02:00
Andreas Oberritter
252a2e8141 Use ittoc only for CDDB and MusicBrainz lookups
The data from itable may be more accurate, because ittoc comes from
getFastToc().

Signed-off-by: Andreas Oberritter <obi@saftware.de>
2019-10-20 15:25:17 +02:00
Andreas Oberritter
f68b91bc40 accuraterip-checksum: Add and install backwards-compatible script
Signed-off-by: Andreas Oberritter <obi@saftware.de>
2019-10-20 15:20:35 +02:00
Andreas Oberritter
ab95715efc accuraterip-checksum: convert to python C extension
* calculate v1 and v2 checksums at once
* let libsndfile handle both WAV and FLAC

Signed-off-by: Andreas Oberritter <obi@saftware.de>
2019-09-09 20:37:50 +02:00
JoeLametta
635113be9a Fix incorrect frames to MSF conversion
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-08-19 12:00:00 +00:00
JoeLametta
1c6fe42202 Set FLAC files permissions to 0644
Fixes #284.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-07-07 12:00:00 +00:00
JoeLametta
e5961ae04c Report eject's failures as logger warnings
If the eject command exits with an error, the output is logged as a WARNING. I don't think it's a good idea to mask those errors.

Closes #354.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-07-07 12:00:00 +00:00
JoeLametta
048a31e348 Fix erroneous result message for whipper drive analyze
If cdparanoia fails to analyze the drive, the drive is now marked as unable to defeat the cache.

Fixes #361.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-07-07 10:00:00 +00:00
JoeLametta
57d386e82f Remove too verbose logger statements
Related to #278.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-07-07 10:00:00 +00:00
it is madness
0d69258654 Use YAML 1.2 boolean values for booleans
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-07-06 16:00:00 +00:00
JoeLametta
b5f0af21be Merge pull request #406 from vmx/fix-offset-find
Fix offset find command
2019-07-05 11:18:49 +02:00
JoeLametta
4eeb0cddc7 Update failing AccurateRipResponse tests 2019-07-05 08:00:00 +00:00
Volker Mische
9cf890a6e2 Fix offset find command
The refactoring of `ReadTOCTask` in commit 3e79032b63
broke the `offset find` command. This commit fixes it again.

Signed-off-by: Volker Mische <volker.mische@gmail.com>
2019-07-05 00:06:02 +02:00
Thomas Vander Stichele
7a4680f285 Add testcase for Gentlemen: same CDDB ID as Interpol
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-05-09 09:46:28 +02:00
JoeLametta
3a74c60344 Update "required dependencies" section in README
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-05-04 10:18:03 +02:00
JoeLametta
bb78dc109d Merge pull request #387 from whipper-team/feature/issue-383-restructuredtext
Convert documentation from epydoc to reStructuredText
2019-05-03 20:11:09 +02:00
JoeLametta
69f8f39c49 Change documentation from epydoc to reStructuredText
Thanks to Freso for all the useful comments!

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-05-03 20:06:13 +02:00
JoeLametta
8db090c9bf Add Freso to whipper's credits
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-05-03 19:19:16 +02:00