Commit Graph

104 Commits

Author SHA1 Message Date
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
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
Samantha Baldwin
ee9a58fcbb soxi: remove self._path unused variable, mark dep as 'soxi' (#89) 2016-12-15 23:05:14 +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
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
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
Merlijn Wajer
9ae279c811 Add and use FastAccurateRipChecksumTask 2016-10-15 19:15:27 +02:00
Merlijn Wajer
d1f0165cf3 Add accuraterip-checksum program 2016-10-15 19:15:27 +02:00
JoeLametta
c29da6cb97 Add experimental overread support (lead-out)
thomasvs/morituri#137
2015-11-29 16:24:16 +01:00
JoeLametta
ede51f117a encode to final path+'.part' instead of a temp file
thomasvs/morituri#109
2015-11-29 16:20:49 +01:00
Thomas Vander Stichele
7813103a4d get version for cdrdao too.
Add debug commands: rip debug version cdrdao/cdparanoia
2013-07-13 11:42:06 +02:00
Thomas Vander Stichele
20f6a0b70e improve debug 2013-03-05 17:15:54 +01:00
Thomas Vander Stichele
3f4291bb18 Handle off-by-1 errors in cdparanoia progress parsing
Fixes the exception I got on ripping The Strokes - Someday
2013-02-24 11:37:13 +01:00
Thomas Vander Stichele
dac8f2f921 fix whitespace 2013-02-03 14:58:19 +01:00
Thomas Vander Stichele
a436190555 only mark as a failure if we see an expected string 2013-02-03 14:58:04 +01:00
Thomas Vander Stichele
a1cf9be277 make sure we mark defeatsCache as false if cdparanoia fails. 2013-02-03 14:55:59 +01:00
Thomas Vander Stichele
e764854fa0 debug and doc 2013-01-20 20:02:38 +01:00
Thomas Vander Stichele
4647d107a9 * morituri/program/cdparanoia.py:
* morituri/test/test_program_cdparanoia.py:
	  Add a task that can analyze the drive for whether it defeats
	  the audio cache.
	* morituri/result/result.py:
	* morituri/rip/cd.py:
	  Make it possible to store whether a drive defeats audio cache
	  in the result.
	* morituri/rip/drive.py:
	  Add rip drive analyze command to analyze caching of a drive,
	  and store it in the config.
2012-12-04 00:14:42 +00:00
Thomas Vander Stichele
b8fd3f2931 * morituri/common/task.py:
* morituri/program/cdrdao.py:
	  Factor out a PopenTask base class.
2012-12-03 22:58:22 +00:00
Thomas Vander Stichele
3a9a939520 paranoia deserves a capital P 2012-12-03 22:11:57 +00:00
Thomas Vander Stichele
cba7dbe41a pep8 fixes 2012-11-29 19:54:46 +00:00
Thomas Vander Stichele
e67ad23894 * morituri/common/program.py:
* morituri/program/cdparanoia.py:
	* morituri/result/result.py:
	  Track ripping speed for test and encode per-track.
2012-11-27 08:09:51 +00:00
Thomas Vander Stichele
31a6bd942a patch by: mustbenice
* morituri/program/cdparanoia.py:
	* morituri/result/result.py:
	* morituri/rip/cd.py:
	* morituri/test/test_program_cdparanoia.py:
	  Get cdparanoia version.
	  Store both cdparanoia and cdrdao versions on rip result.
2012-11-25 22:00:42 +00:00
Thomas Vander Stichele
76e8d94801 * morituri/program/cdparanoia.py:
Make sure we calculate fractional speed.
2012-11-25 20:57:19 +00:00
Thomas Vander Stichele
5b1e2c88a4 patch by: mustbenice
* morituri/common/program.py:
	* morituri/program/cdparanoia.py:
	* morituri/result/logger.py:
	* morituri/result/result.py:
	  Calculate speed of reading track.
	  Output Test and Copy speed per track in log.
2012-11-25 19:54:15 +00:00
Thomas Vander Stichele
0fab4515c6 pep8 fixes 2012-11-11 23:00:37 +00:00
Thomas Vander Stichele
4a4e1ba128 * morituri/program/cdparanoia.py:
* morituri/rip/cd.py:
	  Add a number of tries to rip a track.
2012-11-11 22:40:53 +00:00
Thomas Vander Stichele
d757afe5b1 pep8 fixes 2012-11-11 22:36:06 +00:00
Thomas Vander Stichele
e3cce37de4 pep8 fixes 2012-11-10 22:18:09 +00:00
Thomas Vander Stichele
4d6a682b49 pep8 fixes 2012-11-10 22:15:24 +00:00
Thomas Vander Stichele
0d4971b301 whitespace 2012-11-10 21:41:35 +00:00
Thomas Vander Stichele
2282a39f2b log checksums 2012-11-10 21:30:53 +00:00
Thomas Vander Stichele
f1b827d6c5 add debug 2012-01-23 21:11:03 +00:00
Thomas Vander Stichele
2c27b73d09 * morituri/common/common.py:
Add shrinkPath to write shorter path names.
	* morituri/test/test_common_common.py (added):
	  Add test.
	* morituri/program/cdparanoia.py:
	  Catch ENAMETOOLONG and shrink path.
	* morituri/common/program.py:
	  Update track result's filename if it was shrunk.
	* morituri/rip/cd.py:
	  set the possibly shrunk path on the result.
2011-09-18 15:19:45 +00:00
Thomas Vander Stichele
4fdfb7f58c * morituri/program/cdparanoia.py:
Log properly again.
	  Properly set exception when we can't rename the file.
2011-09-18 09:18:47 +00:00
Thomas Vander Stichele
a8dddb9d70 * morituri/program/cdparanoia.py:
Make sure exceptions don't prevent the task from chaining up
	  to the parent stop() implementation, giving the runner a chance
	  to actually stop.
2011-08-07 17:57:24 +00:00
Thomas Vander Stichele
798a209195 * morituri/extern/task (added):
* morituri/extern/task/taskgtk.py (added):
	* morituri/extern/task/gstreamer.py (added):
	* morituri/extern/task/task.py (added):
	* morituri/common/taskgtk.py (deleted):
	* morituri/common/gstreamer.py (deleted):
	* morituri/common/task.py (deleted):
	  Move task-related modules into an extern directory so other
	  projects can use them.
	* morituri/common/checksum.py:
	* morituri/common/encode.py:
	* morituri/image/image.py:
	* morituri/program/cdparanoia.py:
	* morituri/program/cdrdao.py:
	* morituri/rip/cd.py:
	* morituri/rip/debug.py:
	* morituri/rip/image.py:
	* morituri/rip/main.py:
	* morituri/rip/offset.py:
	* morituri/test/test_common_checksum.py:
	* morituri/test/test_common_encode.py:
	* morituri/test/test_image_image.py:
	  Adapt.  Tests work.
2011-08-05 18:50:51 +00:00
Thomas Vander Stichele
b3bbf55ca2 * morituri/program/cdrdao.py:
Avoid floating point error.
2011-07-20 02:37:00 +00:00
Thomas Vander Stichele
5071034dfb * morituri/program/cdrdao.py:
Fix log output.
	  Do progress output while scanning TOC.
2011-07-09 10:04:59 +00:00
Thomas Vander Stichele
8bc5eff73c * morituri/common/task.py:
add task argument to TaskRunner.schedule so we can get exceptions.
	  Add .schedule method to Task to pass self.
	* morituri/common/checksum.py:
	* morituri/common/encode.py:
	* morituri/common/gstreamer.py:
	* morituri/program/cdparanoia.py:
	* morituri/program/cdrdao.py:
	  Adapt.
2011-05-24 12:51:40 +00:00
Thomas Vander Stichele
b32a534a82 * morituri/program/cdparanoia.py:
Since stop can be same as start, add + 1 to progress calculation.
	  Fiexes #37.
2011-05-22 15:16:00 +00:00
Thomas Vander Stichele
f70ba7cb32 * morituri/program/cdparanoia.py:
* morituri/common/encode.py:
	* morituri/common/program.py:
	* morituri/rip/cd.py:
	  Add action and what args to describe task better.
2011-05-19 00:28:36 +00:00
Thomas Vander Stichele
f8409b29e1 * morituri/program/cdparanoia.py:
cdparanoia can hang indefinitely on scsi read errors.
	  For example, on some drives, when trying negative offsets.
	  Notice them, count them, and fail after 100.
	* morituri/test/test_program_cdparanoia.py:
	* morituri/test/cdparanoia.progress.error (added):
	  Add a test for this output.
2011-03-23 19:40:47 +00:00
Thomas Vander Stichele
b2a74e14c6 * morituri/program/cdparanoia.py:
Extend FileSizeError with an extra message.
	* morituri/rip/offset.py:
	  Print a reasonable warning when we cannot rip with a certain offset.
	  See #57.
2011-03-20 18:32:02 +00:00
Thomas Vander Stichele
322ec7f5e5 add errors properly 2011-01-01 11:29:40 +00:00
Thomas Vander Stichele
4fafb7d148 * morituri/program/cdrdao.py:
Add logCategory to CDRDAO tasks.
	  Remove errors from parser, set them publically on task.
	  Properly raise exceptions on data cd's with correct stack origin.
2010-11-08 20:00:43 +00:00
Thomas Vander Stichele
941db66398 * morituri/program/cdparanoia.py:
Warn about missing cdparanoia too.
2010-06-18 22:28:13 +00:00
Thomas Vander Stichele
0c5e13ce0f * morituri/common/common.py:
Add MissingDependencyException.
	* morituri/program/cdrdao.py:
	* morituri/rip/main.py:
	  Use it to warn about missing cdrdao.
2010-06-18 22:02:53 +00:00