Commit Graph

62 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
941db66398 * morituri/program/cdparanoia.py:
Warn about missing cdparanoia too.
2010-06-18 22:28:13 +00:00
Thomas Vander Stichele
710a9ebb35 patch by: Peter Oliver
* morituri/program/cdparanoia.py:
	  Respect umask for encoded files.  Fixes #17.
2010-04-14 22:01:16 +00:00
Thomas Vander Stichele
c34546d70a * morituri/image/table.py:
* morituri/program/cdparanoia.py:
	  Do some 80 character cleanups.
2010-04-09 16:20:41 +00:00
Thomas Vander Stichele
e124c79c64 * morituri/program/cdparanoia.py:
Add some debug.
	* morituri/common/encode.py:
	  Add more debug.
	  Handle the case where peak is full scale, and peakdB thus 0,
	  which triggered not setting self.peak.
2010-04-08 21:06:52 +00:00
Thomas Vander Stichele
22a3554381 * morituri/common/encode.py:
* morituri/common/program.py:
	* morituri/image/image.py:
	* morituri/program/cdparanoia.py:
	* morituri/rip/cd.py:
	* morituri/rip/image.py:
	* morituri/rip/offset.py:
	  Move all gst-using imports inside functions and classes
	  to avoid 'import gst' eating our options.
	  Fixes #12.
2010-04-04 19:29:49 +00:00
Thomas Vander Stichele
5cf823a640 * morituri/program/cdparanoia.py:
explicitize keyword args.
	  Break some 80+ lines.
2009-09-19 11:58:33 +00:00
Thomas Vander Stichele
ce7b5762f7 * morituri/program/cdparanoia.py:
* morituri/rip/offset.py:
	  Another unicode fix.
2009-09-12 17:23:39 +00:00
Thomas Vander Stichele
e6f13ccf84 * HACKING:
Note unicode handling.
	* morituri/test/test_image_image.py:
	* morituri/image/table.py:
	* morituri/program/cdparanoia.py:
	* morituri/common/checksum.py:
	  Use unicode for paths.
	  Use repr for path representation.
	* morituri/test/test_common_checksum.py:
	  Add test for unicode audio file name.
2009-09-11 15:40:44 +00:00
Thomas Vander Stichele
d75066d1bb pychecker cleanup 2009-06-07 13:46:26 +00:00
Thomas Vander Stichele
8ef93523e4 * morituri/test/cdparanoia.progress:
Add a shorter test file, 23 seconds.
	* morituri/test/test_program_cdparanoia.py:
	  Update the test to adapt.  Check for track quality.
	* morituri/program/cdparanoia.py:
	  Add a measure of track quality based on the number of reads.
	  Use the [wrote] output for progress updates, a bit more
	  jittery in its output.
	* morituri/rip/cd.py:
	  Set track quality on RipResult.
2009-06-06 11:16:41 +00:00
Thomas Vander Stichele
2b17b8e912 * morituri/program/cdparanoia.py:
* morituri/rip/cd.py:
	  Handle another off-by-one error in the m3u handling.
	  Add a getTagList function.
	  Use it to encode tags.
2009-06-01 12:53:14 +00:00
Thomas Vander Stichele
2f3c0fdcaf * morituri/common/encode.py:
* morituri/program/cdparanoia.py:
	* morituri/rip/cd.py:
	  Clean up the temporary unencoded file.
	  Pass profile as objects to tasks, so that temp files have the right
	  extension.
2009-06-01 09:45:30 +00:00
Thomas Vander Stichele
f33c50cead * morituri/common/encode.py:
* morituri/program/cdparanoia.py:
	  Add encoding profiles, kept simple for now as a class and
	  subclasses.  Use them to encode.  Calculate peak level while
	  encoding, compared to EAC and replaygain's value.
	* morituri/rip/cd.py:
	  Use the encoding profiles, ripping with the right extension.
	  Add a --profile parameter for it.
2009-05-31 23:04:58 +00:00
Thomas Vander Stichele
631b1478b8 * morituri/program/cdparanoia.py:
* morituri/image/image.py:
	  Correctly chain up to parent __init__ for MultiTasks
2009-05-25 14:47:07 +00:00
Thomas Vander Stichele
85e9058594 * morituri/program/cdparanoia.py:
Add copy and test CRC's to object.
2009-05-23 19:47:58 +00:00
Thomas Vander Stichele
3f1ace2ce2 * morituri/program/cdparanoia.py:
* morituri/program/cdrdao.py:
	* morituri/rip/cd.py:
	* morituri/rip/offset.py:
	  Add device argument to ripping/scanning tasks.
2009-05-23 18:14:31 +00:00
Thomas Vander Stichele
41c92fcda4 pychecker fixes 2009-05-22 20:44:10 +00:00
Thomas Vander Stichele
bedd5d1fc1 use constants 2009-05-22 20:08:36 +00:00
Thomas Vander Stichele
0a56fc129e * morituri/image/cue.py:
* morituri/image/image.py:
	* morituri/image/table.py:
	* morituri/image/toc.py:
	* morituri/program/cdparanoia.py:
	* morituri/program/cdrdao.py:
	* morituri/test/test_image_cue.py:
	* morituri/test/test_image_table.py:
	  Rename IndexTable to Table.
2009-05-16 09:31:38 +00:00
Thomas Vander Stichele
59cb5d0dcb * morituri/common/checksum.py:
* morituri/common/common.py:
	* morituri/image/image.py:
	* morituri/image/table.py:
	* morituri/program/cdparanoia.py:
	  Move constants to common
2009-05-16 09:21:55 +00:00
Thomas Vander Stichele
e0ed33b1da * morituri/program/cdparanoia.py:
Fix up track counting so HTOA can be ripped again.
	* examples/readhtoa.py:
	  Fix up example so it works again, tested on Silent Alarm.
2009-05-15 19:42:08 +00:00