Cleanup dependencies, remove D-Bus mock code

This commit is contained in:
Thomas Perl 2011-07-15 17:55:38 +02:00
parent b2c6836173
commit 819a97b59d
5 changed files with 10 additions and 59 deletions

7
README
View File

@ -33,11 +33,10 @@
* python-gtk2 (>= 2.12)
* python-feedparser
* python-mygpoclient (>= 1.4; http://thp.io/2010/mygpoclient/)
* python-dbus (optional, but highly recommended)
* python-dbus
If your Python installation does not come with "sqlite3" support,
you can either re-compile Python with support for sqlite3 or use
the "pysqlite" package from http://code.google.com/p/pysqlite/
As an alternative to python-dbus, you can use the fake D-Bus module
provided in "tools/fake-dbus-module/".
Dependencies for the QML UI:

View File

@ -31,22 +31,7 @@ _ = gpodder.gettext
import sys
have_sqlite = True
try:
from sqlite3 import dbapi2 as sqlite
from sqlite3 import OperationalError
except ImportError:
try:
from pysqlite2 import dbapi2 as sqlite
from pysqlite2.dbapi2 import OperationalError
except ImportError:
have_sqlite = False
# TODO: show a message box
if not have_sqlite:
print >>sys.stderr, 'Please install pysqlite2 or Python 2.5.'
sys.exit(1)
from sqlite3 import dbapi2 as sqlite
import logging
logger = logging.getLogger(__name__)

View File

@ -26,12 +26,8 @@ import gpodder
from gpodder import util
try:
import dbus
import dbus.service
except ImportError:
# Import Mock D-Bus interfaces when D-Bus bindings are not installed
from gpodder.gui import dbus
import dbus
import dbus.service
def safe_str(txt):
if txt:

View File

@ -38,33 +38,10 @@ import cgi
import gpodder
try:
import dbus
import dbus.service
import dbus.mainloop
import dbus.glib
except ImportError:
# Mock the required D-Bus interfaces with no-ops (ugly? maybe.)
class dbus:
class SessionBus:
def __init__(self, *args, **kwargs):
pass
def add_signal_receiver(self, *args, **kwargs):
pass
class glib:
class DBusGMainLoop:
def __init__(self, *args, **kwargs):
pass
class service:
@staticmethod
def method(*args, **kwargs):
return lambda x: x
class BusName:
def __init__(self, *args, **kwargs):
pass
class Object:
def __init__(self, *args, **kwargs):
pass
import dbus
import dbus.service
import dbus.mainloop
import dbus.glib
from gpodder import core
from gpodder import feedcore

View File

@ -25,12 +25,6 @@
#
try:
import dbus
except ImportError:
# Import Mock D-Bus interfaces when D-Bus bindings are not installed
from gpodder.gui import dbus
import gpodder
import urllib