Commit Graph

1097 Commits

Author SHA1 Message Date
Frederik “Freso” S. Olesen
5e3b10eaae Small cleanups of setup.py (#102)
* Limit number of imports in setup.py.

* Make setup.py PEP8 compliant.
2017-01-06 21:14:29 +01:00
JoeLametta
b0bb561d5e Merge pull request #96 from RecursiveForest/add-setuptools-info
add url and license to setup.py
2017-01-06 21:13:54 +01:00
Samantha Baldwin
a1eb3377ea cdrdao no-disc ejection & --eject (#93)
* cdrdao: eject empty disc while reading toc

- introduce EjectError
- move {eject,load,unmount}_device to program.utils

* remove duplicated eject

* remove unnecessary ejection

* add --eject option
2017-01-01 19:41:23 +01:00
JoeLametta
17021a68f2 Merge pull request #98 from ribbons/defeat-cache-config
Persist False value for defeats_cache correctly
2017-01-01 19:17:17 +01:00
Matt Robinson
3f9cc77e30 Persist False value for defeat_cache correctly
If cdparanoia can't work around the audio caching of a drive,
defeats_cache = False is written to the config.  However, when it is
read back the string 'False' ends up being converted to True (as it is
not an empty string).

This corrects the behaviour when reading the value back and adds tests
to make sure that both True and False can be correctly retrieved from
the config.
2016-12-31 17:48:21 +00:00
Samantha Baldwin
976e1bdca2 remove configure.configure, use __version__, remove getRevision() (#94)
* remove configure.configure, use __version__, remove getRevision()

* remove empty configure/ directory

* remove morituri.configure imports
2016-12-31 16:41:18 +01:00
JoeLametta
ee298906ac Merge pull request #97 from ribbons/drive-info-suggested
Update suggested commands given by `drive list`
2016-12-31 16:22:37 +01:00
Matt Robinson
cf55d5e51e Update suggested commands given by drive list
If the drive offset or cache status are unknown, 'drive list' suggests
running 'rip offset find' or 'rip drive analyze'.  Update these to
refer to whipper instead.
2016-12-31 14:21:03 +00:00
Samantha Baldwin
975edc0a01 add url and license to setup.py 2016-12-28 01:27:27 -05:00
Samantha Baldwin
d1ed80d62a argparse & logging (#92)
* introduce logcommand.Lager, Whipper(); use argparse for whipper image commands, stub logging

* update Lager docstring to mention config.Config()

* make incorrect subcommand and --version work on toplevel command

* migrate accurip show, expand Lager, do not attempt to return from Lager.__init__.

* migrate offset find, add Lager.error

* correct offset find drive symlink handling

* migrate drive

* change Lager.__init__(prog) to arg from kwarg

* but actually

* remove Whipper.usage

* add and use Lager.device_option() context manager

* help I married an axe murderer

* use unified options namespace for entire command tree

* migrate whipper cd without comprehensive config loading

* switch to logging module

- use logging instead of flog for non-extern modules
- use WHIPPER_DEBUG and WHIPPER_LOGFILE env variables

* convert self.log calls to logger.debug

* convert self.error calls to logger.error

* remove log.Loggable, use logger not logging

* Logging conversion continues

- Convert log.* calls to logger.*
- Remove morituri.common.log imports

* remove morituri.common.log from tests

* remove extern/flog, bare minimum Debug conversion

* update README for logging changes

* update soxi to use logging

* refactor Lager for more declarative subcommands

* Refactor Lager.device_option:

- inline into __init__
- throw IOError instead of Exception for missing drives
- remove CommandError checking in rip/main

* rename rip to whipper in rip.main

* convert rip.debug commands

* Rename logcommand.Lager to command.BaseCommand

- remove command.CommandError occurrences
- remove python-command external module

* remove submodules from README, update rclog formatter

* update minor ambiguity in readme for command invocation

* update version number to match setup.py

* remove gitmodules

* update version number in tests as well (boo)

* convert logger.error to logger.critical

* Change morituri.rip to morituri.command

- mv common.command to command.basecommand
- move TEMPLATES used only by rip.cd out of rip.common
- update entry point for command to command.main

* update basecommand documentation

* go pyflaking: import fixing

* replace self.stdout with sys.stdout

* remove BaseCommand.config, alphabetise imports

* convert self.stdXXX leftovers

* convert last getRootCommand to config.Config

* convert last getExceptionMessage's to str

* change musicbrainz useragent to whipper
2016-12-20 23:11:30 +01:00
JoeLametta
8f4607de4c Merge pull request #91 from pierrrrrrre/patch-1
Update README.md
2016-12-17 22:33:41 +01:00
Pierre
b3f0fbc59d Update README.md
Added clearer info on required GStreamer-related packages.

I got a `no module named gst` while testing on Ubuntu 16.04 and figured it would be clearer to name the package to install to avoid that.
2016-12-17 23:25:00 +08:00
JoeLametta
4a8c57087b Merge pull request #90 from JoeLametta/readme
Fixed README broken links and added a better changelog
2016-12-17 13:02:54 +01:00
JoeLametta
c647b4cfb9 Fixed README broken links and added better changelog 2016-12-17 12:52:02 +01:00
Samantha Baldwin
ee9a58fcbb soxi: remove self._path unused variable, mark dep as 'soxi' (#89) 2016-12-15 23:05:14 +01:00
Samantha Baldwin
d455b77e8a Merge pull request #80 from chrysn-pull-requests/error-reporting-enhancements-noassert
Error reporting enhancements (conditional-raise-instead-of-assert version)
2016-12-15 15:37:31 -05:00
Samantha Baldwin
a443f3006b Merge pull request #67 from chrysn-pull-requests/sox-audiolengthtask
Use soxi instead of gstreamer to determine a track's length
2016-12-15 15:00:07 -05:00
Takeshi Suzuki
71335e1449 Fix spelling mistake in README.md (#86) 2016-12-11 15:29:19 +01:00
chrysn
f9af58ed3e main: show TaskException instead of raising them
a TaskException already wraps another exception; raising it gives a
hard-to-read multi-line message instead of showing the clean wrapped
original backtrace; for comparison, an asserton error in image.py line
253:

exception AssertionError at /home/chrysn/git/whipper/morituri/image/image.py:253: stop(): Track length was not found; look for earlier errors in debug log (set RIP_DEBUG=4)
Traceback (most recent call last):
  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 497, in _startWrap
    task.start(self)
  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 395, in start
    BaseMultiTask.start(self, runner)
  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 330, in start
    self.next()
  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 401, in next
    BaseMultiTask.next(self)
  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 351, in next
    self.stop()
  File "/home/chrysn/git/whipper/morituri/image/image.py", line 253, in stop
    assert taskk.length is not None, "Track length was not found; look for earlier errors in debug log (set RIP_DEBUG=4)"
AssertionError: Track length was not found; look for earlier errors in debug log (set RIP_DEBUG=4)

vs.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/chrysn/git/whipper/morituri/rip/main.py", line 27, in main
    ret = c.parse(sys.argv[1:])
  File "/home/chrysn/git/whipper/morituri/rip/main.py", line 94, in parse
    logcommand.LogCommand.parse(self, argv)
  File "/home/chrysn/git/whipper/morituri/common/logcommand.py", line 62, in parse
    command.Command.parse(self, argv)
  File "/home/chrysn/git/whipper/morituri/extern/command/command.py", line 401, in parse
    return self.subCommands[command].parse(args[1:])
  File "/home/chrysn/git/whipper/morituri/common/logcommand.py", line 62, in parse
    command.Command.parse(self, argv)
  File "/home/chrysn/git/whipper/morituri/extern/command/command.py", line 401, in parse
    return self.subCommands[command].parse(args[1:])
  File "/home/chrysn/git/whipper/morituri/common/logcommand.py", line 62, in parse
    command.Command.parse(self, argv)
  File "/home/chrysn/git/whipper/morituri/extern/command/command.py", line 363, in parse
    ret = self.do(args)
  File "/home/chrysn/git/whipper/morituri/rip/image.py", line 184, in do
    cueImage.setup(runner)
  File "/home/chrysn/git/whipper/morituri/image/image.py", line 75, in setup
    runner.run(verify)
  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 490, in run
    raise TaskException(task.exception, message=msg)
morituri.extern.task.task.TaskException: (AssertionError('Track length was not found; look for earlier errors in debug log (set RIP_DEBUG=4)',), 'exception AssertionError at /home/chrysn/git/whipper/morituri/image/image.py:253: stop(): Track length was not found; look for earlier errors in debug log (set RIP_DEBUG=4)\nTraceback (most recent call last):\n  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 497, in _startWrap\n    task.start(self)\n  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 395, in start\n    BaseMultiTask.start(self, runner)\n  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 330, in start\n    self.next()\n  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 401, in next\n    BaseMultiTask.next(self)\n  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 351, in next\n    self.stop()\n  File "/home/chrysn/git/whipper/morituri/image/image.py", line 253, in stop\n    assert taskk.length is not None, "Track length was not found; look for earlier errors in debug log (set RIP_DEBUG=4)"\nAssertionError: Track length was not found; look for earlier errors in debug log (set RIP_DEBUG=4)\n')
2016-11-29 13:30:17 +01:00
chrysn
6581812d19 image: add check to give more meaningful error message 2016-11-29 13:30:11 +01:00
chrysn
bacda81408 AudioLengthTest: adapt to new soxi backend
* Use extensions soxi understands (ie. ".flac")
* Actually test for result correctness on files with odd characters in
  their names by copying the test track
* Relax the requirements on the "track absent" task to only raise some
  TaskError (the previously tested behavior was backend dependent, and
  the application did not actually depend on that behavior)
2016-11-29 12:56:18 +01:00
chrysn
89d6c8fef8 AudioLengthPath: move unit test in parallel to code 2016-11-29 12:56:18 +01:00
chrysn
ba10b573a2 Use soxi instead of gstreamer to determine a track's length
Contributes-To: https://github.com/JoeLametta/whipper/issues/29
2016-11-29 12:56:18 +01:00
JoeLametta
8fdb452aa6 Fix README mistake 2016-11-10 23:16:38 +01:00
Samantha Baldwin
65bfad9253 Update top level informational files (#71)
* update HACKING to mention pep8, data structures, and more test discs
* add notice of TODO deprecation
* remove ChangeLog, NEWS, and RELEASE from new versions
* rename COPYING to LICENSE
2016-11-10 23:12:03 +01:00
JoeLametta
2fc90e0789 Update information for release v0.4.0 2016-11-08 23:04:25 +01:00
JoeLametta
2d7692cb22 Invoke whipper by its name + Readme rewrite (#70)
* Whipper is now invoked by its name ("whipper") instead of "rip"
* README has been rewritten to provide a better experience and updated information
2016-11-08 22:31:13 +01:00
Samantha Baldwin
39aa68909e do not recalculate musicbrainz disc id for every getMusicBrainzDiscId() call (#69) 2016-11-08 13:16:52 +01:00
JoeLametta
5a59f3c7e3 Merge branch 'RecursiveForest-directory' 2016-11-03 10:05:05 +01:00
JoeLametta
9ea0cfaef6 Solve merge conflict 2016-11-03 10:04:38 +01:00
Samantha Baldwin
a99ca78acf undelete overzealously removed plugin initialisation (#61)
* undelete overzealously removed plugin initialisation
* tersify pkg_resources/directory calls since we don't care about errors
2016-11-03 09:47:19 +01:00
Samantha Baldwin
bccba71b42 refactor morituri.common.directory to shed Directory() and bulk 2016-11-02 17:52:14 -04:00
Samantha Baldwin
1e0176553b tersify pkg_resources/directory calls since we don't care about errors 2016-11-02 16:44:48 -04:00
Samantha Baldwin
b73048bb70 undelete overzealously removed plugin initialisation 2016-11-02 16:36:31 -04:00
JoeLametta
c279e8b214 Raise Exception when track rip runs out of attempts
Should fix #57
2016-10-30 10:24:31 +01:00
JoeLametta
9f6095a23b Fix error in logger.py
Solves #58
2016-10-30 09:07:32 +01:00
JoeLametta
f6924edf48 Logger update
* improved code clarity
* added a bit of documentation
* removed peak level's erroneous percent sign
* removed morituri compatibility code paths
2016-10-27 20:53:06 +02:00
JoeLametta
203fd7a70c Merge pull request #55 from chrysn-pull-requests/fix-executable-flag
README.md: drop executable flag
2016-10-27 12:34:04 +02:00
chrysn
926df4d7aa README.md: drop executable flag
The flag seems to have been set accidentally in dceb10f4.
2016-10-26 18:14:55 +02:00
Samantha Baldwin
d7f8557426 replace cdrdao.py with much simpler version (#52)
* replace cdrdao.py with much simpler version
* more pythonic syntax for cdrdao.read_toc(fast_toc=) switching
* fix silly typo
2016-10-22 10:32:18 +02:00
Samantha Baldwin
8721ba1caf standardise program/sox.py formatting, add test case, docstring (#53)
* standardise program/sox.py formatting, add test case
* add program/sox.peak_level() docstring
* update .travis.yml to include sox as a test dependency
* move sox from test dependency to normal dependency
* update README to mention sox, remove small autoconf mention
* use .splitlines() instead of .split('n')
2016-10-21 23:54:13 +02:00
Samantha Baldwin
566414c939 nuke-autohell (#54)
* remove m4 directory
* remove leftover Makefile.am after confirming its uselessness
* remove another useless autoconf Makefile.am
2016-10-21 11:33:05 +02:00
JoeLametta
4636c55233 Update CI tests
* slightly updated the README file
* updated morituri version number in cue tests
* commented out a portion of testAccurateRipChecksum (it should be updated/fixed later on)
2016-10-20 09:57:05 +02:00
JoeLametta
042abce68c Merge pull request #51 from JoeLametta/setuptools
use setuptools, remove autohell, use raw make for src/
2016-10-20 09:17:45 +02:00
Samantha Baldwin
2dae462677 update .travis.yml to reflect setuptools migration 2016-10-20 01:11:40 -04:00
Samantha Baldwin
063876b575 use setuptools, remove autohell, use raw make for src/ 2016-10-19 17:54:01 -04:00
Samantha Baldwin
b2ca3167eb Sox (#48)
* update README to force python2
* add support for PRE_EMPHASIS detection; mark pre-emphasis as FLAGS PRE in .cue
* correct typo, s/ivar/type/ for pre_emphasis element in track table
* add SoxPeakTask, program/sox module, sox.peak_level()
* use sox peak detection in lieu of gstreamer
2016-10-17 15:42:17 +02:00
JoeLametta
3a2e3021c2 Update README.md
Added information about the new dependencies
2016-10-15 21:20:54 +02:00
JoeLametta
7749c199e3 Merge pull request #37 from MerlijnWajer/fast-accuraterip-checksum
Fast accuraterip checksum
2016-10-15 20:34:51 +02:00
Merlijn Wajer
bce359f9d5 Use Fast version of AccurateRipChecksumTask
There are still some changes required to make whipper handle ARv2 checksums,
currently doesn't call the Task for a V2 checksum. V1 should keep working as-is.
2016-10-15 19:15:27 +02:00