Commit Graph

1291 Commits

Author SHA1 Message Date
JoeLametta
996cfd7bca Merge pull request #319 from Freso/issue-315-fix-unicode-error-in-truncate_filename
Explicitly encode path as UTF-8 in truncate_filename()
2018-10-29 12:28:18 +00:00
Frederik “Freso” S. Olesen
0fff37c954 Explicitly encode path as UTF-8 in truncate_filename()
`os.pathconf()` expects a bytes object, but the path is stored as a
unicode object. Since there's no specified encoding, Python chokes when
trying to convert it to a bytes object. Explicitly encoding it as UTF-8
allows Python to change it to a bytes object smoothly.

Fixes https://github.com/whipper-team/whipper/issues/315
2018-10-29 13:06:02 +01:00
JoeLametta
f9cb126270 Update README's Docker part with Docker Hub info
Now Docker adopters can use whipper trough Docker Hub's automatically built images.
Thanks to user "anarcat" for proposing and thoroughly explaining how to reach this goal.

Closes #301.
2018-10-27 19:56:26 +02:00
JoeLametta
e33876c734 Fix flake8 W605 warning 2018-10-27 08:30:00 +00:00
JoeLametta
d25b995e28 Push whipper v0.7.1 release 2018-10-23 08:30:00 +00:00
JoeLametta
97052322cf Merge pull request #310 from whipper-team/requirements
Add a requirements.txt file
2018-10-23 09:39:50 +02:00
JoeLametta
fd6611743b Amend previous commit
The comment included a typo and, using 'max' as variable name, I was accidentally shadowing Python's builtin 'max' function
2018-10-23 08:00:00 +00:00
JoeLametta
a6d2e122e3 Add a requirements.txt file
Fixes #221.
2018-10-23 08:00: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
JoeLametta
669b356daa Update README.md
Updated links from JoeLametta to whipper-team
2018-10-21 10:14:01 +02:00
JoeLametta
528b5a18e9 Update README.md
- Updated logger plugins information
- Updated links section (added Matrix)
2018-10-21 08:02:27 +00:00
JoeLametta
a1e6d6040b Fix AccurateRip summary reporting
The values stored in variables _inARDatabase and _accuratelyRipped were double incremented when both AR v1 and AR V2 entries were present e/o matched, leading to a wrong calculation and potentially erroneous summary reporting.
After this fix, in case of double matches only one is counted against each track.
2018-10-17 12:00:00 +00: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
JoeLametta
8b5e8a66d6 Merge pull request #305 from anarcat/docker-order
Reorder Dockerfile for performance
2018-10-06 16:41:54 +00:00
Antoine Beaupré
dad3b6e379 reorder Dockerfile for performance
it's better to install/build whipper at the end of the Dockerfile,
because it will allow us to cache costly operations like locale-gen
while rebuilding with new source changes.
2018-10-05 12:03:31 -04:00
anarcat
6d7e54f8b2 Fix Docker invocation (#300)
* fix syntax error in Dockerfile

* fix Docker invocation

It makes no sense to pass the `-t` argument twice and we need to tell
Docker where to find the Dockerfile. Also, it makes sense to write the
config file in a standard location. In my tests, I also had to create
the directory by hand otherwise I got this error:

    cdparanoia can defeat the audio cache on this drive.
    Adding drive cache behaviour to configuration file.
    Traceback (most recent call last):
      File "/usr/local/bin/whipper", line 11, in <module>
        load_entry_point('whipper==0.7.0', 'console_scripts', 'whipper')()
      File "/usr/local/lib/python2.7/dist-packages/whipper-0.7.0-py2.7.egg/whipper/command/main.py", line 36, in main
        ret = cmd.do()
      File "/usr/local/lib/python2.7/dist-packages/whipper-0.7.0-py2.7.egg/whipper/command/basecommand.py", line 139, in do
        return self.cmd.do()
      File "/usr/local/lib/python2.7/dist-packages/whipper-0.7.0-py2.7.egg/whipper/command/basecommand.py", line 139, in do
        return self.cmd.do()
      File "/usr/local/lib/python2.7/dist-packages/whipper-0.7.0-py2.7.egg/whipper/command/drive.py", line 63, in do
        info[0], info[1], info[2], t.defeatsCache)
      File "/usr/local/lib/python2.7/dist-packages/whipper-0.7.0-py2.7.egg/whipper/common/config.py", line 115, in setDefeatsCache
        section = self._findOrCreateDriveSection(vendor, model, release)
      File "/usr/local/lib/python2.7/dist-packages/whipper-0.7.0-py2.7.egg/whipper/common/config.py", line 164, in _findOrCreateDriveSection
        self.write()
      File "/usr/local/lib/python2.7/dist-packages/whipper-0.7.0-py2.7.egg/whipper/common/config.py", line 58, in write
        shutil.move(path, self._path)
      File "/usr/lib/python2.7/shutil.py", line 316, in move
        copy2(src, real_dst)
      File "/usr/lib/python2.7/shutil.py", line 144, in copy2
        copyfile(src, dst)
      File "/usr/lib/python2.7/shutil.py", line 97, in copyfile
        with open(dst, 'wb') as fdst:
    IOError: [Errno 13] Permission denied: u'/home/worker/.config/whipper/whipper.conf'

* remove needless tag version

:latest is implicit so it's useless noise as well.

* Update README.md
2018-10-03 15:43:58 +00:00
Thomas McWork
cfcbfd5623 Document Docker usage in the README (#297)
Document Docker usage in the README
2018-10-03 08:07:47 +00:00
JoeLametta
777b12934c Empty test commit 2018-09-25 08:00:00 +00:00
Thomas McWork
0a762e23b8 Add Dockerfile (#237)
* add dockerfile

* add cleanup and reduce produces layers

* switch to pycdio==0.21 + libcdio manual build

* use libcdio 2.0.0 and pycdio 2.0.0
2018-09-24 21:19:08 +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
84fa7c0944 Merge pull request #268 from JoeLametta/python3
Incremental code modernization for (future) Python 3 port
2018-06-08 14:34:41 +00:00
Joe
241f44eff6 Merge branch 'master' into python3 2018-06-08 14:32:27 +00:00
Joe
5db7656ef8 Clarify pre-emphasis reporting implementation
Currently whipper only reports about the pre-emphasis flag value as stored in the TOC.

Related to #275.
2018-05-24 17:29:51 +02:00
Joe
a320f6a0a5 Remove whipper's image retag feature (#269)
Fixes #262.
2018-05-24 17:19:14 +02:00
Andreas Oberritter
145403705d Switch to PyGObject by default (#271)
* cd/offset: remove unused call to gobject.thread_init()

There are no threads involved.

* task: switch to PyGObject

Python-gobject-2 is deprecated.

* travis: update dependencies for PyGObject and GLib-2.0

* README: Add GObject Introspection
2018-05-24 17:11:37 +02:00
Joe
8fe47ede2b Merge pull request #272 from mtdcr/task-log
task: implement logging
2018-05-24 11:12:58 +02:00
Andreas Oberritter
a5e3b0d325 task: implement logging 2018-05-10 03:48:46 +02:00
JoeLametta
3916f03e07 Indexing exceptions will not work on Python 3 2018-05-08 18:39:08 +02:00
JoeLametta
71df9124a6 Fix dict.keys referenced when not iterating 2018-05-08 18:39:08 +02:00
JoeLametta
f6d9f398b0 Exception.message removed in Python 3 2018-05-08 18:39:08 +02:00
JoeLametta
0f67bc4a96 Remove unneeded brackets in print statements 2018-05-08 18:39:08 +02:00
JoeLametta
bd81f80afa Make flake8 happy 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
b6ac79f01e Wrap map() in a list call 2018-05-08 18:39:08 +02:00
JoeLametta
9a7511b952 Replace iterator's next() methods usage with the next() function 2018-05-08 18:39:08 +02:00
JoeLametta
c26d4e99e5 Convert octal literals into the new syntax 2018-05-08 18:39:08 +02:00
JoeLametta
d3522940b2 Wrap existing range() calls with list 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
5f75d41c7b Replace deprecated unittest method names with the correct ones 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
JoeLametta
37fd1c6bb2 Add cdparanoia version to log file
Fixes #267.
2018-05-08 12:00:00 +00:00
JoeLametta
99bfe41c0a Update Travis CI URL 2018-05-08 08:00:00 +00:00
Joe
eb16904b9e Merge pull request #264 from mtdcr/master
Remove dead code from program.getFastToc
2018-05-08 08:46:32 +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
JoeLametta
db8050d8c4 Fix PEP-8 E128 2018-04-09 08:05:00 +00:00
JoeLametta
b5caf86cd2 Push whipper v0.7.0 release 2018-04-09 08:00:00 +00:00
Joe
1cece638cd Misc README changes
Fixes #229.
2018-04-09 10:31:04 +02:00
Q3CPMA
19eb9741c7 command.cd: simple message while reading toc
Fixes #257.
2018-04-05 18:00:00 +00:00