From 145403705d3a8cc1bdb64398d27dc5ef3a326b35 Mon Sep 17 00:00:00 2001 From: Andreas Oberritter Date: Thu, 24 May 2018 17:11:37 +0200 Subject: [PATCH] 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 --- .travis.yml | 2 +- README.md | 3 ++- whipper/command/cd.py | 3 --- whipper/command/offset.py | 3 --- whipper/extern/task/task.py | 5 ++++- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2e1ee27..3bccf52 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ install: # Dependencies - sudo apt-get -qq update - sudo pip install --upgrade -qq pip - - sudo apt-get -qq install cdparanoia cdrdao flac libcdio-dev libiso9660-dev libsndfile1-dev python-cddb python-gobject python-musicbrainzngs python-mutagen python-setuptools sox swig libcdio-utils + - sudo apt-get -qq install cdparanoia cdrdao flac gir1.2-glib-2.0 libcdio-dev libiso9660-dev libsndfile1-dev python-cddb python-gi python-musicbrainzngs python-mutagen python-setuptools sox swig libcdio-utils - sudo pip install pycdio==0.21 requests # Testing dependencies diff --git a/README.md b/README.md index 361b4ad..195222c 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,8 @@ Whipper relies on the following packages in order to run correctly and provide a - [cd-paranoia](https://www.gnu.org/software/libcdio/), for the actual ripping - To avoid bugs it's advised to use `cd-paranoia` **10.2+0.94+2-2** - [cdrdao](http://cdrdao.sourceforge.net/), for session, TOC, pre-gap, and ISRC extraction -- [python-gobject-2](https://packages.debian.org/en/jessie/python-gobject-2), required by `task.py` +- [GObject Introspection](https://wiki.gnome.org/Projects/GObjectIntrospection), to provide GLib-2.0 methods used by `task.py` +- [PyGObject](https://pypi.org/project/PyGObject/), required by `task.py` - [python-musicbrainzngs](https://github.com/alastair/python-musicbrainzngs), for metadata lookup - [python-mutagen](https://pypi.python.org/pypi/mutagen), for tagging support - [python-setuptools](https://pypi.python.org/pypi/setuptools), for installation, plugins support diff --git a/whipper/command/cd.py b/whipper/command/cd.py index b77ecda..cd83cfc 100644 --- a/whipper/command/cd.py +++ b/whipper/command/cd.py @@ -24,7 +24,6 @@ import os import glob import sys import logging -import gobject from whipper.command.basecommand import BaseCommand from whipper.common import ( accurip, config, drive, program, task @@ -32,8 +31,6 @@ from whipper.common import ( from whipper.program import cdrdao, cdparanoia, utils from whipper.result import result -gobject.threads_init() - logger = logging.getLogger(__name__) diff --git a/whipper/command/offset.py b/whipper/command/offset.py index 0b30eb7..8417c94 100644 --- a/whipper/command/offset.py +++ b/whipper/command/offset.py @@ -23,15 +23,12 @@ import os import sys import tempfile import logging -import gobject from whipper.command.basecommand import BaseCommand from whipper.common import accurip, common, config, drive from whipper.common import task as ctask from whipper.program import arc, cdrdao, cdparanoia, utils from whipper.extern.task import task -gobject.threads_init() - logger = logging.getLogger(__name__) # see http://www.accuraterip.com/driveoffsets.htm diff --git a/whipper/extern/task/task.py b/whipper/extern/task/task.py index 3e2fc16..6ae81a4 100644 --- a/whipper/extern/task/task.py +++ b/whipper/extern/task/task.py @@ -21,7 +21,10 @@ import logging import sys -import gobject +try: + from gi.repository import GLib as gobject +except ImportError: + import gobject logger = logging.getLogger(__name__)