Commit Graph

59 Commits

Author SHA1 Message Date
Frederik “Freso” S. Olesen
a8af9b79ab s/morituri/whipper/ in GPL copyright blurbs. 2017-04-26 16:09:13 +02:00
Merlijn Wajer
304c66876b Fix several issues in the gstreamer removal PR
Patch by JoeLametta
2017-04-23 22:32:05 +02:00
Merlijn Wajer
e7767694af Rip out all code that directly uses gstreamer
We can now rip CDs without gstreamer.

This is not the most clean attempt, but I have tried to remove most of the
code that depends on gstreamer. I hope there is not a lot of code left that
depends on code that I have removed - I can at least rip a CD fully.
2017-02-09 23:05:34 +01:00
Merlijn Wajer
6ddb5d0114 Add gstreamer-less flac encoder and tagging (#121)
* Add encoding using Xiph.org 'flac' program.

This adds a FlacEncodeTask that encodes wave files to flac files.
This commit also replaces morituri's EncodeTask with FlacEncodeTask, however, in
morituri, EncodeTask also does the tagging.

FlacEncodeTask will not perform the tagging.
So we will need an extra task for the tagging - this will be added soon.

Meanwhile, do not merge this commit to master yet.

* Add tagging using mutagen.

Replace the gstreamer tagging code with mutagen tagging code.
getTagList is rewritten to return a dictionary of tags, which are then simply
passed to mutagen.

The way it is set up right now is not the best - I don't think it makes sense
for tagging to take place in program/cdparanoia.py ; but this is how the current
code did it.

I suggest that, when we rip out all the gstreamer code, we also move the tagging
to a more sensible place; and then also make the tagging not be an actual
'task.Task'.

* Add gstreamer-less CRC32 version

Only works on wave files at this point. Should not be a problem, I think.

* Use proper musicbrainz tags and ALBUM tag.

* Add mutagen to .travis.yml
2017-02-02 21:50:47 +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
Merlijn Wajer
9ae279c811 Add and use FastAccurateRipChecksumTask 2016-10-15 19:15:27 +02:00
JoeLametta
9ade743d63 Various short bugfixes
thomasvs/morituri#139
2015-11-29 16:25:38 +01:00
Thomas Vander Stichele
d52b008751 make sure we have a traceback 2013-07-21 15:16:10 +02:00
Thomas Vander Stichele
32000bd0d0 Add new command: rip debug maxsample
Calculates the maximum absolute sample value.
Helpful to verify whether HTOA tracks are pure silence or not.
2013-05-10 22:06:38 +02:00
Thomas Vander Stichele
47a9481bc1 Document and fix comments. 2013-05-10 22:06:04 +02:00
Thomas Vander Stichele
4e03a6e966 work around GStreamer bug in flacdec for really short files 2013-02-26 23:12:16 +01:00
Thomas Vander Stichele
58156f91a6 better debugging and failing 2013-01-20 17:56:53 +01:00
Thomas Vander Stichele
4a24671bce better debugging when sampleLength is claimed unknown 2013-01-18 19:36:38 +01:00
Thomas Vander Stichele
99936325ae rename frame to sample to avoid confusion with cd frames 2013-01-18 19:30:13 +01:00
Thomas Vander Stichele
884c047713 return if we have an exception 2013-01-18 19:24:42 +01:00
Thomas Vander Stichele
20cb0b3180 debug better 2013-01-18 19:24:09 +01:00
Thomas Vander Stichele
0735c716d1 raise an exception for this error 2013-01-18 19:23:52 +01:00
Thomas Vander Stichele
25947c369d update error message 2013-01-06 21:27:35 +00:00
Thomas Vander Stichele
cba7dbe41a pep8 fixes 2012-11-29 19:54:46 +00:00
Thomas Vander Stichele
cd90c361a6 give a logname 2012-11-18 13:08:31 +00:00
Thomas Vander Stichele
6b45a9935b pep8 cleanup 2012-11-10 21:50:26 +00:00
Thomas Vander Stichele
91b852b485 * morituri/common/checksum.py:
* morituri/common/encode.py:
	  Add a GstPipelineTask that lets us log.
	  Handle checksumming of small tracks better.
2012-08-12 12:26:33 +00:00
Thomas Vander Stichele
519baf6501 revert accidental commit 2012-07-12 09:40:00 +00:00
Thomas Vander Stichele
97101ec972 add new file 2012-07-12 09:38:59 +00:00
Thomas Vander Stichele
a8a7a33b0a * morituri/common/checksum.py:
* morituri/common/program.py:
	  Fix/add logging.
2012-01-21 18:04:41 +00:00
Thomas Vander Stichele
8ec7bcbb9d * morituri/common/checksum.py:
* morituri/common/common.py:
	* morituri/common/encode.py:
	* morituri/image/image.py:
	* morituri/test/test_common_encode.py:
	  Moved quoteParse.
2011-08-05 19:18:10 +00:00
Thomas Vander Stichele
55c4bddfcf * morituri/common/Makefile.am:
* morituri/common/checksum.py:
	* morituri/common/gstreamer.py:
	* morituri/extern/Makefile.am:
	* morituri/extern/task/gstreamer.py:
	* morituri/common/gstreamer.py (added):
	  Extract function to remove audio parsers.
	  Fix up dist.
2011-08-05 19:04:53 +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
eee7505519 * morituri/common/checksum.py:
* morituri/common/gstreamer.py:
	  Remove audioparsers plugin if it has the known bug.
	  Fixes #64.
2011-05-24 16:03:02 +00:00
Thomas Vander Stichele
234ac4c644 * morituri/common/common.py:
Add an EmptyError.
	* morituri/common/checksum.py:
	  Set it when we don't get any frames.
	* morituri/rip/main.py:
	  Catch it and stop ripping if this happens.
2011-05-24 15:15:44 +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
ce71bfb5c2 * morituri/common/checksum.py:
* morituri/common/encode.py:
	* morituri/common/gstreamer.py:
	  Move play to base class of GstPipelineTask.
2011-05-23 18:02:48 +00:00
Thomas Vander Stichele
3482288750 * morituri/common/gstreamer.py:
Add a stop method and a stopped overridable handler.
	* morituri/common/checksum.py:
	* morituri/common/encode.py:
	  Adapt to using stopped.
2011-05-23 15:26:19 +00:00
Thomas Vander Stichele
6c2f3cc378 * morituri/common/checksum.py:
* morituri/image/image.py:
	* morituri/test/test_common_checksum.py:
	* morituri/common/gstreamer.py (added):
	  Factor out GstException and GstPipelineTask.
2011-05-21 17:01:19 +00:00
Thomas Vander Stichele
c301015537 * morituri/common/checksum.py:
* morituri/common/encode.py:
	* morituri/image/table.py:
	* morituri/rip/cd.py:
	* morituri/rip/image.py:
	* morituri/rip/offset.py:
	* morituri/test/test_common_accurip.py:
	* morituri/test/test_common_checksum.py:
	* morituri/test/test_image_cue.py:
	* morituri/test/test_image_table.py:
	  Pychecker fixes.
2011-05-21 11:50:39 +00:00
Thomas Vander Stichele
0da5dd0aa1 * morituri/common/checksum.py:
Actually raise the exception.
	* morituri/common/task.py:
	  Document interface more clearly.
	* morituri/test/test_common_checksum.py:
	  Use tcommon for test.common
2011-05-21 11:22:04 +00:00
Thomas Vander Stichele
e52d20c19a * morituri/common/checksum.py:
Create a GstException to wrap a Gst.GError.
	  Create a base GstPipelineTask class.
	  Use it in Checksum and TRM tasks.
	  Raise and don't proceed to call .paused() when a GstError happens.
	  Should help debug https://bugs.launchpad.net/bugs/735053
	* morituri/test/test_common_checksum.py:
	  Adapt test.
2011-03-15 22:44:05 +00:00
Thomas Vander Stichele
7515cf9e73 * morituri/common/checksum.py:
Style fixes.
	* morituri/common/common.py:
	  Add functions to convert a gst.TagList to a dict and compare them.
	* morituri/common/task.py:
	  Add setAndRaiseException which gives us an appropriate
	  exceptionMessage as if we raised where we called this new function.
2010-04-13 21:53:43 +00:00
Thomas Vander Stichele
3000f0a1e7 * morituri/common/common.py:
add quoteParse function to quote properly for gst.parse_launch()
	* morituri/common/checksum.py:
	  Fix single quote problem.
	  use self.setException()
	* morituri/common/encode.py:
	  Fix single quote problem.
	* morituri/image/image.py:
	  Fix single quote problem.
	  Reraise gst.QueryError.
	* morituri/test/test_common_encode.py:
	* morituri/test/test_common_encode.py (added):
	  Add tests for unicode/single/double quote.
	* morituri/test/test_image_image.py:
	* morituri/test/test_common_checksum.py:
	  Add tests for single/double quote.
	* morituri/test/common.py:
	  add twisted-like failUnlessRaises to TestCase that returns
	  the exception, so we can check wrapped exceptions in TaskException.
2010-04-04 23:20:52 +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
d9530cb82a * morituri/common/checksum.py:
* morituri/test/Makefile.am:
	* morituri/test/test_common_checksum.py (added):
	  Add a check to make sure that checksumming an empty file doesn't
	  hang.  Fix the hang.
2009-09-11 11:48:17 +00:00
Thomas Vander Stichele
1643d1ec50 * Makefile.am:
* misc/pycheckerrc:
	* morituri/common/accurip.py:
	* morituri/common/checksum.py:
	* morituri/common/encode.py:
	* morituri/image/table.py:
	* morituri/rip/drive.py:
	  Fix up for pychecker warnings for 2.6
	  Fix rip drive list, which forgot some modules.
2009-06-20 10:57:12 +00:00
Thomas Vander Stichele
7e0e24adb9 more pychecker fixes 2009-05-22 20:52:29 +00:00
Thomas Vander Stichele
fa8239d1f5 * morituri/common/checksum.py:
More pychecker fixes.
2009-05-22 20:44:51 +00:00
Thomas Vander Stichele
41c92fcda4 pychecker fixes 2009-05-22 20:44:10 +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
204c5d6212 add another constant before we move 2009-05-16 09:16:09 +00:00
Thomas Vander Stichele
d22bff1079 * morituri/common/checksum.py:
Update debugging.  Add repr.
2009-05-04 08:39:39 +00:00
Thomas Vander Stichele
e3c42ddf64 remove ellipses 2009-05-03 19:16:20 +00:00
Thomas Vander Stichele
143a70b72a * morituri/common/checksum.py:
Debug fixes.
2009-05-01 18:30:09 +00:00