This avoids `%` character interpolation leading to `InterpolationSyntaxError`.
Added a comment explaining this too.
Fixes#443.
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
whipper now requires `discid` package - which can be installed through
pip and `discid` relies on libdiscid.
Signed-off-by: ABCbum <kimlong221002@gmail.com>
Using existing TOCs, create a new test case to verify discid generated
when data track is not at the end of the disc track-list.
Quality of test is not verified.
Signed-off-by: ABCbum <kimlong221002@gmail.com>
Since whipper's own "musicbrainz id calculation" fails on CDs with data
tracks on special places, the disc id calculation code is replaced with
libdiscid.
Gives a new way to calculate disc leadout or sectors (last sector of last
audio track) depends on whether the data track is placed last or not.
`discid` requires `len(track_offsets) != last - first + 1`.Which means
there can be only one data track in the disc and the lastTrack number is
deceptive.
For example: a disc (data audio audio audio) has firstTrack=1 lastTrack=3
which is wrong since according to the discid code :
"last **audio** track as :obj:`int"
it should be 4 but the firstTrack is always 1.
The code is duplicated with _getMusicBrainzValues function.
Signed-off-by: ABCbum <kimlong221002@gmail.com>
A new test case to check for mblookup's ability to search
for data based on release id is created along with a function
mocks getReleaseMetadata using an existing JSON file.
Signed-off-by: ABCbum <kimlong221002@gmail.com>
In order to make mblookup command able to lookup data based
on release id, new function getReleaseMetadata is created.
To remove duplicated code, importing and set_useragent is moved
to the top of the file.
Now _getMetadata behaves differently when the discid is not
specified.
Signed-off-by: ABCbum <kimlong221002@gmail.com>
To make mblookup able to look up data based on release id,
RegExp is used to detect whether the input is release id
or disc id and behaves differently according to that.
The input is now also tripped before being passed down.
Signed-off-by: ABCbum <kimlong221002@gmail.com>
This creates a specific job with the `FLAKE8` variable set, rather than
a setting up a 4×2 matrix. This means we create a total of 5 jobs now
rather than 8 jobs.
Part of https://github.com/whipper-team/whipper/pull/433
Signed-off-by: Frederik “Freso” S. Olesen <freso.dk@gmail.com>
Right now tests are only run against Python 3.5, but we claim we support
Python 3.5+ so let’s run our tests against both Python 3.5 and all later
(stable) versions.
PR: https://github.com/whipper-team/whipper/pull/433
Signed-off-by: Frederik “Freso” S. Olesen <freso.dk@gmail.com>
* Enable whipper to use track title if possible
track.title = t.get('title', t['recording']['title']).
Since if a track itself doesn't have a title then the track
title is the same with the recording title. Otherwise, a track
has its own title then t['title'] is different from
t['recording']['title'] and whipper chooses t['title'].
[Fixes#192]
Signed-off-by: ABCbum <kimlong221002@gmail.com>
* Add test case to check for track title
Using an existing JSON release file
Signed-off-by: ABCbum <kimlong221002@gmail.com>
Every line, except the last one, of the output was missing a double quote character at the end.
Additional changes:
- Specify parser to avoid BeautifulSoup warning
- Use single quotes only
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
Python 3 port
From now on whipper's codebase will be compatible only with Python 3.
NOTE: This pull request introduces a regression: more details in #424.
Special thanks to @ddevault for kickstarting the porting effort!
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>
- 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>
(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.)
- 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>
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>
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>