Skip to content

Commit

Permalink
Show dependency information in about dialog
Browse files Browse the repository at this point in the history
- Idea borrowed from quodlibet
  • Loading branch information
virtuald committed Apr 29, 2017
1 parent 7ccb301 commit 6c6a40f
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 23 deletions.
22 changes: 15 additions & 7 deletions xl/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,15 @@ def __init(self):
"""
Initializes Exaile
"""
# pylint: disable-msg=W0201
logger.info("Loading Exaile %s on Python %s..." % (__version__, platform.python_version()))


logger.info("Loading Exaile %s..." % __version__)

from gi.repository import GObject
from .version import register

register('Python', platform.python_version())
register('PyGObject', '%d.%d.%d' % GObject.pygobject_version)

logger.info("Loading settings...")
try:
from xl import settings
Expand All @@ -371,9 +377,11 @@ def __init(self):
import locale
lc, enc = locale.getlocale()
if enc is not None:
logger.info("Using %s %s locale" % (lc, enc))
locale_str = '%s %s' % (lc, enc)
else:
logger.info("Using unknown locale")
locale_str = _('Unknown')

register('Locale', locale_str)
except Exception:
pass

Expand Down Expand Up @@ -569,13 +577,13 @@ def mainloop_init(self):
from gi.repository import GObject

major, minor, patch = GObject.pygobject_version
logger.info("Using PyGObject %d.%d.%d", major, minor, patch)

if major < 3 or \
(major == 3 and minor < 10) or \
(major == 3 and minor == 10 and patch < 2):
# Probably should exit?
logger.warning("Exaile requires PyGObject 3.10.2 or greater!")
logger.warning("Exaile requires PyGObject 3.10.2 or greater! (got %d.%d.%d)",
major, minor, patch)

if self.options.Dbus:
import dbus, dbus.mainloop.glib
Expand Down
5 changes: 5 additions & 0 deletions xl/metadata/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
import logging
logger = logging.getLogger('xl.metadata')

from xl import version
import mutagen
version.register('Mutagen', mutagen.version_string)


INFO_TAGS = ['__bitrate', '__length']

# Generic description of cover images
Expand Down
10 changes: 3 additions & 7 deletions xl/player/gst/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
from gi.repository import Gst
Gst.init(None)

import logging
logger = logging.getLogger(__name__)

try:
__gst_version__ = '%s.%s.%s' % (Gst.VERSION_MAJOR,
Gst.VERSION_MINOR,
Expand All @@ -26,8 +23,7 @@
__gst_version__ = '**unknown version < 1.3.3**'


logger.info("Using GStreamer %s", __gst_version__)

del logger
del logging
from xl.version import register
register('GStreamer', __gst_version__)

del register
13 changes: 12 additions & 1 deletion xl/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
# from your version.

import os
import xdg
from . import xdg

import logging
logger = logging.getLogger(__name__)

major = "4.0"
minor = "0"
Expand Down Expand Up @@ -53,3 +56,11 @@ def get_current_revision(directory):
extra += "+" + revision

__version__ = major + "." + minor + extra

__external_versions__ = {}

def register(name, version):
'''Registers versions of external components for diagnostic purposes'''
if name not in __external_versions__:
__external_versions__[name] = version
logger.info("Using %s %s", name, version)
9 changes: 4 additions & 5 deletions xlgui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
import logging
logger = logging.getLogger(__name__)

logger.info("Using GTK+ %s.%s.%s", Gtk.MAJOR_VERSION,
Gtk.MINOR_VERSION,
Gtk.MICRO_VERSION)

import os
import sys

Expand All @@ -45,12 +41,15 @@
player,
providers,
settings,
version,
xdg
)
from xl.nls import gettext as _
from xlgui import guiutil


version.register("GTK+", "%s.%s.%s" % (Gtk.MAJOR_VERSION,
Gtk.MINOR_VERSION,
Gtk.MICRO_VERSION))

def mainloop():
from xl.externals.sigint import InterruptibleLoopContext
Expand Down
14 changes: 11 additions & 3 deletions xlgui/widgets/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,17 @@ def __init__(self, parent=None):
logo = GdkPixbuf.Pixbuf.new_from_file(
xdg.get_data_path('images', 'exailelogo.png'))
self.set_logo(logo)
from xl.main import __version__
self.set_version(__version__)


import xl.version

self.set_version(xl.version.__version__)

comments = []
for name, version in sorted(xl.version.__external_versions__.iteritems()):
comments.append('%s: %s' % (name, version))

self.set_comments('\n'.join(comments))

def on_response(self, *_):
self.destroy()

Expand Down

0 comments on commit 6c6a40f

Please sign in to comment.